esp8266-iot-framework icon indicating copy to clipboard operation
esp8266-iot-framework copied to clipboard

Holding connections open for long periods of time

Open chrisco484 opened this issue 2 years ago • 3 comments

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?

chrisco484 avatar Feb 01 '22 01:02 chrisco484

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=

erikm30 avatar Feb 01 '22 18:02 erikm30

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?

chrisco484 avatar Feb 01 '22 22:02 chrisco484

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

marcolino7 avatar Mar 02 '22 09:03 marcolino7

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

maakbaas avatar Sep 04 '22 17:09 maakbaas