update device location through php

Juan Facundo Suárez 6 years ago

HI

I have a running server wich can catch and manage many device positions. I am trying to send that info to traccar server in other host. I am using for that, osmand protocol, just pass three vars through the url and send them with "file_get_contents(http://...) ".. BUT.. many times traccar server (i guess) delays too much to answer (again.. i guess).

Is there any issue you can tell me to solve this?

thanks.

Anton Tananaev 6 years ago

If the delay is on Traccar side, it probably means that it runs out of resources.

Juan Facundo Suárez 6 years ago

is so strange.. cause is a new, just installed traccar server.. and.. when i set up some devices using android app, it runs perfectly.

besides, i tryied in two different machines with new installed traccar server and it does the same thing....

Anton Tananaev 6 years ago

What makes you think the delay is on Traccar side then? You should probably investigate the issue a bit more.

Juan Facundo Suárez 6 years ago

cause all the system runs without problem... but.. when i enable the line (file_get_content...) to send the data to traccar server.. it all get slowly.. and.. i have some logs that stacks exactly waiting when THAT line is executed.. (file_get_...)

Juan Facundo Suárez 6 years ago

i can tell you more..

i installed apache+php+mysql and traccar server on another machine, i run the same codes in local server, those that handle device position and all work fine till i enable the line in php wich sends the position to traccar in "localhost" (file_get_contents("http://localhost:5055?...."), and then.. it all becomes slow..

Anton Tananaev 6 years ago

How slow is slow?

Juan Facundo Suárez 6 years ago

10 secs... for say samething... talking about all server in one machine..

some times it gets "timed out"..

Anton Tananaev 6 years ago

There's clearly something wrong with your server. I don't have any delays.

Juan Facundo Suárez 6 years ago

three different machines having the same issue ? even one working in localhost ? what can it be ?

Anton Tananaev 6 years ago

Have no idea, but keep us posted if you find out.

Juan Facundo Suárez 6 years ago

OK.

Is there a way to update positions of devices through the api? i have read but can't figure it out...

Anton Tananaev 6 years ago

No, it's not possible through API.

Marcin 6 years ago

But there is a very easy way updating them :)
But for lowering my invest in this i have to take 25€ for the workaround ;)

Juan Facundo Suárez 6 years ago

and what about if i insert lat & lon values to "tc_positions" table ? should it work?

wich could be the best way to do it? can you tell me ?

Thanks