Inspiration

Field robots and spraying drones report what they did through MAVLink, and those logs end up in disputes with dealers, agronomists and insurers. A plain log file can be edited later. We wanted the record to be trustworthy from the moment the frame arrives on the companion computer.

What it does

ofnode listens to ArduPilot or PX4 telemetry over UDP, decodes MAVLink v1 and v2 with full CRC checks, rejects corrupted frames, and appends every accepted frame to a journal where each entry carries the SHA-256 of the previous one and an HMAC signature with a per-device key. A watchdog writes LINK_LOST and LINK_UP events when the heartbeat stops and returns. A verify mode replays the chain and points at the first entry that does not match.

How we built it

On QNX: the receive thread runs at SCHED_FIFO priority; the watchdog is a kernel timer that delivers pulses to a channel (ChannelCreate, timer_create, MsgReceivePulse); per-frame receive-to-journal latency is measured with ClockCycles(); built with qcc for x86_64 and aarch64le and run under QEMU.

Challenges we ran into

Keeping the decoder small and exact (CRC_EXTRA per message, v2 zero-trimmed payloads), and making the journal resume cleanly after a power cut without breaking the chain. On the tooling side, the build host has no KVM and no root: QEMU runs in pure software emulation, the stock mkqnximage image needed sshd-auth for the OpenSSH 10.4 that ships with this SDP level, and OpenSSL's CPU probe crashed sshd under -cpu max until we masked one feature bit.

Accomplishments that we're proud of

The same C11 sources build with qcc for x86_64 and aarch64le without warnings and run unchanged on QNX 8.0. On the target the self-test passes 11 of 11; a 20-second mission of 160 MAVLink v2 frames yields one rejected corrupted frame, LINK_LOST and LINK_UP events from the pulse watchdog, a journal of 166 entries that verifies, and a single edited field in line 40 that verification pinpoints.

What we learned

QNX pulses and kernel timers make a watchdog that needs no extra thread, and ClockCycles() gives per-frame latency for free. Under emulation the numbers are an upper bound (video run: p50 158 µs, p95 388 µs, max 29.5 ms), so the next measurement belongs on real hardware.

What's next for OpenField Evidence Node for QNX

Run it on a Raspberry Pi companion computer next to a real autopilot, and anchor the journal head hash in the OpenField back office so a whole season of field work can be checked in one step.

Built With

  • c
  • hmac
  • mavlink
  • python
  • qcc
  • qemu
  • qnx
  • sha-256
Share this project:

Updates

Submission history