2

Has anyone here setup an MQTT Broker on an Arduino? I am looking to use pubsubclient to send sensor data from 12 individual wireless sensors to an Arduino every 250ms. I know this can be done using a Raspberry Pi, but I am new to all this and am just now comfortable with programming an Arduino. I also looked at using XBee, but have heard it may not be able to handle the data frequency. I am only sending 1 byte of data from each sensor each time. Any help or suggestion is appreciated.

5
  • Maybe link to some info on MQTT. From my limited understanding, MQTT is on top of a TCP/IP stack, so to send one byte per observation, there would need to be quite a few bytes of overhead.
    – Dave X
    Mar 13 '16 at 0:30
  • 1
    Sending one byte of data over MQTT is incredibly inefficient. You would be better off using a simple serial protocol of some form and forgetting about MQTT to send data between little nodes like this. By all means use MQTT to publish it out onto the internet somewhere, but internally don't use MQTT.
    – Majenko
    Mar 13 '16 at 1:57
  • Majenko: when you say to use a simple serial protocol, can you give an example of what you mean? What hardware would be needed at the sensors to transmit, and at the arduino to receive it? I do not need to publish to the web, just from the 12 unique sensors wirelessly to a single arduino.
    – user19216
    Mar 13 '16 at 19:41
  • One additional piece of info, the physical distance from the sensors to the Arduino is about 10 ft. I'm sure that plays into how this could be done. I looked at using RF24, but read that it is limited to just 6 connections communicating in an organized manner.
    – user19216
    Mar 13 '16 at 19:51
  • MQTT is TCP based. A nodeMCU (think of it as a super-Arduino) has a 5 concurrent connections limit. I don't know about Arduino WiFi shields, but I doubt it can handle more than that.
    – user31481
    Jul 3 '17 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy