Malformed position message close TCP connection

sebacipo3 years ago

Hi,
I would like to know if there is any way to prevent closing the connection when a position message is malformed.
The problem I´m having is with the TLW12BL.

Situation:

  • Device reports every x time without problems.
  • When device lost LTE signal start to save the positions in buffer.
  • When get LTE again it starts to send the batch (15 positions messages) to traccar server.
  • The server get an error because of a malformed message (1 message in 15) and close connection.
  • The device get in a loop trying to send the batch and the server reject it. ( I don't understand why because the device do not expect a response of an 25x25x13 message, but it try to send the same batch all the time causing the disconnection and reconnection)

At the end, it connect and disconnect every 20 seconds.

¿Is any configuration to ignore malformed messages and not close the connection?
I know that there is a problem with the devices ( I got 10 and all are doing the same)

PS: I´m using traccar Server Version 4.14 (compiled with the new T800xProtocolDecoder.java to support TLW12BL - it works great and thanks for the alarms!!)
PS: log from my server

2021-12-13 13:16:28  INFO: [53ada378: t800x < 186.12.64.109] HEX: 25251300599b1e08677300508634000014003c0f00640064c0c0000101000000000000000000000000ffffffff000000004b6900211213115030ffffffffffffffffffffffffffffffff03961264ffff00000024ffffffffff25251300599b1f08677300508634000014003c0f00640064cec0000101000000000000000000000000ffffffff000000004b690021121311513000000000d3fd7bc22d4023c20000000003941261ffff00000025ffffffffff25251300599b2008677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121311523000000000d3fd7bc22d4023c20000000003941278ffff00000026ffffffffff25251300599b2108677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121311533000000000d3fd7bc22d4023c20000000003941274ffff00000027ffffffffff25251300599b2208677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121311543000000000d3fd7bc22d4023c20000000003951274ffff00000027ffffffffff25251300599b2308677300508634000014003c0f00640064efc0000101000000000000000000030000ffffffff000000004b690021121311553000000000d3fd7bc22d4023c20000000003951271ffff00000027ffffffffff25251300599b2408677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121311563000000000d3fd7bc22d4023c20000000003941274ffff00000028ffffffffff25251300599b2508677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121311573000000000d3fd7bc22d4023c20000000003961264ffff00000027ffffffffff25251300599b2608677300508634000014003c0f00640064efc0000101000000000000000000000001ffffffff000000004b690021121311583000000000d3fd7bc22d4023c20000000003951271ffff00000028ffffffffff25251300599b2708677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121311593000000000d3fd7bc22d4023c20000000003951261ffff00000028ffffffffff25251300599b2808677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121312003000000000d3fd7bc22d4023c20000000003941281ffff00000028ffffffffff25251300599b2908677300508634000014003c0f00640063efc0000101000000000000000000000000ffffffff000000004b690021121312013000000000d3fd7bc22d4023c20000000003951264ffff00000029ffffffffff25251300599b2a08677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121312023000000000d3fd7bc22d4023c20000000003961278ffff00000029ffffffffff25251300599b2b08677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121312033000000000d3fd7bc22d4023c20000000003961271ffff00000029ffffffffff25251300599b2c08677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff000000004b690021121312043000000000d3fd7bc22d4023c20000000003951278ffff00000029ffffffffff
2021-12-13 13:16:28  WARN: [53ada378] error - Character N is neither a decimal digit number, decimal point, nor "e" notation exponential mark. - NumberFormatException (... < DistanceHandler:62 < BaseDataHandler:27 < ... < ExtendedObjectDecoder:65 < ...)
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:51:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:52:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:53:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:54:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:55:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:56:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:57:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:58:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 11:59:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 12:00:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 12:01:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 12:02:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 12:03:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] id: 867730050863400, time: 2021-12-13 12:04:30, lat: -40.81267, lon: -62.99788, course: 0.0
2021-12-13 13:16:28  INFO: [53ada378] disconnected

Another device

2525130059890308677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105211100000000d1fd7bc22a4023c20000000003951267ffff00000024ffffffffff2525130059890408677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105221100000000d1fd7bc22a4023c20000000003951274ffff00000024ffffffffff2525130059890508677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105231100000000d1fd7bc22a4023c20000000003951261ffff00000024ffffffffff2525130059890608677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105241100000000d1fd7bc22a4023c20000000003961264ffff00000024ffffffffff2525130059890708677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105251100000000d1fd7bc22a4023c20000000003961264ffff00000023ffffffffff2525130059890808677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105261100000000d1fd7bc22a4023c20000000003961271ffff00000023ffffffffff2525130059890908677300508634000014003c0f00640064efc0000101000000000000000300000000ffffffff00000004d08e0021121105271100000000d1fd7bc22a4023c20000000003961261ffff00000023ffffffffff2525130059890a08677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105281100000000d1fd7bc22a4023c20000000003951274ffff00000023ffffffffff2525130059890b08677300508634000014003c0f00640064efc0000101000000000000000100000000ffffffff00000004d08e0021121105291100000000d1fd7bc22a4023c20000000003961254ffff00000024ffffffffff2525130059890c08677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105301100000000d1fd7bc22a4023c20000000003951267ffff00000023ffffffffff2525130059890d08677300508634000014003c0f0064004fefc0000101000000000000000000000000ffffffff00000004d08e0021121105311100000000d1fd7bc22a4023c20000000003961267ffff00000024ffffffffff
(malformed -> error at byte 36)
252513005992690867730050863400312bfdabb668908da6bffa0eaf60b5e30b95bfbe0a815cdf013e65cf7d72382cd3624b78ef9897f38c3bedf268232b7f1246917e94837cab34720f991efffe43411d5b91811c264bece0 

2525130059890e08677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105331100000000d1fd7bc22a4023c20000000003941264ffff00000023ffffffffff2525130059890f08677300508634000014003c0f00640061efc0000101000000000000000000000000ffffffff00000004d08e0021121105341100000000d1fd7bc22a4023c20000000003951264ffff00000023ffffffffff2525130059891008677300508634000014003c0f00640064efc0000101000000000000000000000000ffffffff00000004d08e0021121105351100000000d1fd7bc22a4023c20000000003951257ffff00000023ffffffffff
Anton Tananaev3 years ago

Please don't address questions to me. This is a forum for the community, not a q&a for me.

sebacipo3 years ago

Ok, sorry Anton,
Does anyone know if there is a way to prevent close TCP connection when a malformed message arrive?

Anton Tananaev3 years ago

There's no way to prevent it.

sebacipo3 years ago

Hello.
I am trying to test messages using the t800 protocol.
To simulate the device I am using tools/hex.sh
I can send the login correctly (web interface update last connection and keep in red) but when I send the position message, the server do not update the position in web interface.
I'm trying with the demo server.

LOGIN

hex.sh 46.101.24.212 5094 252501001700170867730054086982011005010a111220

POSITION

hex.sh 46.101.24.212 5094 2525130059847808677300540869820005003c0f00320036ecc0001e01000000000000001300070013ffffffff00000000000000211214201029f853234042057cc2833b23c20000008303971224ffff0000002cffffffffff

Why the position is not updated in the web interface?

Anton Tananaev3 years ago

You obviously need to send both messages over the same network connection.