HuabaoProtocolDecoder fails to parse 0x0704 multimedia messages causing missing GPS

viking6 days ago

Hello,

I encountered an issue with Traccar 6.9.1 where the Huabao protocol decoder does not correctly parse certain device messages.

Details:

  • Devices send Huabao protocol message 0x0704 (multimedia upload), e.g.:
    7e0704004d042282881234004e0001010048000000000008000301e06d1506fc3476...
  • The current HuabaoProtocolDecoder.java decode(...) method does not handle 0x0704 messages
  • This results in GPS coordinates not being displayed, and when the message contains extended fields, it often throws:
    IndexOutOfBoundsException
  • Devices may appear offline or fail to update their positions on the map

Suggested fix:

  • Add parsing logic for 0x0704 messages in HuabaoProtocolDecoder.decode(...)
  • Attempt to extract GPS coordinates, speed, course, and timestamp
  • Safely skip unknown TLV extension fields to prevent decoding errors

This will ensure that devices sending multimedia data still have their GPS locations displayed correctly.

Thank you for your continuous development and maintenance!

viking6 days ago
7e0704004d042282881234004e0001010048000000000008000301e06d1506fc3476000802cf00b92509081040251404000000001702000001040000e3fd2504000000002a02000030011d310112ea04020c8300ef0400000000d77e
viking5 days ago

The web interface cannot resolve the location,I tried to analyze it with AI for your reference.The Huabao protocol message :

7e0704004d042282881234004e0001010048000000000008000301e06d1506fc3476000802cf00b92509081040251404000000001702000001040000e3fd2504000000002a02000030011d310112ea04020c8300ef0400000000d77e

follows the typical structure similar to JT808. The GPS data is located in the “location basic information” section of the message body. Here is the breakdown:

01e06d15 → latitude = 0x01E06D15 = 31,571,989 × 1e-6 = 31.572°N

06fc3476 → longitude = 0x06FC3476 = 117,592,566 × 1e-6 = 117.593°E

0008 → altitude = 8 meters

02cf → speed = 0x02CF = 719 → 71.9 km/h

00b9 → course/heading = 185°

250908104025 (BCD) → timestamp = 2025-09-08 10:40:25

Parsed Result:

Latitude: 31.572°N

Longitude: 117.593°E

Altitude: 8 m

Speed: 71.9 km/h

Heading: 185°

Time: 2025-09-08 10:40:25

Anton Tananaev5 days ago

Do you have the protocol documentation?

viking5 days ago

Sorry I don't have the protocol documentation but this library->https://github.com/SmallChi/JT808/blob/master/README.en.md might help a lot, thanks.

viking5 days ago

Sorry again, I was misled by AI, it’s not 0x0704 "multimedia messages" , but "Upload location data in batches".

Anton Tananaev5 days ago

Upload location data in batches (0x0704) is already supported in Traccar.