Skip to content

Send Implement Hardware messages towards AgOpenGPS - #71

Open
sujandumaru wants to merge 2 commits into
AgOpenGPS-Official:developfrom
sujandumaru:feat/aog-hardware-messages
Open

Send Implement Hardware messages towards AgOpenGPS#71
sujandumaru wants to merge 2 commits into
AgOpenGPS-Official:developfrom
sujandumaru:feat/aog-hardware-messages

Conversation

@sujandumaru

Copy link
Copy Markdown
Collaborator

Describe your changes

Sends the states which #42 lists to AgOpenGPS on PGN 0xDD (221), so they reach the operator screen and not only the console log. New send_hardware_message() on Application goes out through the existing UdpConnections::send(), so there is no new socket and no new thread.

  • Implement: <name> (<n> sections, <w> m) and Implement lost: <name>. The update loop diffs the client list once per second against a snapshot from the previous pass. I keep the snapshot because on disconnect the client is already gone, so the name and the section count have to come from somewhere.
  • TC address conflict: preferred address in use and TC address conflict resolved, from the 15 s check which so far only wrote a console warning.
  • TECU failed to claim address 240, deferred into the update loop because the address claim happens before UDP is up.
  • AOGDissector.lua decodes 0xDD, and docs/PROTOCOL.md gets the wire format and a table of every message.

Two things surprised me and both are in the doc now. duration is not seconds, AOG stores duration * 10 and decrements it once per render tick, so a condition which persists has to be re-sent. And AOG drops these frames unless Config -> Data -> Hardware Messages is on, which is off by default. That one cost me some time, the wire looked correct and nothing appeared.

The second commit is not part of the issue. The TECU log strings said address 128 and the doc said 128 and 233, but create_internal_control_function() has always been called with the preferred_addresses::IndustryGroup2 enums, 240 and 247. Only the printed numbers were wrong. They interpolate the enum now so they can not drift again. It is separate so you can take or drop it on its own.

How has this been tested?

cmake -S . -B build-linux -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF \
      -DCMAKE_POLICY_VERSION_MINIMUM=3.16 -Wno-dev
cmake --build build-linux -j$(nproc)
./build-linux/AOG-TaskController --can_adapter=socketcan --can_channel=vcan0

On vcan0 with the AgIsoStack SeederExample. I checked the frame in Wireshark with the updated dissector and confirmed the discovery message fires once and does not repeat. Loss, conflict and TECU are reviewed but not driven on a rig yet.

@sujandumaru
sujandumaru requested a review from gunicsba August 27, 2026 04:35
@sujandumaru sujandumaru added the enhancement New feature or request label Aug 27, 2026
@sujandumaru

Copy link
Copy Markdown
Collaborator Author

Preview in AgOpenGPS:
image
hardware-message-main-rendered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant