1
\$\begingroup\$

I am working on a Embedded Device using Linux operating System. The device is having a local database for storing sensor information and motor state. This device will be used for controlling a motor and getting some sensor data.

I made a node.js based webserver on this device and made some GET API's for getting the data and controlling the motor also. ( On Local LAN ).

I have to control more number of device using cloud And also I am having a Server with Linux Operating System. (PC).

Now My Question is: How to Control All my devices connected on local lan with internet connectivity, from my Linux Server individually.

I mean, my Linux Server is not aware of my deices's IP and even my devie is not directly accessed from Internet.( because Routing is difficult ).

I need suggestions......Please help me.

\$\endgroup\$
2
  • \$\begingroup\$ This might fit better on stackoverflow. \$\endgroup\$ Commented Oct 27, 2014 at 15:57
  • \$\begingroup\$ You might find it easiest to get (rent an instance, etc) a server on the public Internet, and have your various embedded devices check in with that when they boot up. You should be able to maintain TCP connections while consuming little to no bandwidth (perhaps a keep-alive every half hour) and as long as one of those exists, the server can get a message down to the embedded device. If the embedded device loses it's connection it can enter a try/wait/retry loop to reconnect. \$\endgroup\$ Commented Oct 27, 2014 at 16:48

1 Answer 1

1
\$\begingroup\$

It's easier to tell all your devices "where the server is" than it is to tell your server "where all the devices are". It's much easier to ensure that a single server is reachable from all your devices than it is to ensure all of your devices are reachable from your server.

So normally you would have the embedded devices connect to the server rather than vice-versa. If you need to be able to request/control stuff then it's pretty easy to keep a TCP connection open continuously. Just make sure you put in place a protocol for checking the connection is still alive and if-no reestablishing it.

Depending on deployment scenarios it may be acceptable to hardcode the server address when the embedded devices are built or it may be nessacery to make that configuraable.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.