![]() |
Using mobile phone gps to notify location for panic button - Printable Version +- phyphox Forums (https://phyphox.org/forums) +-- Forum: Discussion (https://phyphox.org/forums/forumdisplay.php?fid=1) +--- Forum: Experiments and Ideas (https://phyphox.org/forums/forumdisplay.php?fid=4) +--- Thread: Using mobile phone gps to notify location for panic button (/showthread.php?tid=2092) |
Using mobile phone gps to notify location for panic button - kencottrell - 02-07-2025 Hello everyone. I am involved in developing a “panic button” app for mobile phones and watches so that a worker in a hotel, hospital, or other environment can press a button and have their location sent to a safety response team. I’ve written some python code on my laptop that uses the GPS experiment to poll lat, Lon, z, and time data every second. I am trying to setup the GPS app to send info to my local python flask web service / sensor-data endpoint. I've editted the .phyphox file to include this entry, then loaded into a new experiment and used QR to create my new experiment. However I do not see the network block in the generated XML nor do I see any updates to <>/config output. Can you see anything wrong? ... <network> <connection id="gps_stream" service="http/post" address="http:---.---.---.---/sensor-data" interval="1"> <send id="gps_latitude" type="buffer" datatype="number" keep="false">lat</send> <send id="gps_longitude" type="buffer" datatype="number" keep="false">lon</send> <send id="gps_longitude" type="buffer" datatype="number" keep="false">z</send> </connection> </network> ... RE: Using mobile phone gps to notify location for panic button - Jens Noriʇzsɔɥ - 02-10-2025 Hi Ken, as far as I know, our editors do not yet support “network connections”. It (likely) should be included when we are finished with a bit of refactoring of the new editor code. Are you aware of the REST interface that comes with the remote access feature? I know that it does not entirely suit your plans, however, it might work for some testing purposes. RE: Using mobile phone gps to notify location for panic button - kencottrell - 02-11-2025 (02-10-2025, 11:37 PM)Jens Noriʇzsɔɥ Wrote: Hi Ken, Thank you for your response, Jens. If I can't use the web editor to generate the config the uploaded <network> block, what is the alternative approach? I have tried to to use this command to upload a /phyphox command from a local web server, but how can I do this if the GPS experiment is already running? I assume I have to insert the config file before I start the GPS experiment, otherwise how can it listen on port 80? phone_url = myphone-ip-address/control?cmd=load&url=mylaptop-ip-address:8000/myfile.phyphox" try: response = requests.get(phone_url) print(response.status_code, response.text) except Exception as e: print(f"Failed to load config file: {e}") RE: Using mobile phone gps to notify location for panic button - Jens Noriʇzsɔɥ - 02-17-2025 (02-11-2025, 07:01 PM)kencottrell Wrote: If I can't use the web editor to generate the config the uploaded <network> block, what is the alternative approach?You need to edit the source itself for now, unfortunately. Quote:I have tried to to use this command to upload a /phyphox command from a local web server, but how can I do this if the GPS experiment is already running?First, you need to activate the “remote access” in the three dots menu. An ip address will show up then in the footer and that's just what you need as source address, so something like Code: phone_url = footer-ip-address:optional-port/get?… The response is in JSON format. |