Forwarding problem - The template variable 'deviceId' has no value

Agile Hobo6 years ago

I have problem with Traccar v4.0 about forwarding

Here is my template:

http://localhost/api/traccar/positions?deviceId={deviceId}&latitude={latitude}&longitude={longitude}&deviceTime={deviceTime}&valid={valid}

Here is error log:

error - The template variable 'deviceId' has no value - IllegalStateException (... < WebDataHandler:133 < BaseDataHandler:27 < ... < *:29 < ... < *:29 < ... < *:29 < ... < *:29 < ... < *:29 < ... < *:29 < ... < ExtendedObjectDecoder:64 < ...)

As I check https://github.com/traccar/traccar/blob/master/src/org/traccar/WebDataHandler.java, it should work.

BTW, I'm using Traccar Client for Android

Anton Tananaev6 years ago

It seems like you enabled JSON, in which case you can't use URL placeholders.

Agile Hobo6 years ago

Aton, thanks a lot. It's my fault. Disable JSON forward and now Traccar can forward the data.

BTW, where can I find the format of JSON which Traccar will forward? Thanks.

Anton Tananaev6 years ago

You can enable it as see what it sends. It uses same models as our API.

Agile Hobo6 years ago

Thank you, Anton.

Hi.

Reading from this:

http://localhost/api/traccar/positions?deviceId={deviceId}&latitude={latitude}&longitude={longitude}&deviceTime={deviceTime}&valid={valid}

i wonder where can i find all the variables traccar client sends. Where can i find a list of them?

Anton Tananaeva year ago

You can find it in the code.

thanks..

So, i made a dump of the array traccar client sends, and i found this:

    [id] => 1827xxxx34
    [timestamp] => 1684325463
    [lat] => -38.96117666666667
    [lon] => -68.06781666666667
    [speed] => 0.0
    [bearing] => 290.7900085449219
    [altitude] => 276.8
    [accuracy] => 0.0
    [batt] => 94.0

is that all the info traccar client sends? can i get more?
I am trying to find some unique id or mobile id, or imei, or something like that.. can be possible?

Anton Tananaeva year ago

That's all it sends.

Thanks..

And, where or how can i find all data i can send to a traccar server ?

Anton Tananaeva year ago

You can send anything you want.

right, i have read some time ago, that is like

http://traccar.server.ar:5055?var1=value1&var2=value2...

is it?
But, what i really wonder is the common values traccar server expects. Like [batt] for battery level, [speed] for device speed, [timestamp], and so on..

http://traccar.server.ar:5055?id=devId&lat=$lat&lon=$lon&speed=$speed&beari.....

based on the array traccar client sends.
I wonder to be clear enough :-)

Anton Tananaeva year ago

Check the decoder class.

sorry, but i didn't know where else to ask: can you tell me the units of each value traccar client reports? I mean, speed is in km/h or M/h? altitude is in meters or feets?, and so..

Anton Tananaeva year ago

You could ask in a new topic?