Add external voltage extraction for h02 protocol (replaces #5703)#5788
Open
benjamingray123 wants to merge 1 commit intotraccar:masterfrom
Open
Add external voltage extraction for h02 protocol (replaces #5703)#5788benjamingray123 wants to merge 1 commit intotraccar:masterfrom
benjamingray123 wants to merge 1 commit intotraccar:masterfrom
Conversation
tananaev
reviewed
Feb 13, 2026
Comment on lines
+158
to
+161
| if (buf.readableBytes() >= 3) { | ||
| buf.skipBytes(buf.readableBytes() - 3); | ||
| position.set(Position.KEY_POWER, buf.readUnsignedShort() / 10.0); | ||
| } |
Member
There was a problem hiding this comment.
This definitely conflicts with other protocols.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces #5703 which was accidentally closed due to a force-push error.
It addresses all maintainer feedback from the previous PR:
readableBytes()checks instead of absolute indexesH02FrameDecoder)Original description below:
Following my post in the forum: https://www.traccar.org/forums/topic/automotive-relay-style-cj7320-cj730-lk720-not-displaying-vehicle-battery-voltage/
My code adds support for extracting external/vehicle battery voltage from H02 protocol binary messages with extended format (47 bytes).
The frame decoder now correctly detects and reads extended format messages when configured with
protocol.h02.messageLength=47.Changes
Configuration
Users with extended format devices should set: