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.

Detect when BLE connection is made (Arduino library)
#8
(01-26-2023, 05:03 PM)Jens Noritzsch Wrote:
(01-26-2023, 03:23 PM)Mukund Wrote: Another question that popped in my mind, is it possible to create a custom experiment(using the editor tool/xml code) that includes a button to trigger the in-app graphical display while simultaneously sending the button state to the Arduino BLE device?   

What do you mean by trigger: resetting a graph or tapping the “play” button? There is some discussion on sending button states inside tabs at https://phyphox.org/forums/showthread.php?tid=1640
Hi Jens,
I checked the link out and it seems like a good start to implement the button I wanted to.
For clarification on your question: I want the button to act as a way to reset/restart the graph(will have to check methods that clear the screen for the new graph to be displayed) and signal to the Arduino device that it's time to create a data buffer to be written to the SD-card. I want the user to be able to control each new "start" of the display and automate the SD-card writing simultaneously. The graphs would be displayed only for 5 minutes, post which Arduino would store the 5 minute data to the SD-card, stop sending data to the server and wait to listen to the next "button pressed" state.
Will try it out and let you know if I get stuck anywhere.
Thanks for the help!

(01-26-2023, 07:08 PM)Dominik Dorsel Wrote: Hey,

Jens got already a good starting point if I understand your question correctly. In case you dont know: It is possible to add an .phyphox file to your arduino sketch. Therefore you have to convert the .phyphox (or a zip file with one or multiple) file into an byte array and add it to the start function as we did in our CO2 project:

https://github.com/Dorsel89/phyphox-ardu...it.ino#L65 (check also line 75)

I know its ugly, but this way you can use all in phyphox available features and still store the experiment localy on your microcontroller without being limited by the library. If you dont know how to get the byte array you might want to take a look in the following java script (I know its ugly aswell, but since its rarely requested im too lazy to make a prober "public suitable" version Wink).

https://github.com/Dorsel89/ZipFileToByteArray

Cheers
Dominik
Hey Dominik, 

Yes, I think Jen's recommendation might work, just need to quickly implement it and test it out. 
Thanks for explaining how I could add the .phyphox file to the Arduino sketch, I was a bit lost there. 
I also checked the java script file and it seems good enough for me to generate the required byte array. Since we are prototyping with an IOT device right now, I do not mind an "ugly" solution to the problem(since most of our solutions are also ugly Tongue ). 

Thanks again for the prompt help!
Reply


Messages In This Thread
RE: Detect when BLE connection is made (Arduino library) - by Mukund - 01-27-2023, 04:40 PM

Forum Jump: