PX4 -> QGC connection through USB for VOXL2
-
The readme to help you use my scripts :
./readme.md :
# VOXL USB NCM Setup for ModalAI Starling 2 Max ## Context & Objective > This repository provides scripts and configuration files to enable **USB NCM** (Network Control Model) networking between a **ModalAI Starling 2 Max** drone and a **Linux PC**. The goal is to transfer files faster than **Wi-Fi** or **ADB**, using a direct USB Ethernet link. **USB NCM** creates a virtual Ethernet interface over USB, allowing high-speed IP communication for **SSH**, `rsync`, or other tools. --- ## Features Automatic configuration of USB NCM on both drone and PC. Systemd services to persist configuration across reboots. NetworkManager drop-in to prevent interference on the PC. IP addressing and MTU tuning for optimal performance. ## Installation Run the orchestrator script from the root of this repository: ```bash chmod +x config-voxl-usb-ncm.sh # Already executable normally ./config-voxl-usb-ncm.shOptions
- --pc : Configure only the PC.
- --drone : Configure only the drone (requires adb).
- --uninstall : Stops and disables services, removes scripts, and cleans NetworkManager configuration.
Exemples
# Install on both PC and drone ./config-voxl-usb-ncm.sh # Install only on PC ./config-voxl-usb-ncm.sh --pc # Install only on drone ./config-voxl-usb-ncm.sh --drone # Uninstall everything ./config-voxl-usb-ncm.sh --uninstall # Uninstall only on PC ./config-voxl-usb-ncm.sh --pc --uninstall # Uninstall only on drone ./config-voxl-usb-ncm.sh --drone --uninstallConfiguration Details
- IP Addresses
- Drone: 10.55.0.1/30 on usb0
- PC: 10.55.0.2/30 on enx* (USB Ethernet interface)
- MTU
- Default: 1500 (After some tests, 1500 seems to be the maximum for NCM in USB2.1)
- Systemd Services
- Drone: voxl-usb-ncm.service (oneshot, sets up USB gadget and configures usb0)
- PC: voxl-usb-ncm.service (persistent, monitors enx* and configures IP)
- NetworkManager
- Adds /etc/NetworkManager/conf.d/unmanaged.conf which prevents NetworkManager from interfering with the USB interface.
How to Connect
Once installed and both devices are connected via USB:
# It will ask password ssh root@10.55.0.1 # We can put the password in parameter by using sshpass. # By default, the password on the drone is oelinux123. sshpass -p oelinux123 ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@10.55.0.1File Transfer with rsync
# Example to copy a folder from PC to drone: rsync -ah --info=progress2 --partial --inplace /path/to/local/folder root@10.55.0.1:/path/on/drone/ # Example to copy a folder from drone to pc: rsync -ah --info=progress2 --partial --inplace root@10.55.0.1:/path/to/drone/folder /path/on/pcFile Overview
- File :
on_drone/voxl-usb-ncm-setup.sh- Destination :
/usr/local/sbin/on drone - Purpose : Creates USB gadget NCM function, configures usb0 with IP
10.55.0.1/30and MTU
- Destination :
- File :
on_drone/voxl-usb-ncm.service- Destination :
/etc/systemd/system/on drone - Purpose : Runs setup script at boot (oneshot)
- Destination :
- File :
on_pc/voxl-usb-ncm-setup.sh- Destination :
/usr/local/sbin/on PC - Purpose : Monitors enx* interface, assigns IP
10.55.0.2/30
- Destination :
- File :
on_pc/voxl-usb-ncm.service- Destination :
/etc/systemd/system/on PC - Purpose : Starts monitoring script at boot
- Destination :
- File :
on_pc/unmanaged.conf- Destination :
/etc/NetworkManager/conf.d/ - Purpose : Marks enx* interfaces as unmanaged
- Destination :
- File :
config-voxl-usb-ncm.sh- Purpose : Orchestrates installation/uninstallation on PC and drone