maakbaas / esp8266-iot-framework

Framework for IoT projects implementing HTTPS requests, a React web interface, WiFi manager, live dashboard, configuration manager, file manager and OTA updates.
GNU General Public License v3.0
417 stars 113 forks source link

Holding connections open for long periods of time #144

Closed chrisco484 closed 2 years ago

chrisco484 commented 2 years ago

This framework looks very nice indeed!

I am thinking of an application of this framework where I would like the ESP8266 to act as device that can both send and receive data/commands to a secure (https) website in the cloud asynchronously - i.e. I don't want the device to be regularly sending "have you got any thing for me?" pings on the webserver all day long.

A couple of questions:

  1. Do you see any issues with holding open the https socket connection for extended periods of time (e.g. weeks or months) instead of a "snatch and grab" request which closes after the response is received.
  2. Do you think it would be possible to use WebSockets to send data/initiate commands from the server back to the device?
erikm30 commented 2 years ago

My 2 cents here: Why don't you just use MQTT(s) ? That is actually the protocol intended for such use cases. What is special about your use case to have such a requirement=

chrisco484 commented 2 years ago

My 2 cents here: Why don't you just use MQTT(s) ? That is actually the protocol intended for such use cases. What is special about your use case to have such a requirement=

I was thinking about that but thought that websockets over https may give a more streamlined path to a secure bidirectional connection or is MQTT just as easy to secure with TLS?

marcolino7 commented 2 years ago

I was thinking about that but thought that websockets over https may give a more streamlined path to a secure bidirectional connection or is MQTT just as easy to secure with TLS?

MQTT can use SSL/TLS, take a look over here: https://www.hivemq.com/blog/mqtt-security-fundamentals-tls-ssl/ http://www.steves-internet-guide.com/mosquitto-tls/

Marco

maakbaas commented 2 years ago

This question is unrelated to the framework at the moment, indeed websockets or MQTT would be better solutions for this