eusonlito / GPS-Tracker

GPS Tracker platform for Sinotrack, Coban, Teltonika, Concox, Jimilab, OsmAnd and Queclink devices built with Laravel 11 + PHP 8.2 and MySQL 8. Plataforma GPS Tracker para dispositivos Sinotrack Sinotrack, Coban, Teltonika, Concox, Jimilab, OsmAnd y Queclink creada con Laravel 11 + PHP 8.2 y MySQL 8.
https://tracker-demo.lito.com.es/
MIT License
137 stars 62 forks source link

ST-901 Current States, Alarms #41

Closed gbkwiatt closed 4 months ago

gbkwiatt commented 5 months ago

Hi, first of all, awesome work, I really wanted some self hosting server, mainly for just fun with a tracker.

So I've got ST-01 and I've managed to connect it to the server.

Not sure If I don't understand how it works with ST-901, but for example, when I trigger shock alarm on the device, I get TEXT message but nothing on the server/web shows that device is in alarm. I've tried to set Vibration alarm, but it does not receive anything.

Similar to Main power off alarm. When I switch it off, I get Text with alert but nothing to show. Is it just that this is not implemented ? I would be happy to work on some implementations for those.

Also it seems like on the map it does not show latest location, I mean time on the Pin on the map, only shows first connection ( I am stationary), while "last connection" on device page, shows later time. Does that mean position wasn't updated ?

Another question ;) - how messages work ? I only seem to get response for RCONF but for anything else it does not show response. Even for rconf it seems like sometimes it does get it sometimes it doesn't

eusonlito commented 5 months ago

Hello! The device alarms haven't relation with the platform alarms.

The platform alarms are calculated on their own from the position reports sent by the device.

The connection timestamp should be relative to the last time the device has sent a location to the server, regardless of whether it is correct or there is movement.

About messages, the platform receives a connection, reads the content and sends the requested message and waits again for the response in the next message.

You can enable server debug and check the log 8091-connection.log to view all platform-device communications :)

gbkwiatt commented 5 months ago

Thanks, I was actually looking into logs and I can see that message with location was sent, but the timestamp on the map is not changing. I will play with it further.

Do you think it would be possible to read decide states somehow ? So to receive alerts from the device ? It must be sending something, since the Chinese server reads it. I guess I can debug messages and see what's coming, however currently in the log I've only seen location or RCONF responses from device

gbkwiatt commented 5 months ago

Another question ;) Is that the whole message that device sends ? This one for example was send on ACC ON

[2024-01-29 21:18:09.726 +00:00] [INFO] [65b81611b123f] [CONNECTED] {"id":"65b81611b123f","timestamp":1706563089,"server_port":8091,"client_ip":"xx.xxx.xxx.xx","client_port":30211,"valid":true}
[2024-01-29 21:18:10.605 +00:00] [INFO] [65b81611b123f] [READ] *HQxxxxxxxV1,191237,A,5129.3905,N,00308.7766,W,000.00,000,290124,FBFFF9FF,234,15,24607,781090#
[2024-01-29 21:18:10.720 +00:00] [INFO] [65b81611b123f] [WRITE] *HQ,xxxxxxx,V4,V1,20240129211810#

And this one on POWER OFF

[2024-01-29 21:16:36.938 +00:00] [INFO] [65b815b4e4f0e] [CONNECTED] {"id":"65b815b4e4f0e","timestamp":1706562996,"server_port":8091,"client_ip":"xxx.xx.xxx.xxx","client_port":41554,"valid":true}
[2024-01-29 21:16:38.794 +00:00] [INFO] [65b815b4e4f0e] [READ] *HQ,xxxxxx,V1,191237,A,5129.3905,N,00308.7766,W,000.00,000,290124,FBFFF9FF,234,15,24607,781090#
[2024-01-29 21:16:38.910 +00:00] [INFO] [65b815b4e4f0e] [WRITE] *HQ,xxxxxx,V4,V1,20240129211638#
[2024-01-29 21:17:44.619 +00:00] [INFO] [65b815b4e4f0e] [READ] null

I can't really see anything that indicates alarm type except that FBFFF9FF could be different, on shake it was FFFFF9FF while FFFFDFFF this seems to be on normal read, or maybe it's delayed or something and device is in alarm state for a while, so it's hard to say, but that's the only flag that seems to be changing to I would suspect it has an Alarm type and state encoded here

Oh and while playing with it, timestamp on the map finally update, but still not to the latest message (connection)

eusonlito commented 5 months ago

Yes, these is the status field:

Screenshot_2024-01-29-22-28-28-88_734a1dba6bd1af2734a63c5417753f29

Here the protocol: SinoTrack Protocol (1).pdf

gbkwiatt commented 5 months ago

Great stuff, That's what I was looking for

eusonlito commented 5 months ago

You should configure the device with UTC timezone:

[2024-01-29 21:16:38.794 +00:00] [INFO] [65b815b4e4f0e] [READ] *HQ,xxxxxx,V1,191237,A,5129.3905,N,00308.7766,W,000.00,000,290124,FBFFF9FF,234,15,24607,781090#

UTC TIME 21:16:38 - DEVICE TIME 191237

gbkwiatt commented 5 months ago

I've set that now, but even that time says V1,212332,A,5129.3947,N,00308.7776,W and message (connection) was received on 21:46, Map still shows image

eusonlito commented 5 months ago

Yes, map positions are filtered by signal and distance from previous position, but connection and messages are managed before those filters.

gbkwiatt commented 5 months ago

That's what I thought - makes sense. Cool Cool, thank you. I will see if I can implement some alerts detection

eusonlito commented 4 months ago

I'm going to close this issue for now :) Regards!