phyphox Forums
How to send phyphox file from sensor ? - Printable Version

+- phyphox Forums (https://phyphox.org/forums)
+-- Forum: App-Feedback (https://phyphox.org/forums/forumdisplay.php?fid=6)
+--- Forum: Bugs and Problems (https://phyphox.org/forums/forumdisplay.php?fid=9)
+--- Thread: How to send phyphox file from sensor ? (/showthread.php?tid=740)

Pages: 1 2


How to send phyphox file from sensor ? - Uwe - 03-30-2020

Hi,

I'm currently doing my first steps with great Phyphox and work on programming an ESP32 to become a small universal sensor board.
There is a lot to learn on BLE :-)

On the linked page you mention that phyphox file can also be provided directly by peripheral device (instead of coping the file to smartphone or using QR codes):
Phyphox on BLE

Is there any description or code example how BLE dialog happens to initiate transfer between smartphone and device and how file transfer is handled (e.g. is data sent by server or read by client ...) ?

Thanks
Uwe


RE: How to send phyphox file from sensor ? - Sebastian Staacks - 03-30-2020

Yes, it is at the very bottom of the BLE documentation: https://phyphox.org/wiki/index.php/Bluetooth_Low_Energy#Sending_phyphox-files_from_a_device

Your device needs to advertise a specific service UUID to let phyphox know that this is supported. Phyphox will then subscribe to a specific characteristic and your device needs to send the experiment (zipped, with some additional bytes at the beginning containing size and checksum, see wiki page) in small chunks on that characteristic.

Our Arduino library (https://github.com/Staacks/phyphox-arduino) does this as well. So, you might check out its code to get some idea. (And I need to update this library.)


RE: How to send phyphox file from sensor ? - RobertGrover - 03-30-2020

In addition to sending the file along with the connection, is there a method for a user to add a number of experiments to the end users collection in one action? I am having users scan QR codes for each experiment, but setting up a collection in one action would be less work on the user end.


RE: How to send phyphox file from sensor ? - Uwe - 03-30-2020

Hi Sebastian,

thanks a lot.
I wasn't aware of this library (may be I was too focused on ESP32).

Might take me some time to adopt to BLE library for ESP but good chance to learn more details on BLE (still struggeling with some concepts :-(  )

Uwe


RE: How to send phyphox file from sensor ? - Sebastian Staacks - 03-31-2020

(03-30-2020, 06:55 PM)RobertGrover Wrote: In addition to sending the file along with the connection, is there a method for a user to add a number of experiments to the end users collection in one action?  I am having users scan QR codes for each experiment, but setting up a collection in one action would be less work on the user end.

Yes, both QR codes as well as the transfer discussed here may (and in most cases "should") transfer or point to zip files. These may contain multiple experiments that are offered to the user who may choose to either save them all or pick one to start only the selected one. I think this has not been tested for the Bluetooth transfer as it is already rather slow for a single experiment.

(03-30-2020, 11:58 PM)Uwe Wrote: Hi Sebastian,

thanks a lot.
I wasn't aware of this library (may be I was too focused on ESP32).

Might take me some time to adopt to BLE library for ESP but good chance to learn more details on BLE (still struggeling with some concepts :-(  )

Uwe

No need to adopt it to the ESP32. You can try the repository by our PhD student who has already adopted it and who is still developing the library. I just have not yet merged it to the "official" repository as I am not entirely sure if it is currently in a working state as it is even more "work in progress" than the official repo. So, if you like, you can try https://github.com/Dorsel89/phyphox-arduino - just be aware that this is still rather undocumented, the interface will probably still change a lot and it might currently be in a state that is not working properly.


RE: How to send phyphox file from sensor ? - Uwe - 03-31-2020

Sebastian, thanks.

I'm happy to give it a try !!
In case of any issues I'll let you know.

Uwe


RE: How to send phyphox file from sensor ? - CONUCON - 05-19-2020

(03-31-2020, 02:03 PM)Uwe Wrote: Sebastian, thanks.

I'm happy to give it a try !!
In case of any issues I'll let you know.

Uwe

I am using the this example (https://github.com/Staacks/phyphox-arduino) with an Arduino Ble. Now I would like to change the experiment. After a little bit of reverse engineering I found this line in the phypoxBle.cpp file "uint8_t EXPERIMENT[] = {80, 75,......}; Huh
Is this how I could define an experiment? What is the meaning of the values?
Great piece of software, but I am a lil lost.
Felix


RE: How to send phyphox file from sensor ? - Dominik Dorsel - 05-19-2020

Hey,

this line represents the phyphox experiment as a byte array. Originally we had considered using the editor to output a byte array besides the QR-Code. To be honest this would not be a nice solution. Thats why I am currently working on a version where you can create the experiment directly in the Arduino IDE. You can have a look on this example to get an idea how it will looks like:

https://github.com/Dorsel89/phyphox-arduino/blob/dev_generateExperiments/examples/CreateExperiment/CreateExperiment.ino

BUT BEWARE: This example will NOT work with your phyphox version! There will be a phyphox beta version (very soon?)  which allow you to use this example. If you cannot wait until then I can share my java script to convert zipped phyphox files to byte array.

Dominik


RE: How to send phyphox file from sensor ? - CONUCON - 05-20-2020

(05-19-2020, 06:54 PM)Dominik Dorsel Wrote: Hey,

this line represents the phyphox experiment as a byte array. Originally we had considered using the editor to output a byte array besides the QR-Code. To be honest this would not be a nice solution. Thats why I am currently working on a version where you can create the experiment directly in the Arduino IDE. You can have a look on this example to get an idea how it will looks like:

https://github.com/Dorsel89/phyphox-arduino/blob/dev_generateExperiments/examples/CreateExperiment/CreateExperiment.ino

BUT BEWARE: This example will NOT work with your phyphox version! There will be a phyphox beta version (very soon?)  which allow you to use this example. If you cannot wait until then I can share my java script to convert zipped phyphox files to byte array.

Dominik

Hi Dominik,
great work. I would really appreciate if you could share the java script. When is very soon? Wink

Felix


RE: How to send phyphox file from sensor ? - Jens Noritzsch - 05-20-2020

(05-20-2020, 08:58 AM)CONUCON Wrote: When is very soon? Wink

 Like Debian's “releases when ready”… Wink

Yet we still need a beta first.