Mavlink Peripherals on the RP2040

For those looking for a quick and easy method of creating MAVLink peripherals, I’ve got a working implementation of the pymavlink library working on the RP2040 microcontroller, using Micropython.

As a useful example, I’ve created a script that reads all the ADC values on a RP2040 and sends the values as NAMED_VALUE_FLOAT MAVLink messages, which can be read (and graphed) by most GCS’s:

MAVProxy:
Screenshot from 2023-01-08 14-20-43
Mission Planner:
missionplanner

The peripheral itself is connected to a flight controller’s telemetry port, with the SERIALn_PROTOCOL = 2 and SERIALn_BAUD=57600:

Full details and source code are available on GitHub.

3 Likes

Thanks for sharing, Stephen! Could you outline how you generated the pymavminimal.py with the message subset? I was looking to add a new message (battery_status) and was trying to figure out if you manually edited common.xml and what the mavgen.py command looked like.

Answered here: Adding an additional mavlink message to pymavminimal.py · Issue #2 · stephendade/mav_rp2040 · GitHub

Thanks for sharing, Stephen! Could you show me the way how can I get info life battery voltage, altitude or speed from mavlink ? I don’t full understand your code and don’t know how to change it… thanks in advance :slight_smile: