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
esptool.py v3.0
Serial port COM4
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:53:bA:0a
Uploading stub...
Running stub...
Stub running...
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.
Leaving...
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.
Leaving...
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:[1] AutoConnect
*wm:[1] No Credentials are Saved, skipping connect
*wm:[2] Starting Config Portal
*wm:[2] AccessPoint set password is VALID
*wm:[2] Disabling STA
*wm:[2] Enabling AP
*wm:[1] StartAP with SSID: OpenMQTTGateway_ESP8266_RF
*wm:[1] AP IP address: 192.168.4.1
*wm:[1] Starting Web Portal
*wm:[2] HTTP server started
*wm:[2] Config Portal Running, blocking, waiting for clients...
*wm:[2] 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:
0.9.16
QoS: 0 - Retain: false
Message 162 received on home/OpenMQTTGateway_ESP8266_RF/LWT at 9:08 AM:
online
QoS: 0 - Retain: false
So excellent!
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:
'-UZmqttDiscovery="HADiscovery"'
So this makes me think Auto discovery is enabled by default. Or must it be enabled/forced in platformio.ini
[env:nodemcuv2-rf] ?
- 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:
{
"automation_type": "trigger",
"type": "button_short_press",
"subtype": "turn_on",
"topic": "home/OpenMQTTGateway_ESP8266_RF/433toMQTT",
"device": {
"identifiers": [
"5AA375CBBA0A"
],
"via_device": "OpenMQTTGateway_ESP8266_RF"
}
}
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.