phyphox Forums
Using phyphox with Arduino - Printable Version

+- phyphox Forums (https://phyphox.org/forums)
+-- Forum: Discussion (https://phyphox.org/forums/forumdisplay.php?fid=1)
+--- Forum: General (https://phyphox.org/forums/forumdisplay.php?fid=3)
+--- Thread: Using phyphox with Arduino (/showthread.php?tid=15)



Using phyphox with Arduino - d.girardi - 09-05-2018

Does anyone have any tutorial on how send data from Arduino to phyphox? 
I want to use the phyphox plot capabilities to show the Arduino sensors data.


RE: Using phyphox with Arduino - Sebastian Staacks - 09-05-2018

Now you have two options here. Either you do it via Bluetooth Low Energy (using a BLE shield) or via WIFI and the remote access function.

BLE is certainly the better option in terms of comfort for the user and performance, but it is harder to set up, especially on the Arduino side. In phyphox you "just" set up a Bluetooth device as in the documentation you found in the other thread (https://phyphox.org/wiki/index.php?title=Bluetooth_Low_Energy). On the Arduino side you need to create a Bluetooth stack with a GATT profile and create attributes to which phyphox can subscribe. There are libraries for this, but it can be a bit tricky sometimes. On the bright side, you can even distribute your phyphox-experiment via Bluetooth. This means that any user who wants to connect to your Arduino does not need to load an experiment or scan a QR code first, but instead your device turns up during a scan and tells phyphox how it wants to be read. (This is at the very end of the wiki page.)

The wifi method might be much easier, but it is slower and the user needs to load an experiment, needs to enable the remote access and you somehow need to make sure that the Arduino knows the IP address of the phone. If all these requirements are met, you can simply write a single value to any buffer via an http request to http://[IP:PORT]/control?cmd=set&buffer=abc&value=42. This call is used by the remote interface to send input to text boxes and buttons, so it is not designed for a rapid stream of data, but it should work fine. So you could just create an experiment that plots a buffer without any sensor writing to this buffer and then call the URL above to send data into this buffer from the Arduino. It's just a bit more annoying for the user... (The whole communication protocol is explained here: https://phyphox.org/wiki/index.php?title=Remote-interface_communication)


RE: Using phyphox with Arduino - Sebastian Staacks - 07-25-2019

I am closing this thread. It seems like the word "Arduino" attracts some more sophisticated spam bots... (deleted a few less obvious spam post)