Stopping service gives "Status Unknown" not "Offline"

gustavofarias2 years ago

here: https://www.traccar.org/events/
it's said:
"Status Unknown - Device is connected, but has not reported any data for a period of time. It can also indicate that the device has not closed the connection gracefully."

In Traccar client I noticed that when I stop the service, instead of immediately getting a "Status offline" event, nothing happens and after a while I get a "Status Unknown" event.
So, after stopping the service, traccar client is still connected but not reporting, or traccar client doesn't gracefully close the connection?

In any case, is there a fix for this? As the user is deliberately stopping the service, the offline status is more appropriate than an unknown, because what happened is well known.

Anton Tananaev2 years ago

Traccar Client does not have a connection concept, so offline status doesn't apply to it.

gustavofarias2 years ago

So why online status apply? The tc_events table has tons of "deviceOnline" and "deviceUnknown" events for traccar client.
It should be "unknown" all the time, then. The server should say, ok, I received this position, but as you're not really connected to me I can't say you are online, so be unknown. But instead the server recognizes it as connection (or kinda) and also generate an online event.

I believe the same way the app sends positions, it can send a last event to the server when stop service is hit.

Anton Tananaev2 years ago

In case where connection concept doesn't exist, like UDP or HTTP-based protocols, we use the following logic:

  • online - last update was less than 10 minutes ago
  • unknown - last update was more than 10 minutes ago

Showing "unknown" all the time doesn't really make any sense to me. It's not useful at all for end user.

gustavofarias2 years ago

Of course it doesn't make sense. Being online for 9:59 minutes after the user has stopped the service and then changing it to unknown indefinitely is as useless.

I mean, traccar client as a Traccar product should be the most compatible device with traccar. And by being a software, not a real device, just makes things easier, I suppose. But the way it is any generic Chinese device behaves better than Traccar client.

Why can't a message be sent to the server upon service stoppage?

I wonder the same

Why can't a message be sent to the server upon service stoppage?

It would be very useful to me, and to many others, i guess. I mean, besides connection concept, send it as last report, or something like that.

Just like:

OVER AND OUT

:-)

can anyone tell me why Uknown status is taking too long to change into offline status ?
this is my xml configurations.
my osmand device goes uknow after ten minutes if over then 10 minutes of no positions sent, but the issue is that it stays unknown for days,

<entry key='config.default'>./conf/default.xml</entry>
    
    <entry key='filter.enable'>true</entry>
    <entry key='distance.enable'>true</entry>
    
    <entry key='logger.console'>false</entry>
    <entry key='logger.enable'>true</entry>
    <entry key='logger.level'>info</entry>
    
    <entry key="java.arg.1">-Xms2g</entry>
    <entry key="java.arg.2">-Xmx4g</entry>



    <entry key='filter.approximate'>true</entry>
    <entry key='filter.minPeriod'>15</entry>

    

    <!-- <entry key='connection.timeout'>300</entry> -->
    <entry key='server.timeout'>30</entry>

    <entry key='filter.static'>true</entry>
    

    <entry key='filter.maxSpeed'>250</entry>
    <entry key='filter.invalid'>true</entry>
    <entry key='filter.accuracy'>40</entry>
    <entry key='filter.duplicate'>true</entry>
    <entry key='filter.skipLimit'>100</entry>
    <entry key='filter.future'>600</entry>
    <entry key='filter.zero'>true</entry>



    <entry key='report.trip.minimalTripDuration'>250</entry>
    <entry key='report.trip.minimalTripDistance'>300</entry>
    <entry key='report.trip.minimalParkingDuration'>300</entry>
    <entry key='report.trip.minimalNoDataDuration'>1200</entry>
    <entry key='report.trip.greedyParking'>true</entry>


    <entry key='coordinates.filter'>true</entry> 
    <entry key='coordinates.minError'>50</entry>
    <entry key='event.motion.speedThreshold'>1.11</entry>
    
    <entry key='event.overspeed.minimalDuration'>15</entry>
    <entry key='event.overspeed.preferLowest'>true</entry> 
    
    
    <entry key='database.throttleUnknown'>true</entry>
    <entry key='database.ignoreUnknown'>true</entry>
    <entry key='database.saveEmpty'>true</entry>
    
    <entry key='users.defaultDeviceLimit'>0</entry>
    <entry key='users.defaultExpirationDays'>7</entry>
    
    <entry key='web.cacheControl'>max-age=23200</entry>
    
    <entry key='filter.approximate'>true</entry>
    <entry key='filter.minPeriod'>15</entry> 
    <entry key='time.override'>serverTime</entry>
Anton Tananaeva year ago

Have you read this thread first before asking? Your question is already answered.

sorry my bad forgot to say i am experiencing same issue with gps103 protocol
also one pressing matter, a device called tk103 uses gt06 protocol is driving me crazy
jump from online to uknown to offline at random intervals, sometime fixtime is off by couple of minutes from servertime
at first i thought i did something wrong in config file but when i tried to put the same device in traccar demo4 it did the same thing
can you please look into it ?