This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

How to send phyphox file from sensor ?
#1
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
Reply
#2
Yes, it is at the very bottom of the BLE documentation: https://phyphox.org/wiki/index.php/Bluet...m_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.)
Reply
#3
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.
Reply
#4
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
Reply
#5
(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.
Reply
#6
Sebastian, thanks.

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

Uwe
Reply
#7
(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
Reply
#8
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-ardu...riment.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
Reply
#9
(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-ardu...riment.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
Reply
#10
(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.
Reply


Forum Jump: