traccar / traccar

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
4.95k stars 2.51k forks source link

tlt2h protocol: Enable UDP #5344

Closed frederictobiasc closed 1 week ago

frederictobiasc commented 2 weeks ago

This contribution aims to enable UDP support for the tlt2h protocol. I have a Mictrack MT700 at hand and verified the UDP mode working with this change successfully. The datagrams sent turned out to be identical to those sent in TCP mode.

However, I'm not too familiar with the code base so I don't know if that is enough.

Closes https://github.com/traccar/traccar/issues/5307

tananaev commented 1 week ago

UDP should not need frame decoders.

frederictobiasc commented 1 week ago

UDP should not need frame decoders.

Thanks for your fast review :) I removed the frame decoder and tested successful again. See the logs:

Jun 12 18:59:20 natalia java[109697]: 2024-06-12 18:59:20  INFO: [Uedcdfeba: tlt2h < 212.65.x.y] #<IMEI>#MT700#0000#LOCK#1\r\n#37$GPRMC,185918.00,A,51xx.xxxx,N,008xx.xxxx,E,,319.20,120624,,,A*48\r\n##\r\n
Jun 12 18:59:20 natalia java[109697]: 2024-06-12 18:59:20  INFO: [Uedcdfeba] id: <IMEI>, time: 2024-06-12 18:59:18, lat: 51.xxxxx, lon: 8.xxxxx, course: 319.2
Jun 12 18:59:20 natalia java[109697]: 2024-06-12 18:59:20  INFO: [Uedcdfeba] id: <IMEI>, time: 2024-06-12 18:59:18, lat: 51.xxxxx, lon: 8.xxxxx, course: 319.2
Jun 12 18:59:29 natalia java[109697]: 2024-06-12 18:59:29  INFO: [Uedcdfeba: tlt2h < 212.65.x.y] #<IMEI>#MT700#0000#LOCK#1\r\n#37$GPRMC,185928.00,A,51xx.xxxx,N,008xx.xxxx,E,,319.20,120624,,,A*4B\r\n##\r\n
Jun 12 18:59:29 natalia java[109697]: 2024-06-12 18:59:29  INFO: Event id: <IMEI>, time: 2024-06-12 18:59:28, type: deviceStopped, notifications: 0
Jun 12 18:59:29 natalia java[109697]: 2024-06-12 18:59:29  INFO: [Uedcdfeba] id: <IMEI>, time: 2024-06-12 18:59:28, lat: 51.xxxxx, lon: 8.xxxxx, course: 319.2
Jun 12 18:59:29 natalia java[109697]: 2024-06-12 18:59:29  INFO: [Uedcdfeba] id: <IMEI>, time: 2024-06-12 18:59:28, lat: 51.xxxxx, lon: 8.xxxxx, course: 319.2
tananaev commented 1 week ago

Does it work well if you have multiple locations in the message?

frederictobiasc commented 1 week ago

Does it work well if you have multiple locations in the message?

Seems to work:


Jun 13 06:45:12 natalia java[109697]: 2024-06-13 06:45:12  INFO: [Uedcdfeba: tlt2h < <IP>>] \r\n#<IMEI>#MT700#0000#TOWED#3\r\n#37$GPRMC,183336.00,A,51xx.xxxx,N,008xx.xxxx,E,2.70,124.50,120624,,,A*5C\r\n#37$GPRMC,183336.00,A,51xx.xxxx,N,008xx.xxxx,E,2.70,124.50,120624,,,A*5C\r\n#37$GPRMC,183336.00,A,51xx.xxxx,N,008xx.xxxx,E,2.70,124.50,120624,,,A*5C\r\n##\r\n
Jun 13 06:45:12 natalia java[109697]: 2024-06-13 06:45:12  INFO: [Uedcdfeba] id: <IMEI>, time: 2024-06-12 18:33:36, lat: 51.xxxxx, lon: 8.xxxxx, speed: 2.7, course: 124.5
Jun 13 06:45:12 natalia java[109697]: 2024-06-13 06:45:12  INFO: [Uedcdfeba] id: <IMEI>, time: 2024-06-12 18:33:36, lat: 51.xxxxx, lon: 8.xxxxx, speed: 2.7, course: 124.5
Jun 13 06:45:12 natalia java[109697]: 2024-06-13 06:45:12  INFO: [Uedcdfeba] id: <IMEI>, time: 2024-06-12 18:33:36, lat: 51.xxxxx, lon: 8.xxxxx, speed: 2.7, course: 124.5
Jun 13 06:45:12 natalia java[109697]: 2024-06-13 06:45:12  INFO: [Uedcdfeba] id: <IMEI>, time: 2024-06-12 19:18:39, lat: 51.xxxxx, lon: 8.xxxxx, course: 319.2
tananaev commented 1 week ago

Merged, thanks.