If I have four Raspberry Pi acting as different sensors and I want to communicate their sensor data to a central computing device located in the same physical space, what type of network communication should I use?

Based on my limited understanding of network communication and a little bit of research, it seems like I can establish some type of ad-hoc wireless network without an access point. An example would be a mesh network where every device has communication to each other. But isn't this redundant if I just want to send my sensor data to a central node? I also want to avoid any physical wiring hence I'm looking for a wireless network setup that has low energy consumption and fast performance as I intend to do real-time image and object recognition on the central computer.

  • You are asking 2 related questions: 1. What sort of network? Every node can communicate directly with every other node in a fully-meshed network. You are looking for a partially-meshed architecture in which intermediate nodes can transfer traffic between nodes that are otherwise unable to reach each other. Zigbee can support a partial mesh, for example .2. What protocol? As noted in the answers, MQTT is a natural fit for what you're trying to do, and can scale to large numbers of devices.
    – bobstro
    Oct 4, 2017 at 20:32
  • Great guidance, I appreciate looking at the questions from an architecture and protocol perspective. Potentially I can install MQTT on the raspberry Pis and on the central node to get them start talking right? At this point do I even need to worry about the architecture? Oct 5, 2017 at 3:21
  • You install an MQTT server (broker) on a computer that can be reached by all of the nodes that need to communicate. MQTT is firewall-friendly, so traversing NAT is not an issue for the clients. Clients publish data to the broker, and subscribe to topics from the broker. It's a lightweight protocol and scales very well. Clients don't need to know anything about each other. They just publish and subscribe to topics of interest (akin to database record fields). You can enforce security in several ways, but it's always very lightweight in terms of configuration. May not be sufficiently real-time.
    – bobstro
    Oct 5, 2017 at 5:33

1 Answer 1


MQTT is a message transport protocol.

Install "mosquitto" a MQTT hub on the central node, and the clients on the sensor nodes.

See my reply here that describes MQTT a bit more: https://iot.stackexchange.com/questions/2153/standards-for-non-internet-connected-wifi-devices

  • "perfect" is very subjective, in this case what is important is OPs concept of "real-time", which usually implies a level of timing determinism, an asynchronous message protocol is not ideal for this requirement. What OP may need is a field bus and PLC, which can, in principle be done on raspberry pi.
    – crasic
    Oct 4, 2017 at 21:25
  • Removed "perfect", and I now see that OP want a solution that is hard to achieve, "low energy consumption and fast performance".
    – MatsK
    Oct 4, 2017 at 21:31
  • EtherCAT may be a good choice... 1 ms network cycle time with very low power, requires cabling, but works over fiber with runs up to 30KM. All sensors updated in same poll cycle.
    – crasic
    Oct 4, 2017 at 21:40
  • Say I can give up low energy consumption by giving the Raspberry Pis power adapters. Then what would be the fastest way to transfer data from 4 Pis to a central processing device over wireless communication. Oct 5, 2017 at 3:19
  • One key point is going to be whether the images are intended to be transferred from the sensors, or processing on the central simply triggered by the sensors. I can read your original question either way. How much data are you transferring? There may be throughput issues with wireless as implemented on the RPi. Timing dependencies and need for synchronization is going to drive a lot of your options. It might help if you described what you want to do more specifically rather than in general terms.
    – bobstro
    Oct 5, 2017 at 5:39

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.