The use of the ESP8266 in the world of IoT

User avatar
By saabman
#40456 Hi,

Im in the process of building an IOT device that will connect to an energy monitor and read current energy available (power generated - power consumed) and control a device - ie turn it on if there is sufficient energy available, turn it off if there is insufficient power availble.
An extension would be to control the power consumtion of the connected device - ie Limitpower available to say a hotwater heater.

There is nothing realy unique about what im doing but In my design consideration I Was wondering what is the "best Practice" for an IOTdevice - should I maintain a permant connection to the AP and poll the server as required or is it more appropriate to establish a new connection to the AP each time?
User avatar
By awall
#40497 Hi saabman,
I would suggest a pub/sub protocol like MQTT. It offers out of the box a light approach to saving bandwidth and power, and QoS would also help if the application is critical.
I would not try to re-invent something else, unless you have valid reasons to.

Andrea
User avatar
By saabman
#40899 Thanks for the tip Andrea,

Unfortunately in my application it does not appear that MQTT may not work as the data is published by an arduino web server ( an adaption of powermon). As I understand it MQTT requires something more substantial like a pi to host the "server"
User avatar
By Andrew Grande
#40904
saabman wrote:Thanks for the tip Andrea,

Unfortunately in my application it does not appear that MQTT may not work as the data is published by an arduino web server ( an adaption of powermon). As I understand it MQTT requires something more substantial like a pi to host the "server"


You can use any of the public mqtt servers if you want. Your device does not need to be always on. Mqtt bodes well to edges which are mostly sleeping too - wake up and send data, sleep again.

You can reinvent everything yourself, sure, but we were asked for best practices ;)