Event/alarms from devices not handled by server

Amigob2 years ago

I was wondering why for instance events from Teltonika are not handled by the server.
I can see in the logging that Geofencing exit, power cut is received by the server, but the server doesn't do anything with it
Power cut event is handle by the protocol decoder but it seems that it stops there. Auto Geofensing (175) is completely ignored.
I only see ignition ON/OFF, moving or stand still. For the rest the events/alarms are ignored.

if this how it was intended, I would like to extend it, because the device has auto geofencing. and that works way better then any static geofencing.
I like to start with getting the power cut working, should I then add an other event handler in handler/events?

Anton Tananaev2 years ago

If we're talking specifically about Teltonika, they are not decoded because someone at Teltonika decided to make IO ids different between different models, so the mapping is not universal. That's why the server doesn't know how to decode them. That's why you need to either decode it based on the model name or add a computed attribute to convert generic IO values into useful attributes.

Amigob2 years ago

Ok thanks, is there for instance a python script to test the Teltonika device. I can't get it to work work with hex.sh, probably because it needs to send 2 byte arrays with a receive in between.

Anton Tananaev2 years ago

It works for me.

Amigob2 years ago

Can you give an example

Anton Tananaev2 years ago

Just take real device data and send it as one block of HEX.

Amigob2 years ago

If I do that it thinks it is from a ulbotech device and hex.sh hangs

2023-10-18 23:22:28  INFO: [T2a4dbff8: teltonika < 77.240.240.238] 000f383633353430303631373139323932
2023-10-18 23:22:28  INFO: [T2a4dbff8: teltonika > 77.240.240.238] 01
2023-10-18 23:22:28  INFO: [T2a4dbff8: teltonika < 77.240.240.238] 00000000000000578e010000018b4477064800033f90ec1eb043f8000000000000000000000e000a00ef0000f00000c80200450300010000b30100030000b400007162017c0000040042314f0043100300440000000600830000000000000100000fb2
2023-10-18 23:22:28  INFO: event mumber 0
2023-10-18 23:22:28  INFO: [T2a4dbff8] id: 863540061719291, time: 2023-10-18 22:25:33, lat: 51.48682, lon: 5.44975, course: 0.0
2023-10-18 23:22:28  INFO: [T2a4dbff8: teltonika > 77.240.240.238] 00000001
2023-10-18 23:22:29  INFO: [T2a4dbff8] disconnected
^C
amigob@raspberrypi:/opt/traccar $ ^C
amigob@raspberrypi:/opt/traccar $ tail -f logs/tracker-server.log
2023-10-20 17:08:37  INFO: user: 1, action: login, from: 86.104.23.71
2023-10-20 17:12:51  INFO: [T549ed699] disconnected
2023-10-20 17:13:01  INFO: [T78468e79] connected
2023-10-20 17:13:01  INFO: [T78468e79: ulbotech < 127.0.0.1] 000f383633353430303631373139323932000000000000004c08010000018b33d63c0000033f96001eb046f70000000000000000110aef00f0011504c80045020100b3010300b400714f06b50000b60000420000430f2e44000006008301f100004fb8000100002ea0
2023-10-20 17:13:12  INFO: [T78468e79] disconnected
2023-10-20 17:13:22  INFO: [T99769164] connected
2023-10-20 17:13:22  INFO: [T99769164: ulbotech < 127.0.0.1] 000f383633353430303631373139323932000000000000004c08010000018b33d63c0000033f96001eb046f70000000000000000110aef00f0011504c80045020100b3010300b400714f06b50000b60000420000430f2e44000006008301f100004fb8000100002ea0
2023-10-20 17:14:08  INFO: [T99769164] disconnected
2023-10-20 17:14:25  INFO: [T5f6fbce9] connected
2023-10-20 17:14:25  INFO: [T5f6fbce9: ulbotech < 127.0.0.1] 000f38363335343030363137313932393200000000000000578e010000018b4477064800033f90ec1eb043f8000000000000000000000e000a00ef0000f00000c80200450300010000b30100030000b400007162017c0000040042314f0043100300440000000600830000000000000100000fb2
Anton Tananaev2 years ago

It means you're using the wrong port.

Amigob2 years ago

Thanks, that was the problem, was always using 5072 in state of 5027
Now I feel stupid. :-)