Skip to content

Add control telemetry, log stream, setpoint override and fix debug sl…#28

Open
mringsby wants to merge 1 commit intomainfrom
debug-telemetry-overrides
Open

Add control telemetry, log stream, setpoint override and fix debug sl…#28
mringsby wants to merge 1 commit intomainfrom
debug-telemetry-overrides

Conversation

@mringsby
Copy link
Copy Markdown
Collaborator

@mringsby mringsby commented Apr 8, 2026

This pull request introduces a new, unified UDP networking architecture for the project, centralizing socket management and packet handling for all topside modules. It replaces ad-hoc socket code with reusable helpers, adds robust CRC-32 utilities, and implements new background receivers for control telemetry and Zephyr log streaming. The BitmaskClient is refactored to use the new transport and CRC code, and now supports uplink watchdog and status reporting.

Networking infrastructure and CRC utilities:

  • Added lib/net_transport.py with reusable UDP socket, listener, and sender classes, plus a centralized sequence number helper, to standardize all UDP networking across modules. (lib/net_transport.py)
  • Added lib/crc.py implementing IEEE 802.3 CRC-32 with both stateless and streaming interfaces, used by all UDP packet modules for data integrity. (lib/crc.py)

New background receivers:

  • Added lib/control_telemetry.py for receiving, parsing, and logging control loop telemetry packets, including setpoint/output/error histories for all axes. (lib/control_telemetry.py)
  • Added lib/log_udp_receiver.py for receiving and storing Zephyr firmware log messages broadcast over UDP, with in-memory buffer and disk logging. (lib/log_udp_receiver.py)

BitmaskClient refactor and uplink reliability:

  • Refactored lib/bitmask.py to use the new UDP transport and CRC modules, added a watchdog thread for uplink reliability, status reporting, and integration with the resource monitor for ACK tracking. (lib/bitmask.py) [1] [2] [3] [4]

Integration and shutdown handling:

  • Updated app.py to initialize and cleanly shut down all new background receivers, and to connect the bitmask client with the resource monitor for ACK tracking. (app.py) [1] [2] [3]…iders

  • Add control loop telemetry receiver (port 5005) with history and charts

  • Add Zephyr log stream receiver (port 5006) for live MCU logs

  • Add setpoint override client (port 5007) for attitude hold experiments

  • Add shared CRC-32 and UDP transport modules

  • Wire up attitude setpoint override card with send/clear handlers

  • Fix setpoint override CRC byte order (big-endian to little-endian)

  • Change debug sliders to send raw joystick input via bitmask (port 12345) instead of setpoint overrides (port 5007)

  • Clear endpoint now resets both bitmask and setpoint override paths

…iders

- Add control loop telemetry receiver (port 5005) with history and charts
- Add Zephyr log stream receiver (port 5006) for live MCU logs
- Add setpoint override client (port 5007) for attitude hold experiments
- Add shared CRC-32 and UDP transport modules
- Wire up attitude setpoint override card with send/clear handlers
- Fix setpoint override CRC byte order (big-endian to little-endian)
- Change debug sliders to send raw joystick input via bitmask (port 12345)
  instead of setpoint overrides (port 5007)
- Clear endpoint now resets both bitmask and setpoint override paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@SlimNinjaRuu SlimNinjaRuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude is never wrong :D

@SlimNinjaRuu SlimNinjaRuu self-requested a review April 8, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants