Sending MPU6050 data through ESP32 to Max
Hi
Im making an audio-visual project in Max and I want to get some data from a couple Adafruit MPU6050 sensors reliably and as latency free as possible into Max wirelessly. I had some ESP32's laying around so i figured that was the perfect way to go.
I've managed to set up my Esp32 with the sensor in arduino and print the data in the serial, but only through USB so far. So before I go down the wrong route or confuse myself to madness I figured it would be best to ask someone more knowledgeable about it.
How do I get the MPU6050 data latency free into Max? I was thinking OSC messages, good idea? In that case how would I even begin to set that up?
I'm really new to this so I appreciate all the help I can get - Thank you!
in first place you will have to do good work on thinning sensor data,
before sending it out. Send only on value change, and organise
the code for least amount of bytes needed.
then you use UDP - it is faster than Tcp.
Whan I get some free time, I can measure latency between
button press on ESP32 and received message in Max.
On local network.
You are better off using private wifi connection, either
dedicated router or even hosted adhoc network
with fixed IP.
latency will also depend on distance etc.
ESP32 serial (set to poll at 1ms inerval)
and UDP short messages get received
at same time with 1 - 2 ms variations from time to time.
network used was airport xpress without internet
and any other traffic beside ESP32 and MacBook Pro.
ESP32 to router distance 10 m, one wooden wall in between.