Boton de Panico Traccar

David3 years ago

Good afternoon everyone, I am trying to develop a panic button that can send emergencies with the osmand protocol to my server.
After several attempts and reading a lot in the group, I have been able to make the notifications reach my server but it does not show them on the map.

I try to go by part:

1- disable reverse geocoding in traccar.

2- my log on the server shows me the following:

2022-02-11 20:51:47 INFO: [30dbd297] connected
11/02/2022 20:51:47 INFO: [30dbd297: Osmand <186141200237] HEX: 504f5354202f3f69643d313233343536266c61743d30266c6f6e3d3125433325393774616d703d322668646f703d3326616c7469747564653d342673706565643d3520485454502f312e310d0a436f6e74656e742d4c656e6774683a203138330d0a436f6e74656e742d547970653a206170706c69636174696f6e2f782d7777772d666f726d2d75726c656e636f6465640d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f69642031303b206d6f746f206728382920706f776572206c697465204275696c642f514f445333302e3136332d332d3236290d0a486f73743a203136372e3131342e3136392e3138303a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a687474703a2f2f3136372e3131342e3136392e3138303a353035352f3f69643d313233343536266c61743d30266c6f6e3d3125433325393774616d703d322668646f703d3326616c7469747564653d342673706565643d35416c61726d61206d6920756269636163696f6e2065733a20687474703a2f2f7777772e676f6f676c652e636f6d2f6d6170732f706c6163652f24706f7 36974696f6e2e6c617469747564652c24706f736974696f6e2e6c6f6e676974756465
2022-02-11 20:51:47 INFO: [75dd8fa9] connected
2022-02-11 20:51:47 WARN: [30dbd297] error - For input string: "1×tamp=2" - NumberFormatException (... < OsmAndProtocolDecoder:100 < ExtendedObjectDecoder:52 < ... < WrapperContext:102 <...)
2022-02-11 20:51:47 INFO: [30dbd297] disconnected
11/02/2022 20:51:47 INFO: [75dd8fa9: Osmand <186141200237] HEX: 474554202f3f69643d313233343536266c61743d30266c6f6e3d3125433325393774616d703d322668646f703d3326616c7469747564653d342673706565643d3520485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f69642031303b206d6f746f206728382920706f776572206c697465204275696c642f514f445333302e3136332d332d3236290d0a486f73743a203136372e3131342e3136392e3138303a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2022-02-11 20:51:47 WARN: [75dd8fa9] error - For input string: "1×tamp=2" - NumberFormatException (... < OsmAndProtocolDecoder:100 < ExtendedObjectDecoder:52 < ... < WrapperContext:102 <...)
2022-02-11 20:51:47 INFO: [75dd8fa9] disconnected

3-The decoding that I get to do is:

GET /?id=123456&lat=0&lon=1%C3%97tamp=2&hdop=3&altitude=4&speed=5 HTTP/1.1
User-Agent: Dalvik/2.1.0 (Linux; U; Android 10; moto g(8) power lite Build/QODS30.163-3-26)
Host: my:ip:5055
Connection: Keep Alive
Accept-Encoding: gzip

some help ?

Anton Tananaev3 years ago

Looks like completely invalid format.

David3 years ago

thanks for the answer anton, I am using the following string to send data:

http://miip:5055/?id=123456&lat=0&lon=1%C3%97tamp=2&hdop=3&altitude=4&speed=5

At least now it reaches the server and says osdmand protocol, what can I be doing wrong?

I use appinventor to create the apps

Anton Tananaev3 years ago

Where did you get this string? It's invalid format.

David3 years ago

I understand that using osmand with this format

http://demo.traccar.org:5055/?id=123456&lat={0}&lon={1}×tamp={2}&hdop={3}&altitude={4}&speed={5}

it could be that my apps communicate in the same way

Anton Tananaev3 years ago
David3 years ago

but I am sending this same thing and it reaches the server:

http://mi_ip:5055/?id=123456&lat=0&lon=1%C3%97tamp=2&hdop=3&altitude=4&speed=5
Anton Tananaev3 years ago

What is this %C3%97tamp?

David3 years ago

thanks for the correction that part was wrong, my new string is:

http://167.114.169.180:5055/?id=123456&lat=0&lon=1xtamp=2&hdop=3&altitude=4&speed=5

and plot shows:

2022-02-11 20:58:01 WARN: [7b33ac59] error - For input string: "{0}" - NumberFormatException (... < OsmAndProtocolDecoder:97 < ExtendedObjectDecoder:52 < ... < WrapperContext:102 < . ..)
2022-02-11 20:58:01 INFO: [7b33ac59] disconnected
Anton Tananaev3 years ago

Your "new" string is wrong. And it clearly not what you sending based on the error. Both are wrong. I would recommend you to take your time and read everything again before asking for more help. Also compare your request with what actual Traccar Client is sending. I tried to help, but you are clearly ignoring everything I'm saying.

David3 years ago

Excuse me, I don't want to ignore what you say, I'm just trying to do things right

Anton Tananaev3 years ago

Yeah, but you need to stop and think instead of mindlessly and randomly copying something from the forum.

David3 years ago

ok sorry it won't happen again

Anton Tananaev3 years ago

xtamp - this is simply wrong
×tamp - this is what you see on the forum, but this is also wrong (× = &times this is just your browser misinterprets special sequence)
&timestamp - this is the right thing

David3 years ago

Dear that worked for me, the panic button now sends the power state, I ask, if I want the button to send the alerts, do I understand what to implement variables to the string?