Forward URL storing accuracy values between curly brackets instead of the value sent by the device

hackerunet6 years ago

I have enabled forward URL and it's working nice, but in the endpoint the data for accuracy it's been stored as "{accuracy}", the HEX output in the logs is showing there is accuracy data comming from the device, so this is the url I'm using:

<entry key='forward.url'>http://my.domain.com/position?uniqueId={uniqueId}&deviceId={deviceId}&valid={valid}&fixTime={fixTime}&deviceTime={deviceTime}&protocol={protocol}&name={name}&latitude={latitude}&longitude={longitude}&altitude={altitude}&speed={speed}&course={course}&accuracy={accuracy}&address={address}&gprmc={gprmc}&attributes={attributes}</entry>

I did the test with POSTMAN and if I send accuracy the data it's correctly stored, somehow the accuracy is not been replaced in the forward URL, this is the HEX output:

504f5354202f3f69643d3135313731373132302674696d657374616d703d31353335343234393536266c61743d372e30363131353439266c6f6e3d2d37332e313037303535312673706565643d302e302662656172696e673d302e3026616c7469747564653d302e302661636375726163793d32332e30373739393931313439393032333426626174743d35352e3020485454502f312e310d0a436f6e74656e742d547970653a206170706c69636174696f6e2f782d7777772d666f726d2d75726c656e636f6465640d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420372e303b204d6f746f204720283529204275696c642f4e50505332352e3133372d31352d37290d0a486f73743a203137332e3231322e3232342e3130303a363030310d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
Anton Tananaev6 years ago

I suspect you are using outdated version of Traccar.

hackerunet6 years ago

Version 3.17, I'm scared about having the last version running with my current implementation, are the changes too big between such versions?

Anton Tananaev6 years ago

You can check blog and/or GitHub for information about changes.

hackerunet6 years ago

It's working but I'm receiving a maldormed URI exception, because of a empty space in the name of the device, how can I make it string url encoded in that case from the config file? or is it a way to avoid the malformed URL comming from the database? the name has empty spaces.

2018-08-28 05:39:55  WARN: [5bf6895a] error - java.net.URISyntaxException: Illegal character in query at index 158: http://mydomain.com/position?uniqueId=151717120&deviceId=151717120&valid=true&fixTime=1535427528000&deviceTime=1535427528000&protocol=osmand&name=IVECO TRUCK&latitude=7.0611547&longitude=-73.1070554&altitude=0.0&speed=0.0&course=0.0&accuracy=23.090999603271484&address=12-528+Cl.+200%2C+Floridablanca%2C+Santander%2C+CO&gprmc=$GPRMC,033848.000,A,0703.6693,N,07306.4233,W,0.00,0.00,280818,,*14&attributes=%7B%22batteryLevel%22%3A62.0%2C%22distance%22%3A2.6%2C%22totalDistance%22%3A8873818.24%2C%22motion%22%3Afalse%7D - UriBuilderException (... < WebDataHandler:135 < BaseDataHandler:27 < ... < *:29 < ... < *:29 < ...)
2018-08-28 05:39:55  INFO: [5bf6895a] disconnected
Anton Tananaev6 years ago

You need to wait for next release. It has a fix for it. Or build from source.

hackerunet6 years ago

Thank you very much, I just removed that field and everything worked out of the box. thanks