Yes, should have said that. I really don’t understand chars as well as I probably should, but .c_str() function seems to be a get out of jail free card so I use it whenever I need to.
If you want you can connect the MQTT node direct to a Blynk ws write node which pushes the data to a display widget.
I use the Windows version of MQTT Explorer:
I’m running v0.2.5, which is classed as pre-release, but seems fine. You have to click the ‘assets’ link.
I struggled a bit to find the right download link for windows, but this is the correct one:
https://github.com/thomasnordquist/MQTT-Explorer/releases/download/0.0.0-v0.2.5/MQTT-Explorer-Setup-0.2.5.exe
MQTT Explorer is nice because it allows you to explore the topic structure easily, and shows you history and graphs for things like RSSI and Free Memory…
You’ll see that I really did go over the top with my ‘basic’ configuration. When the device firsts boots and connects to Wi-Fi/MQTT I output lots of information including:
I* P Address
- MAC Address
- Filename of the firmware file
- Compiled date and time of the firmware file
- Client ID
- Heartbeat frequency (this is randomized between 4 and 7.5 seconds on my devices)
The Heartbeat routine outputs:
- RSSI
- Free Memory
- Uptime
I also count how many times the millis() value has hit the 49 day mark and rolled-over back to zero. This plus my Uptime value will tell me how long the device has been up for.
I also update counter for Wi-Fi reconnect count and MQTT reconnect count
I also played with also running Blynk directly on a device, with a different Auth code to the one used for the device in Node-Red, so that I could use the serial to Terminal widget code that we were using in the other thread. This is disabled on this device, but if it’s enabled then I also publish MQTT messages with Blynk Auth code, connection status, re-connect count etc.
The other MQTT topics are to do with controlling RGB LEDs.
In reality, this has become far too complex, but it is nice to have the ability to drop these functions in without having to do any real head-scratching and debugging if I need them.
If you want code to be able to capture and publish any of these things via MQTT then just let me know
Pete.