mendhak / gpslogger

:satellite: Lightweight GPS Logging Application For Android.
https://gpslogger.app
Other
1.99k stars 607 forks source link

[Feature request] Send to multiple custom urls #1114

Open PedroKTFC opened 10 months ago

PedroKTFC commented 10 months ago

I'd like it if I could use more than one custom url.

Kolia56 commented 10 months ago

I second this request, would be very nice. Thank you

andreapx commented 1 month ago

@PedroKTFC @Kolia56 I've solved this problem setting the custom URL to my Node Red instance where I receive the data and send it to 2 different URLs (Traccar and DaWarich)

PedroKTFC commented 1 month ago

I assume you're running NodeRed in HA. How did you target, read and process the message in NR?

andreapx commented 1 month ago

I assume you're running NodeRed in HA. How did you target, read and process the message in NR?

No, I have NodeRed running on a rented public VPS (actually it runs on almost every PC/raspberry/server I have! 😂) I've created an HTTP in node with a random gibberish URL used only by GPSlogger and with 2 functions I prepare the data for Traccar and Dawrich.

26-09-2024_19-25-43_5_Node-RED__GPS_—_Mozilla_Firefox

The functions node are like this:

let newMsg = {};
newMsg.url = "http://172.20.0.45:5055/?id=" + msg.payload.id +
    "&lat=" + msg.payload.lat +
    "&lon=" + msg.payload.lon +
    "&time=" + msg.payload.time +
    "&speed=" + msg.payload.spd_kph +
    "&batt=" + msg.payload.batt +
    "&accuracy=" + msg.payload.acc +
    "&heading=" + msg.payload.dir +
    "&altitude=" + msg.payload.alt;
return newMsg;