Skip to content

samuel-duffield1/balena-mavproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MAVProxy on Balena

Deploy MAVProxy ground station software on your edge device with BalenaOS in one click for reliable ArduPilot vehicle communication.

balena deploy button

Features

  • 🚁 MAVProxy Ground Station: Full-featured ArduPilot ground station software
  • πŸ”§ Configurable Serial Interface: Connect to flight controllers via USB, UART, or network
  • πŸ“‘ UDP Telemetry Output: Stream telemetry data to ground control stations
  • πŸ–₯️ Remote Access: Access MAVProxy console via Balena dashboard
  • πŸ”„ Auto-restart: Automatic recovery from connection failures
  • πŸ“Š Persistent Logs: Aircraft logs stored across device reboots

Quick Deploy

Click the deploy button above to deploy this project to your Balena device in one click!

Alternatively, you can deploy manually:

  1. Create a Balena application
  2. Add your device to the application
  3. Clone this repository and push to your Balena application:
git clone https://github.com/samuel-duffield1/balena-mavproxy.git
cd balena-mavproxy
balena push <your-app-name>

Configuration

Configure your MAVProxy instance using Balena device variables:

Variable Description Default
SERIAL_DEVICE Serial device path for flight controller /dev/serial0
OUTPUT_IP IP address for UDP telemetry output 127.0.0.1
OUTPUT_PORT Port for UDP telemetry output 14550
BAUD_RATE Serial communication baud rate 57600
AIRCRAFT_NAME Aircraft identifier for logs aircraft

Setting Device Variables

  1. Navigate to your device in the Balena dashboard
  2. Go to "Device Variables"
  3. Add the variables you want to customize
  4. The application will restart automatically with new settings

Hardware Setup

Supported Devices

This application works on any Balena-supported device with USB ports (and GPIO UART controllers, if applicable):

  • Raspberry Pi
  • Intel NUC
  • Jetson Nano
  • Generic x86_64 devices

Flight Controller Connection

  1. USB Connection: Connect your flight controller to the device via USB
  2. UART Connection: Use GPIO pins for direct serial connection (Raspberry Pi & Jetson)
  3. Network Connection: Configure for network-based MAVLink connections

Common Serial Devices

  • Pixhawk/PX4: Usually /dev/ttyACM0 or /dev/ttyUSB0
  • ArduPilot: Typically /dev/ttyUSB0
  • FTDI adapters: Usually /dev/ttyUSB0, /dev/ttyUSB1, etc.

Accessing MAVProxy

Via Balena Dashboard

  1. Open your device in the Balena dashboard
  2. Click on the "Terminal" tab
  3. Select the mavproxy service
  4. You'll have access to the MAVProxy console

Ground Control Station Setup

Configure your ground control station to receive telemetry:

Mission Planner

  1. Set connection type to "UDP"
  2. Use device IP address and port 14550 (or your configured port)

QGroundControl

  1. Go to Application Settings > Comm Links
  2. Add new link with type "UDP"
  3. Set listening port to match your OUTPUT_PORT

MAVProxy (as GCS)

mavproxy.py --master=udp:YOUR_DEVICE_IP:14550

Logging and Monitoring

View Logs

# Via Balena CLI
balena logs <device-uuid> --service mavproxy

# Via Dashboard
# Navigate to your device > Logs tab

Aircraft Logs

MAVProxy automatically logs flight data to /data/aircraft/ which persists across container restarts.

Health Monitoring

The service includes health checks to ensure MAVProxy is running correctly. Check service status in the Balena dashboard.

Troubleshooting

Common Issues

Device not detected

  • Check USB connection
  • Verify device permissions with ls -la /dev/tty*
  • Try different SERIAL_DEVICE values (/dev/ttyACM0, /dev/ttyUSB1, etc.)

Connection timeout

  • Verify baud rate matches flight controller settings
  • Check serial cable quality
  • Ensure flight controller is powered and booted

No telemetry output

  • Verify OUTPUT_IP and OUTPUT_PORT settings
  • Check network connectivity between device and ground station
  • Ensure firewall allows UDP traffic on the specified port

Service won't start

  • Check device variables are set correctly
  • Review logs for error messages
  • Verify Dockerfile builds successfully

Debug Mode

Enable verbose logging by setting the device variable:

DEBUG=1

This will provide detailed MAVProxy output for troubleshooting.

Development

Local Testing

  1. Clone the repository:
git clone https://github.com/samuel-duffield1/balena-mavproxy.git
cd balena-mavproxy
  1. Test with Docker Compose:
docker-compose up --build
  1. Test with Balena CLI:
balena push <your-test-app>

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Related Projects

About

A one-click solution for connecting your MAVLINK-enabled autonomous vehicle to the internet for remote access.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors