Hardware Integration
Executive Summary
ArduPilot supports Remote ID hardware via two primary protocols: MAVLink (Serial) and DroneCAN. The hardware acts as the transmitter (WiFi/Bluetooth), while the flight controller acts as the data source (GPS, Telemetry).
Theory & Concepts
1. MAVLink vs. DroneCAN
- MAVLink: The module connects to a UART. ArduPilot pushes
OPEN_DRONE_ID_*MAVLink messages to it.- Pros: Simple to debug (readable messages).
- Cons: Burns a UART, slightly higher CPU overhead for framing.
- DroneCAN: The module connects to the CAN bus. ArduPilot publishes
dronecan.remoteid.*messages.- Pros: Robust bus, daisy-chainable, no UART needed.
- Cons: Requires DroneCAN-capable hardware.
2. The Feedback Loop
Communication isn't one-way. The transmitter sends back ARM_STATUS messages to ArduPilot. If the transmitter says "Error" or stops talking, ArduPilot prevents arming (if DID_OPTIONS EnforceArming is set).
Codebase Investigation
1. DroneCAN Backend
Located in libraries/AP_OpenDroneID/AP_OpenDroneID_DroneCAN.cpp.
- Uses
Canard::Publisherto broadcast:dronecan_remoteid_Location(High Rate)dronecan_remoteid_BasicID(Low Rate)
- Receives
dronecan_remoteid_ArmStatusvia callbackhandle_arm_status.
2. MAVLink Routing
Located in libraries/AP_OpenDroneID/AP_OpenDroneID.cpp.
- Checks
_mav_portparameter to determine which Serial port to use. - Uses standard
mavlink_msg_open_drone_id_location_send_struct()functions.
Source Code Reference
How To: Set up Cube ID (DroneCAN)
1. Wiring
Connect the Cube ID to the CAN1 or CAN2 port on your flight controller using the 4-pin JST-GH cable.
2. Configuration
Set the following parameters:
- CAN_P1_DRIVER:
1(Enable Driver 1) - CAN_D1_PROTOCOL:
1(DroneCAN) - DID_ENABLE:
1 - DID_CANDRIVER:
1(Use CAN Driver 1) - DID_MAVPORT:
-1(Disable Serial)
3. Verification
- Reboot.
- Go to Setup > Optional Hardware > UAVCAN.
- Click SLCAN Mode CAN1.
- You should see the Cube ID appear in the node list.
- Check the MAVLink Inspector for
OPEN_DRONE_ID_ARM_STATUS.Statusshould be0(Good to Arm) after GPS lock is obtained.