How to send commands to arduino connected to the Internet?
Consider an arduino board + WiFi shield connected to the Internet using my local home WiFi router. I want to send a command to the arduino board to turn on a LED from my server in the cloud. I can think of the following 4 ways in which this can be done, but wanted to know if there was a de-facto standard way of doing this?
1. Polling: Arduino board keeps polling the server to check if it needs to turn on the LED.
2. Long lived HTTP connections: Arduino board makes a GET HTTP request to the server, and the server does not respond until it wants the LED to turn on.
3. Websockets: Assuming arduino WiFi shield supports it, arduino board initiates a websocket connection with the server and gets the message to turn on LED.
4. Web server: Arduino board starts a webserver (after a bit of port forwarding magic on my WiFi router) and my server in the cloud sends it a GET HTTP request to turn on the LED.