Closed mitra42 closed 2 weeks ago
I'm leaning towards lwmqtt because it claims to be simple and light/
There is also a wrapper arduino-mqtt which uses callbacks. And it looks like this is what is needed as the other is a non-arduino (e.g. uses pthreads)
Base level works as a demo - sends and receives a hello world message. Probably needs some kind of broker on my naturalinnovation.org server, and then to add authentication.
Need to also think through structure for MQTT variables and payloads. I think this will need copying the payload out of the buffer which might mean dealing with the type.
Design straw person .....
Next steps would be to do this with the SHT31 sensor, and then an actuator (which could be on a separate device) to turn on LEDS when humidity exceeds base level
There is now a live working demo where a SHT30 sensor detects humidity , sends it to the MQTT broker. Then control_demo_mqtt receives that value, checks against a reference humidity and sends a value via the MQTT server to actuator_ledblinken.
Note that this should work even if the LED and SHT30 are on different devices, but I don't currently have a way to test that.
Closing as all minor issues (with own issues) and MQTT is working well -
Part of #20
The node needs to connect to a MQTT broker and send/receive messages from it.
There are a LOT of MQTT libraries, and its not clear which is the best - comments are welcome.
My plan is to build on one of them for the POC, and then allow for coming back and re-engineering, ideally just this module, if there is a better one to use.
Its dependent on WiFi connectivity.