At the moment I'm working with the Arduino and SIM900, well, I could say I'm intermediate with the SIM, I could accomplish sending data to my website and receiving data from another phone. But now I would need that when I press a toggle button on my website it will send a message to the SIM900, for example, If I check the button it will send 1 if uncheck it, it will send 0. The problem is, I don't know how to start, I already searched up how to send data to the SIM900, But what I always get is the SIM making a request to the server, I would need the server to send the message whenever it is pressed, without the need of the SIM to keep making requests. Will I need an API for this? Please Help
Asked
Active
Viewed 95 times
1
-
use UDP to burrow tunnel from device to the server and ping server over such "connection" with small frame per several minutes for NATs to keep translation tables alive. When server needs to sends something to device it will have alive channel to push event to device. And of course you could keep tcp connection alive for the same purpose but I suspect that UDP will be enough. – Maxim Sagaydachny Dec 16 '19 at 15:37
1 Answers
0
Your phone (client) is behind a NAT. To reach it, you should read about NAT Traversal tactics, which will enable you to push a message to a client. You can achieve that with Socket.IO or MQTT. Your server will have a piece of code that the client should connect to when it's up, and the server will maintain the connection alive so that the server can push messages over this connection.

Rami Khawaly
- 126
- 3
- 14