I'm working on a IoT project where i have a central platform hosting my application and multiple small devices in the wild (untrusted environment).
Today, the central application can command the devices by sending them requests through http and the device response is handled in the http response. The devices can also send notification to the server without being requested.
I am now thinking about the architecture to deploy this kind of features, the requirements are:
- be able to connect to the device from distance to perform maintenance (ssh)
- send requests to devices
- receive infos from devices
I have two setups in mind:
First : Each devices connect to a VPN, they register somewhere so I can contact them using deviceA.dns etc. Because they are in a VPN, I can securely connect to the devices using ssh.
Second : We already use rabbitmq. So I was thinking about each devices registering to an AMQP endpoint and multiple queues: inbound queue for requests from server, outboud for all notifications etc. This does not solve the connection from distance using ssh. But maybe with some reverse ssh it should do the trick.
What do you think ? Is there a recommended 'way' of achieving this goal which seems common in IoT projects ?
Thank you.