tooyipjee / Tracer

The Tracer is an open-source ESP32-based Inertial Measurement Unit tracker that allows you to track the motion and orientation of objects and stream the data to your smartphone or computer.

Home Page:https://www.elektrothing.com/projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regarding 'Stream real-time data to phyphox' example

vinayprabhu opened this issue · comments

Hi!
I uploaded the DataCollectorBLE.ino file successfully and connected the Tracer device to the PhyPhox app downloaded on my Android phone.
However, it defaults to the tennis-demo default example with the sub-plots having titled 'First Graph' ;'Second Graph' etc.

Any help? I was primarily intending to use this device to collect data and was wanting to get the ''Stream real-time data to phyphox' running.

Thanks!

PS: Attached below is the screenshot of my IDE after it uploads the code

image

commented

Hi Vinay,
I am glad it worked ok (mostly). :)

If changing the name of the plots is what you want to do, you can edit the "bluetooth.cpp".
See line 23, 34 and 45.
image

Ah, my bad I wasn't clear!
I was hoping to collect 6 axis Acc+Gyro data: [time_stamp, ax,ay,az,gx,gy,gz] and visualize all 6 axes via PhyPhox (The gyro Z-axis data seems to be amiss)

So, if I change line 44 in DataCollectorBLE.ino file to ble.update(ax,ay,az,gx,gy,gz); I get the following error:


/src/examples/DataCollectorBLE/DataCollectorBLE.ino: In function 'void loop()':
DataCollectorBLE:44:31: error: no matching function for call to 'Bluetooth::update(float&, float&, float&, float&, float&, float&)'
   ble.update(ax,ay,az,gx,gy,gz);
In file included from /src/examples/DataCollectorBLE/DataCollectorBLE.ino:3:
Tracer-main/src/bluetooth.h:26:10: note: candidate: 'void Bluetooth::update(float, float, float, float, float)'
     void update(float f0, float f1, float f2, float f3, float f4);

I am guessing that the bluetooth.h and bluetooth.cpp need to be modified.
I've tried this thus far:
a) Modifying bluetooth.h line 26 as void update(float f0, float f1, float f2, float f3, float f4, float f5);
b) Adding a sixthGraph element in bluetooth.cpp
But doesn't seem to work :(
Any pointers?

commented

Ah right, yes I understand you now.
It is a limitation of the Phyphox library. If you just want to collect data, you could get the data to stream over BLE Serial.

https://randomnerdtutorials.com/esp32-bluetooth-classic-arduino-ide/
See this example and let me know what you think?

commented

I could get round to writing an example of this over the weekend if you'd like.

Ah, yes! You are dead right. I just realized that too that it's an innate restriction of the PhyPhox lib.
I tried editing their header / cpp files but the code wouldn't verify :(
I will take a look at the tutorial you shared later today and update here.
Once again, thank you so very much for this wonderful initiative and your help here.
Much appreciated!

commented

All good! Hope you have as much fun tinkering with it as I do. :)

Screenshot_20220905-013301
I tried the above shared .ino file and got the following error in the Serial Bluetooth Terminal app on Android.
I looked up the solutions proposed for similar bugs here but couldn't made headway.
Did you encounter this error during testing by any chance?
Thanks!