-1

I'm designing firmware for the first time, and I've come across a pattern that I'm not sure how to solve. I need to be able to push arbitrary messages to embedded devices. The contents can be anything from octet stream to json. The embedded devices are not directly accessible over the network, however they can call out to the internet.

The obvious solution would be polling. But I'd like to use a push mechanism for more real time communication if possible.

Is there a scaleable way, for example, to open a socket from the client side (embedded device), and then hold it open to allow message pushes from the server side (cloud)?

Riley Laine
  • 181
  • 2
  • 11

1 Answers1

2

Each network channel from an embedded device to the server will require network and memory resources from the server. Over a large scale it could exhaust the server, and it won't be able to hold open all of the connections.

One possible solution for your case is that each embedded device will register itself on the server, and tell it how to connect back to it when needed. When content will be distributed, the server will connect back to each embedded device and push it. This way the connections will be alive only when needed, and maybe it would enable the server to connect back to the embedded devices.

For example, let us assume that the embedded device could be connected directly over the network using their IP address. During the registration, the clients will connect to the server and he would register their IP addresses. As long as these addresses remain fixed, the server will now be able to push content to the remote devices.

eyalitki
  • 211
  • 1
  • 4
  • > The embedded devices are not directly accessible over the network. Their IP addresses are not fixed and they have no access to firewalls. There is no way for a server to initiate a connection to a client. – Riley Laine Jan 28 '19 at 05:43