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.

sending data to a web server
#1
Hello,

I am playing with the network connection and trying to send data to a web page using a custom phyphox experiment. If I understand correctly the wiki (https://phyphox.org/wiki/index.php/Network_Connections), there are only two ways to trigger such a connection:
- using the "interval" property of the <connection> block
- using the "trigger" property of a view button

I would like to send a data only once, after a given amount of time, and I would like to avoid using a button. The way I do it now is that I set the interval property at the proper time:

<connection interval="4.6" address="ADDRESS" id="submit" service="http/post" conversion="json" privacy="https://phyphox.org/disclaimer/" autoConnect="true">
      <send id="frequency" type="buffer" init="0">frequency</send>
 </connection>


The experiment is programmed to stopped after 5 seconds (via the "timedRun" and timedRunStopDelay" properties of the analysis block), so the experiment uses the connection twice : one at 0s, one at ~ 4.6 s. The first connection is unwanted, and I plan to disregard it on web side (either via php or python script), but is there a better way of programming the phyphox experiment? Ideally I would like to be able to trigger a connection at a given time, using the <timer> analysis module.


Also, on a side note, each time my phyphox experiment sends a data to my server, the data are received, but a message "Could not parse JSON" appears on my smartphone. I haven't investigate this yet (in fact it helps me by clearly tagging each connection), so it may be a simple problem with my server. I plan to look at it, but if this is a well known problem, I wouldn't mind any pointers.

Thank you in advance,

Cheers,

Fred
Reply


Messages In This Thread
sending data to a web server - by fbouquet - 10-31-2022, 05:03 PM
RE: sending data to a web server - by fbouquet - 11-03-2022, 04:05 PM
RE: sending data to a web server - by fbouquet - 02-06-2023, 04:51 PM
RE: sending data to a web server - by fbouquet - 02-07-2023, 06:34 PM
RE: sending data to a web server - by fbouquet - 10-17-2023, 04:40 PM
RE: sending data to a web server - by fbouquet - 10-18-2023, 01:32 PM
RE: sending data to a web server - by fbouquet - 04-17-2024, 11:20 AM
RE: sending data to a web server - by fbouquet - 04-17-2024, 03:21 PM

Forum Jump: