Real-time data streaming over WiFi

Posts: 6
Joined: Sat Dec 07, 2019 5:54 pm

Real-time data streaming over WiFi

Postby borelg » Sat Dec 07, 2019 5:56 pm

Dear Forum,
I am trying to understand what is the most effective way to stream data from an ESP32 node via WiFi to my PC.

Let me shortly describe the application that I am working on.
I would like to setup a wireless IMU node based on ESP32 and the MPU6050 [ ... /mpu-6050/] that I have in this convenient board GY-521.

All about the interface and acquiring the data from the MPU6050 is already working.
I am now working on how to transmit the data to my pc.
I thought that an UDP streaming might be a good solution. I would have to transmit 6 Bytes with 100Hz frequency.

Unfortunately the UDP connection does not seem to be extremely reliable and I get come transmission error over serial from time to time.

Do you have any suggestion regarding the best way to stream data that are sampled at 100Hz via WiFi?

Thank you very much in advance! :)

Posts: 2
Joined: Sun Dec 08, 2019 10:08 am

Re: Real-time data streaming over WiFi

Postby benjavita » Sun Dec 08, 2019 2:14 pm


You should look at the protocol: ESP-NOW ... w/overview
It should cover what you need, for a simple example see ... h-esp-now/

Cheers, Ben

Posts: 101
Joined: Tue Apr 17, 2018 1:51 pm
Location: Santiago, Dominican Republic

Re: Real-time data streaming over WiFi

Postby tommeyers » Sun Dec 08, 2019 5:06 pm

Was TCP too slow for your sample rate

Tom Meyers
IT Professional, Maker
Santiago, Dominican Republic

Posts: 6
Joined: Sat Dec 07, 2019 5:54 pm

Re: Real-time data streaming over WiFi

Postby borelg » Fri Jan 03, 2020 10:31 am

Thank you for the replies :)

I did not know about the ESP-NOW protocol.
It is very interesting indeed. However, I would need something simple to be integrated with a python script running on a PC that is receiving the data.
That is why I was thinking about UDP.
I also think that TCP might work. However, I have not tried it yet.
I am now scouting which might be the easiest solution to support the mentioned data rate (600 B/s).

Using an higher level protocol (e.g. MQTT) would be helpful in the phase of data collection.
I wonder if MQTT might support a stream of data as I am doing.

Thanks again! :)

Posts: 3106
Joined: Thu Nov 26, 2015 4:08 am

Re: Real-time data streaming over WiFi

Postby ESP_Sprite » Mon Jan 06, 2020 1:32 am

Do you need low latency? If not, just collect a heap of samples (100 or so) and send them as one packet; if you do it like this, you can happily use whatever protocol you fancy. If not, most protocols probably still are feasible, but you'd need to try. I'd personally just go for an UDP stream if you need low latency, TCP if you need to get all the samples at all cost.

Who is online

Users browsing this forum: No registered users and 10 guests