3

I am new to ESP8266 boards and IoT programming and I don't know how to describe better what I want to do without a picture.

Question: How to send continuous data from 4 esp8266 WiFi clients to a webpage or to an application which handles all of them in parallel without introducing noticeable delays?

So, I need 4 clients (users), each having an ESP8266 ESP-12E NodeMcu CP2102 board with 3 sensors (analog /digital sensors). These nodes should send continuous data or at least faster than human average reaction time (i.e. 250ms). These clients should behave as players do in a multiplayer online game for example. Or I don't know, maybe like 4 WiFi Gaming Controllers.

I need the system to be very reactive (without having a noticeable delay in displaying the data). For example, if User4 touches the Sensor3 (which can be also a simple button), the webpage / the application should sense this immediately while still displaying/handling the data from the other users. That's why I want to send the data to the webpage or to the application (C# app or Android App) as a long string even though some users are inactive or if their sensors inputs didn't change during a frame.

Sensor1 can be a pulse sensor, Sensor2 a microphone and sensor3 a button or a touch sensor. It doesn't matter so much and I'm not decided yet on this.

My problem is that I don't know how to approach this. I did some tutorials with WebSockets and one tutorial with MQTT, but I'm still very, very confused. I don't know if it's possible.

One WebSocket tutorial I've followed is this one (I also found some typos in the code):
https://esp8266-shop.com/blog/websocket-connection-between-esp8266-and-node-js-server/

The MQTT tutorial:
https://esp8266-shop.com/blog/configure-mqtt-runing-on-esp8266-for-home-automation/

1400mAh LiPo Batteries

3.7V to 5V @ 2A DC-DC boost convertors

Multiple ESP8266 sending a continuous stream of data

1
  • It's not clear what your question actually is here. Edit the question to clearly state a question.
    – hardillb
    Jul 15, 2019 at 21:08

1 Answer 1

6

MQTT is probably the right answer.

Each ESP can publish to the broker with a topic structure something like:

client1/sensor1
client1/sensor2

You can then use MQTT over Websockets to subscribe to all the topics (either each topic separately or with the # wildcard).

Since each message from the sensor arrives on it's own topic you can then use the topic to determine which bit of the page to update.

For desktop or mobile apps you can either use native MQTT or MQTT over Websockets

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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