Thank you for your feedback once more. Is there a way to flash erase nodemcu8266 via vscode+platformio ? As I don’t know, this is what I did:
===== step 1
esptool.py --port COM4 --baud 115200 --after no_reset write_flash --flash_size detect --flash_mode dio 0x00000 C:\Users\myuser\nodemcuv2-rf-firmware.bin --erase-all
Serial port COM4
Detecting chip type... ESP8266
Chip is ESP8266EX
Crystal is 26MHz
Configuring flash size...
Auto-detected Flash size: 4MB
Erasing flash (this may take a while)...
Chip erase completed successfully in 6.2s
Flash params set to 0x0240
Compressed 580688 bytes to 411283...
Wrote 580688 bytes (411283 compressed) at 0x00000000 in 36.4 seconds (effective 127.7 kbit/s)...
Hash of data verified.
Staying in bootloader.
Firmware successfully flashed. Unplug/replug or reset device
to switch back to normal boot mode.
Result: OpenMQTTGawteway_ESP8266_RF SSID shows and Wifi-Manager can be accessed
===== step 2
flash source code (with edits described in my previous post) via vscode+platformio
Writing at 0x00060000... (96 %)
Writing at 0x00064000... (100 %)
Wrote 580704 bytes (411321 compressed) at 0x00000000 in 36.4 seconds (effective 127.7 kbit/s)...
Hash of data verified.
Hard resetting via RTS pin...
================================================================================================= [SUCCESS] Took 47.80 seconds =================================================================================================
--- Terminal on COM4 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
N: Connect your phone to WIFI AP: OpenMQTTGateway_ESP8266_RF with PWD: your_password
*wm: No Credentials are Saved, skipping connect
*wm: Starting Config Portal
*wm: AccessPoint set password is VALID
*wm: Disabling STA
*wm: Enabling AP
*wm: StartAP with SSID: OpenMQTTGateway_ESP8266_RF
*wm: AP IP address: 192.168.4.1
*wm: Starting Web Portal
*wm: HTTP server started
*wm: Config Portal Running, blocking, waiting for clients...
*wm: Portal Timeout In 120 seconds
Result: OMG with custom edits to source file successfully flashed, SSID showing and WiFi-Manager running as well. Excellent! Subscribing to broker shows:
Message 163 received on home/OpenMQTTGateway_ESP8266_RF/version at 9:08 AM:
QoS: 0 - Retain: false
Message 162 received on home/OpenMQTTGateway_ESP8266_RF/LWT at 9:08 AM:
QoS: 0 - Retain: false
Now, for consideration:
If you know of a way to flash erase nodemcu8266 via vscode+platformio I would thank you for sharing the info. Otherwise, I managed to get it working via my “workaround”.
I think in (Option 3) Upload your configurations, at the beginning of Configure & Upload with PlatformIO, there should be a sentence that reads:
If the board (NodeMCU8266…) has been previously flashed and in your current setting you would like to use Wifi-Manager, you are strongly encouraged to erase flash the board before uploading your configuration. To achieve that, please flash your board as described in (Option 2) Upload ready-to-go binaries. You can proceed with the steps described in this section only after successful erase flashing.
Maybe there is no need for 2) I mean, there are really advanced users who do not need that. I’m taking a broader perspective here considering all sorts of users. But I could edit that page so that you/admin can later edit/review/approve. Please, let me know.
Two doubts here and no more.
- Is Auto discovery enabled by default? The monitor window in vscode shows
N: OpenMQTTGateway modules: ["RF"]
shouldn’t it be showing something like
N: OpenMQTTGateway modules: ["RF+HADiscovery"]
I have already enabled Auto discovery in my MQTT integration. However, in Auto discovery section
With platformio you can deactivate discovery by adding:
So this makes me think Auto discovery is enabled by default. Or must it be enabled/forced in platformio.ini
- When I force the PIR sensor (wave hand) the following message is published:
Message 95 received on homeassistant/device_automation/5AA375CBBA0A--4645868-RF/config at 10:14 AM:
That same value 4645868 is shown by entity sensor.gatewayrf
I expected a new entity to be automatically created such as maybe sensor.4645868 or sensor.5AA375CBBA0A so that I can add it to the dashboard or make automations. So with that message, what would be the way to make use of it?
Thank you once more.