update device location through php

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 Tananaev4 years ago

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

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 Tananaev4 years ago

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

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_...)

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 Tananaev4 years ago

How slow is slow?

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

some times it gets "timed out"..

Anton Tananaev4 years ago

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

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

Anton Tananaev4 years ago

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

OK.

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

Anton Tananaev4 years ago

No, it's not possible through API.

Marcin4 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 ;)

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