Thank you ! I wasn't sure with the documentation alone, but reading other threads in the forum I managed to indeed forward events to Node-Red, and the rest should follow easily.
Since you didn't answer that part, I'm guessing you haven't had the opportunity to experiment with the voice message command. Do you know of anyone that might have that I could try to contact ?
Thanks again.
I think voice command should be encoded in HEX format, but I don't remember the details.
Well, I might have spoken a bit too soon :-( I indeed receive events through the API endpoint, but not for voice messages. I couldn't find a specific option and the documentation page for events only mentions text messages... do you have any idea why these specific events might not be forwarded like the others ?
Thanks !
You are looking for positions, not events.
I think voice command should be encoded in HEX format, but I don't remember the details.
yes, I believe this is right, but indeed that's what I was wondering. And how to pass that data to the web or API interfaces. I'll try again to make sense of the code snippets I've gathered here and there.
You are looking for positions, not events.
Ha, I had missed that indeed, thank you. Since the docs speak of "URL parameters", I guessed this should be a GET endpoint. Is that right ?
At the moment, when traccar receives a voice message, it does indeed call the forward.url URL, but it's not passing any query string or anything like that, and it ends up printing these logs:
2021-06-23 17:56:29 WARN: Event forwarding failed - Unexpected end of file from server - SocketException (...)
2021-06-23 17:56:29 WARN: Position forwarding failed: 2 pending - Unexpected end of file from server - SocketException (...)
2021-06-23 17:56:31 WARN: Position forwarding failed: 1 pending - Unexpected end of file from server - SocketException (...)
2021-06-23 17:56:31 WARN: Event forwarding failed - Unexpected end of file from server - SocketException (...)
Did I miss something on the traccar side or could it be a kind of incompatibility between traccar and Node-Red's HTTP GET endpoint ?
Once again, thanks for your time and help !
Seems like there's some issue with your endpoint.
Seems like there's some issue with your endpoint.
Well, since that indeed seemed the most probable cause, I tried forwarding events and position to a barebones docker http echo server (jmalloc/echo-server) and this is what I get when sending a Voice Message with the watch:
-------- 172.17.0.1:60218 | GET /traccar-pos
Headers
"User-Agent" : ["Jersey/2.34 (HttpUrlConnection 11.0.9)"]
"Accept" : ["text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"]
"Connection" : ["keep-alive"]
So there's obviously something I didn't understand with the way Traccar forwards position info. Is it not supposed to be with query parameters (ie ?lat=00.0000
or something) ?
Just to be sure, I tried as well with pipedream, and this is what I got:
{
"headers": {
"host": "xxx.m.pipedream.net",
"x-amzn-trace-id": "Root=1-xxx-xxx",
"user-agent": "Jersey/2.34 (HttpUrlConnection 11.0.9)",
"accept": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
},
"body": {},
"inferred_body_type": "FORM",
"method": "GET",
"url": "https://xxx.m.pipedream.net/traccar-pos",
"client_ip": "90.xx.xx.xx",
"query": {}
}
So indeed, I believe the problem is not with the endpoint but with the way I configured Traccar. Here's what I have at the moment with regards to forwarding:
<entry key='forward.enable'>true</entry>
<entry key='forward.url'>https://xxx.m.pipedream.net/traccar-pos</entry>
What are you expecting to get with this config? You either have to provide query parameters template or you have to enable JSON.
Thank you ! Indeed I had missed the JSON part. Once enabled, and the endpoint switched to POST method, I've been able to receive position events and filter them on the "audio" attribute.
Thanks again for your help !
Hello,
Thanks to this forum and github, I've successfully paired a GPS watch with Traccar, and I'd like to thank everyone for it.
Now I'm trying to understand how to use some of the embedded functionnality of Traccar. What's bugging me at the moment is the Voice message stuff. I'm able to receive messages out of the box, and that's pretty nice. But I have a few questions:
Thank you for your time and your help !