5

I would like to host a web page from a RPi that has websocket controls that update in 'real time' such as a slider that transmits its value as you move it. I then want to broadcast the values to several ESP8266 modules (~10) running Arduino via Wi-Fi. I would like to have a payload data rate of ~10 bytes/packet x 30Hz = 300 Bytes/s.

What type of connection should I use for the Pi to the ESP8266s? I think MQTT is too slow for this?

3
  • 1
    Why do you think a protocol and not say the quality of the network, or the ESP8266 ability to decode the protocol will be too slow?
    – hardillb
    May 16 '18 at 7:52
  • Network speed has nothing to do with processor clock speed, other than how fast it can send data to the network chip/card. Your limiting factor w.r.t. your network is more about transfer rate and how congested your network might be (and therefor cause collisions/re-transmits.) A quick Google search for ESP8266 WIFI Speed shows several folks getting transfer rates into the MegaBits per Second (mbps) range. 1040 mbps (10 ESP8266's x (10 bytes/packet payload + 3 bytes MQTT overhead) x 8-bits) seems easily do-able on a 2.4Ghz Wifi "G" or "N" network.
    – JD Allen
    May 16 '18 at 14:04
  • ESP8266's run at 80MHz....no CPU has ran at 30Hz since the 1960's :)
    – JD Allen
    May 16 '18 at 14:05
5

MQTT should be more than fast enough for your architecture, given a decent WiFi network. I run about 30 sensors (ESP8266, Feather MO, Arduino Uno, etc.) all using MQTT back to a Mosquitto Broker running as a Docker Container on an 15yo laptop, which connects back out to my control software and displays, and it all works just fine. I'm pushing close to 2 million MQTT packets a day at my house...so your 864k seems do-able to me :)

2
  • Thanks. I am concerned because MQTT services such as AdafruitIO or Sparkfun were advertising one message per second rate limits.
    – user6397
    May 17 '18 at 12:05
  • @user6397: Both of those services throttle their traffic to prevent people from swamping them. If you run a local MQTT Broker like Mosquitto or Mosca, you won't have those limits. I use AT&T's M2M service myself, but I have to do my own throttling with Node-RED and just send them a 1 minute average of some sensor data that comes in every 3 seconds to my MQTT broker....otherwise I would go over my monthly free limit very quickly!
    – JD Allen
    May 17 '18 at 13:33

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.