1
votes

I am working on a system where multiple devices (autonomous vehicles, smartphones and stationary sensors) collect data, send it to a backend and perform commands submitted by users through a web frontend. The devices communicate with the backend wirelessly through a cellular connection or wifi. The backend needs to be able to command each device independently. At the moment the devices do not need to communicate with each other.

There will be up to 10-20 devices, transmitting several times per second at up to 10 kb/s each. Except for control messages, most of the data is sent repeatably and only the most recent instance is of interest. Some units will be coded by a third party, so the client should be fairly easy to implement using C# (x64) and Python/C++ (ARM64).

I am looking for a message protocol / broker that allows for direct bidirectional client-server communication. So far I have looked into:

  1. Plain TCP - too much boilerplate to get message-based communication to work (especially relevant for third parties), and I would prefer having a fallback option to HTTP in case of a restrictive carriers / firewalls.
  2. ZeroMQ (probably with ROUTER/DEALER) - same comment about HTTP.
  3. MQTT - while I do like the simplicity of the protocol and client-side usage, I do not really need Pub-Sub, just a bidirectional client-server channel.
  4. AMQP / RabbitMQ - seems like an overkill, and same comment about Pub-Sub.
  5. gRPC - no easy way to stream multiple message types from server to client, and I am not sure how HTTP/2 would work over restrictive carriers / firewall.
  6. WebSockets - my leading option right now, although I am not sure how well it will handle connection drops over cellular.

Are there any other suggested protocols? Is there anything I missed in my review?

1

1 Answers

0
votes

aioconnectors is an exact fit for your scenario, it simply allows for bidirectional client server communication. In fact it is a similar approach than the websocket option, with added support for the connection drops you want, and more.

Documentation here : https://pypi.org/project/aioconnectors/

Short demo here : https://www.youtube.com/watch?v=ZSoomtVcGxE