Skip to content

Flight computer: W5500 UDP transport using DAQv2 packets - #177

Open
pranayD21 wants to merge 1 commit into
mainfrom
pranay/flight-ethernet-daq
Open

pranayD21 wants to merge 1 commit into
mainfrom
pranay/flight-ethernet-daq

Conversation

@pranayD21

@pranayD21 pranayD21 commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Update (Nov 9): rebased onto main's src/ layout as a single commit. ./flight_test passes 26/26 and now includes tests/ethernet; pio run -e bench also builds. Networking is still disabled.

Decision needed before DHCP: #180 proposes a static 192.168.2.81 fallback, but #171 has since moved every other board to a MAC-derived 169.254.x.y recovery address and takes the board ID from the lease. #513 says to copy the other boards. @inez9, which should the flight computer follow? Details are in src/app/ETHERNET-DAQ.md.


The flight computer could identify its W5500 but had no Ethernet data path. This adds a bounded UDP driver and a separate network task that sends the existing version-0 BOARD_HEARTBEAT and SENSOR_DATA packets. Sensor/GNSS producers copy selected fields into a nonblocking queue while retaining eMMC logging.

Following issue #180, the disabled default profile now proposes board ID 81, board 192.168.2.81:5005, subnet 255.255.255.0, and server 192.168.2.20:5006. This supersedes the earlier local .20:5006 placeholder. A local unicast MAC is derived from the STM32's full 96-bit UID; the physical board's resulting MAC still needs collision checking and registration.

Discovery-enabled operation broadcasts heartbeats until a valid SERVER_HEARTBEAT or supported SENSOR_CONFIG arrives, pins the responding server, then forgets it after ten seconds of silence. Invalid, unmapped and actuator packets cannot claim or refresh that association. Fixed-server filtering remains available. The task drops stale samples, stops telemetry without configuration, and recovers from link/SPI/send failures. It never dispatches actuator or flight-state commands.

Validation:

  • Six Ethernet suites pass with ASan/UBSan and in Release mode, including shared-library wire compatibility, W5500 ring handling, record conversion, production task execution, discovery/identity, and disabled defaults.
  • Production-task tests cover learning a different server, returning to broadcast after expiry, queue saturation, send timeout, SPI cleanup and cable loss.
  • Clean-rebuild mutation checks prove that broken server pinning, broadcast selection and ten-second expiry fail the new tests.
  • STM32H723VET6 PlatformIO flight build passes: 73,204 bytes flash and 45,452 bytes RAM. Diff checks pass.

Deployment remains incomplete; networking stays disabled pending the sign-off requested in #180:

  • DHCP, lease renewal/rebinding and the five-second static fallback are not implemented. Discovery of the DAQ server is separate from acquiring a DHCP lease.
  • Option A (new FLIGHT_DATA) versus Option B (existing ten-channel SENSOR_DATA) remains an unchecked decision in Flight computer Ethernet: network, channels, DAQ routing (decisions for #513) #180. This PR still implements Option B. Option A needs a shared framing/version/batching contract, decimation and a health-record definition/producer; REC_HEALTH currently has only a type constant.
  • The DAQ needs flight-computer routing, the proposed Elodin 0x26 schema, config-broadcast support, and backend/frontend decoding. Unknown boards currently fall back to PT interpretation. The network SELF_TEST handshake stage is also outstanding and is distinct from the radio SelfTest report in Flight computer: health task, IWDG through Idle sleep, SelfTest frame at start-up #179.
  • A flight-only bench profile needs an agreed way through config_broadcast's designated-survivor requirement. No live profile or service has been changed.
  • Physical MAC registration, network sign-off and hardware validation remain outstanding. No board was flashed or contacted.

ETHERNET-DAQ.md records the implemented behavior, proposed configuration, and remaining work from #180. This PR does not close #180 or STARProject #513.

🤖 Generated with Claude Code

@pranayD21
pranayD21 marked this pull request as ready for review November 6, 2026 03:35
@pranayD21
pranayD21 force-pushed the pranay/flight-ethernet-daq branch from c4d3611 to e86bd46 Compare November 10, 2026 05:44
Ported onto main's src/ layout (#187-#189); replaces the four earlier
commits on this branch with one.

- src/chips/w5500_udp.c: socket 0 UDP, 2 KiB rings, wrap-safe transfers,
  SEND_OK/TIMEOUT handling.
- src/app/daq_{wire,records,network,task}.c: BOARD_HEARTBEAT and
  SENSOR_DATA from lib/daq-protocol, SERVER_HEARTBEAT / SENSOR_CONFIG
  handling, server discovery and pinning, 10 s expiry, UID-derived MAC.
- Networking stays disabled (daq_board_config) until #180 is signed off and
  the DAQ server can route the board.
- tests/ethernet now also runs in ./flight_test (26/26 green).

DHCP is not implemented: #180's static .81 fallback conflicts with the
MAC-derived recovery address every other board moved to in #171. See
src/app/ETHERNET-DAQ.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pranayD21
pranayD21 force-pushed the pranay/flight-ethernet-daq branch from e86bd46 to b57102c Compare November 13, 2026 04:30

This branch has not been deployed

No deployments
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.

Flight computer Ethernet: network, channels, DAQ routing (decisions for #513)

1 participant