Hi first of all, first-time poster so sorry if I broke any rules.
So I'm building a connected working buddy and I'm looking for the best way to send commands to my device from a web service hosted somewhere in the cloud. Obviously I cannot send a request directly to a local IP from outside of the network and port forwarding is not an option.
I'm contemplating between:
- Something like a polling system where the ESP will check a URL every few seconds and if there is a new command for it, the ESP will see that on the URL and send an acknowledgment that the message has been received.
- A WebSocket connection between the ESP and the web service where messages will be instantaneously received. I have seen some Websocket libs for ESP ( https://github.com/espressif/esp-idf/tree/7d75213674b4572f90c68162ad6fe9b16dae65ad/components/esp_websocket_client )
- Something else?
What would be the best option to tackle this problem? and what would be the easiest?
Thanks! also, non-native English speaker. Bear with me :)