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

Agile Hobo 7 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 Tananaev 7 years ago

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

Agile Hobo 7 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 Tananaev 7 years ago

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

Agile Hobo 7 years ago

Thank you, Anton.

Juan Facundo Suárez 3 years ago

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 Tananaev 3 years ago

You can find it in the code.

Juan Facundo Suárez 3 years ago

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 Tananaev 3 years ago

That's all it sends.

Juan Facundo Suárez 3 years ago

Thanks..

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

Anton Tananaev 3 years ago

You can send anything you want.

Juan Facundo Suárez 3 years ago

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 Tananaev 3 years ago

Check the decoder class.

Juan Facundo Suárez 3 years ago

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 Tananaev 3 years ago

You could ask in a new topic?