Offline 108 minutes

Thomas Mathiesen5 years ago

What a wonderful product you guys have coded! Thanks :)

I have TK05 trackers, setup to send their position every 240 minutes.

I'd like the traccar server web interface to tell me that the tracker is offline ONLY if it does not receive a new update within 240 minutes.

Is that possible? If so, how?

Kind regards,
Thomas

Michał Piasecki5 years ago

I think it's up to the device's configuration. From what I understand Traccar only shows a device is offline if it sends information about its' disconnection. If it doesn't (and there's no other info either), it goes into Unknown mode.

You should set up your device to send a heartbeat once in a while - I know some Concox devices have that option. I assume that anything that isn't a cheap Chinese device should have such option.

Thomas Mathiesen5 years ago

This is made in China, but it's good stuff. Made by Kingneed.

The tracker is setup to send location and heartbeat every 4 hours. So it's online, unless it doesn't send a heartbeat within 4 hours.

Isn't it possible to configure this in the code? Or a config file. I am more of a bash and php guy, but I'll be able to do some java stuff if I really have to, I just need to know where to look, and I suspect that there's a config thing for this?

Michał Piasecki5 years ago

Hmm, I'm not sure but I think you could write a PHP script that connects to your Traccar API and updates it's position. I think you would have to use devices/{id} PUT and set it's status and last update. Using the API is stupidly easy. See https://www.traccar.org/api-reference/

Thomas Mathiesen5 years ago

Hi Michal,

I am not saying that I'd like to use PHP. All I am saying is that I am a php-guy, but if I am required to do some java coding, I will manage.

I could fool the system, and send a fake "I am alive" message to the server from the server (just a script). But it is not a super clean way of doing it. I would rather change the code that actually times out the connection and says "offline".

But if it's not an easy fix, it is no problem at all. I will survive :)

Michał Piasecki5 years ago

Well, I don't know, I would prefer to write a tiny script that would run once in a while rather than have to search the source code, make changes that may work or may accidentally break something unexpected, compile it, reinstall on server... It's not dirty if it takes less effort and essentially does the same thing.

Of course if you're comfortable with Java and modifying Traccar source code I'm not going to tell you what's better. It just seems like wasted time from my point of view.

Roger Martinez4 years ago

Did you try to use status.timeout in config file?