ESP32-S3 Remote ID add-on module firmware that implements the EU direct remote identification requirements, built on ESP-IDF and OpenDroneID. Conformity of a product built on it is not yet established; see Conformity status.
The firmware broadcasts the four mandatory message types required by EU Commission Delegated Regulation (EU) 2019/945 and implementing Regulation (EU) 2021/664, encoded per ASTM F3411-22a (OpenDroneID): Basic ID, Location/Vector, System, and Operator ID. Transmission supports Bluetooth LE legacy advertising and Wi-Fi Beacon advertisements. Payload encoding uses the official opendroneid-core-c library, included as a git submodule.
BLE uses service UUID 0xFFFA and rotates one ODID message per advertisement. Wi-Fi Beacon uses the upstream OpenDroneID Message Pack Beacon frame builder and sends vendor information elements with the ASD-STAN OpenDroneID OUI.
Each BLE advertisement carries one ODID message as a standard Service Data AD structure:
0xFFFA service data = 0x0D | message_counter | 25-byte OpenDroneID message
The 0xFFFA UUID is assigned by the Bluetooth SIG for UAS Remote ID and is the universal identifier all compliant receivers scan for. The 0x0D byte is the Bluetooth SIG Open Drone ID Application Code defined in ASTM F3411-22a. It is part of the standard, not specific to any platform.
Any compliant receiver can read these advertisements:
- Android apps such as
opendroneid/receiver-androidfilter on the0x0Dapplication code to identify Remote ID packets among general BLE traffic. - iOS third-party apps use the
0xFFFAservice UUID for discovery; iOS 16 and later also includes native OS-level Remote ID detection. - Dedicated scanners authority and enforcement hardware reads the same standardised packet format.
ESP32-S3 board with external BLE/WiFi antenna running the Remote ID firmware.
All identity and position fields are set through ESP-IDF's Kconfig system. Run:
make menuconfig
and navigate to ESP Remote ID. The sections below explain what each option means and which values are legally required.
Note: The firmware implements the ASTM F3411 / EN 4709-002 message formats and the Regulation (EU) 2019/945 broadcast requirements as far as they can be checked in code and host tests; Conformity status lists what is still to be shown. Whether your specific operation is legal depends on your national CAA rules, aircraft registration, and operating category. This firmware does not substitute for regulatory advice.
| Option | Description |
|---|---|
| UAS ID | The ANSI/CTA-2063-A serial number of the Remote ID system, broadcast in the Basic ID message. Max 20 characters. Set in Kconfig in a normal build; a strict build reads it from eFuse instead (see Serial number provisioning). |
| Operator registration ID | Your national operator registration number. For an EU number enter the full form with its 3 secret characters, e.g. FIN87astrdge12k8-xyz. Max 20 characters. |
Set both to your actual values before any flight. The placeholder defaults (CHANGE_ME_*) are not valid for operation and intentionally block all broadcasts until replaced or overridden by valid MAVLink or DroneCAN input.
EU operator registration number. The number has 16 public characters (3-letter country code, 12 characters, 1 check character) and 3 secret characters that only the operator knows. Enter all 20 as <16 public>-<3 secret>, in Kconfig or from the ground station. The firmware verifies the check character against the secret part and then drops the secret: only the 16 public characters are stored and broadcast. A wrong secret or a typo is rejected, and the module stays not-ready.
In the EU the UAS ID is always the serial number: Regulation (EU) 2019/945 (Part 6 of the Annex) requires the Remote ID system to broadcast its own ANSI/CTA-2063-A serial number for an add-on module, or the serial number of the aircraft when the system is built in. The serial has the form <4-character manufacturer code><length character 1-F><serial>, using digits and upper-case letters without O and I, e.g. 1ABC5XYZ12. The manufacturer code is issued by the ICAO through CTA.
Outside strict compliance mode the serial is set in Kconfig (UAS ID), and the ID type can also be set to CAA Registration ID for testing or for jurisdictions that accept a registration number as the UAS ID. That is not an EU-compliant configuration.
EN 4709-002 requires the serial number to be loaded at the factory, protected from modification afterwards and stored in secure memory. A strict build therefore reads it from the ESP32-S3 eFuse user data block (BLOCK_USR_DATA), not from Kconfig. eFuses are one-time programmable: once the block is write-protected, neither firmware nor a reflash can change the serial. One signed firmware image then serves every unit.
Provision each unit once at production, before it is sealed. Burning eFuses is irreversible: check the serial before running the commands.
# The block is 32 bytes: the serial (NUL-padded ASCII, at most 20 characters), then zeros. python3 -c "import sys; s=sys.argv[1].encode(); open('serial.bin','wb').write(s + bytes(32 - len(s)))" 1ABC5XYZ12 espefuse.py --chip esp32s3 --port /dev/ttyUSB0 burn_block_data BLOCK_USR_DATA serial.bin espefuse.py --chip esp32s3 --port /dev/ttyUSB0 write_protect_efuse BLOCK_USR_DATA
Burn the data before write-protecting: the write protection locks the block in whatever state it is in. The commands were checked with espefuse.py --virt; the block then reads 31 41 42 43 35 58 59 5a 31 32 00 ... ("1ABC5XYZ12") and a second burn is refused. The same block also holds the optional custom MAC address (bytes 25 to 30), which stays unset.
At boot the firmware logs an error when the block is empty (the module then stays not-ready, "UAS ID not set") and a warning when it is not write-protected.
Strict EU (EASA) compliance mode enforces the EU rules at runtime instead of only warning. It needs a live position source (MAVLink or DroneCAN input).
| Rule | Normal build | Strict build |
|---|---|---|
| UAS ID | Any ID type, set in Kconfig; Basic ID from MAVLink/DroneCAN replaces it | The serial number from the write-protected eFuse block (see Serial number provisioning); Basic ID from MAVLink/DroneCAN is ignored, so the serial cannot be changed in operation or by reflashing |
| Malformed CTA-2063-A serial | Logged as a warning, still broadcast | Never broadcast; not-ready, error indicator, Invalid UAS serial (CTA-2063-A) reported to the autopilot |
| Operator ID | 16-character ID accepted unverified; a 20-character -xyz form is verified and stripped |
Only the 20-character form, verified and stripped |
| UA type | Configured, or from Basic ID input | Configured at build time |
| Aircraft Location (MAVLink) | From any sender on the link that describes this aircraft | Only from the bound autopilot; a ground station or companion cannot set the aircraft position |
| Ready to arm | Fresh Location (runtime position source) and a pilot position or take-off point | In addition, the Location carries a position, height, time stamp, ground speed and, when moving faster than 0.5 m/s, a course ("Incomplete aircraft location data" otherwise) |
| Fixed configured position | Available for bench tests | Not available |
| Start-up delay | Configurable (default 10 s) | None: a module that reboots in flight resumes broadcasting at once |
| OTA server | Optional | Only with Secure Boot (signed images) and a WPA2 password of at least 8 characters; the build fails otherwise |
| Transports | Any | At least one of BLE 5 Long Range, Wi-Fi Beacon or Wi-Fi NAN, the broadcast methods EN 4709-002 requires; the build fails otherwise. BLE 4 legacy stays recommended alongside, for phones without those receivers |
In both modes an operator ID that fails the consistency check is reported until a valid one is uploaded (see EU compliance mapping).
With the runtime identity source, a strict build still takes the operator ID and the System data (operator location, category, class) from the flight controller or ground station; only the serial and UA type are fixed.
The serial cannot be changed by reflashing, because it lives in eFuse. The rest of the behaviour (aircraft position only from the autopilot, the checks above) is firmware, so a production device still needs Secure Boot and flash encryption (see Flash encryption); a strict build without both logs a warning at every boot.
How the firmware addresses the requirements for a direct remote identification add-on, Regulation (EU) 2019/945 Annex Part 6, checked against the consolidated version of 24 June 2025 (Part 6 is as amended by Regulation (EU) 2020/1058; later amendments did not change it). Classes C1 to C3 (Parts 2 to 4) have the same data list plus an indication of the emergency status.
| Requirement | Implementation |
|---|---|
| (1) Upload of the operator registration number, consistency check of the full string, error message on inconsistency | Operator ID from Kconfig, MAVLink or DroneCAN. The 20-character form is checked (Luhn mod 36 over the public and secret characters). A failure is reported to the autopilot as Operator ID failed consistency check (ARM_STATUS / ArmStatus, which ArduPilot shows as a pre-arm failure and forwards to the ground station) and on the status indicator, until a valid number is uploaded. |
| (2) Unique ANSI/CTA-2063-A serial number, affixed legibly to the add-on and to its packaging or its manufacturer's instructions | Strict mode: serial burned into write-protected eFuse at production and validated at boot. Labelling is a manufacturing step. |
| (3) Real-time periodic broadcast during the whole flight, open and documented protocol, receivable by existing mobile devices | ASTM F3411-22a / EN 4709-002 messages over Bluetooth 4 legacy advertising (default), Bluetooth 5 Long Range (Message Packs), Wi-Fi Beacon and Wi-Fi NAN; strict mode requires one of the last three. Location and System at least every second, the other messages at least every 3 s. Transmit failures latch a Remote ID system failure (broadcast status, arming blocked), and so does an enabled transport that does not send within 5 s of the identity becoming usable or of its previous transmission. Good to arm is only reported once every enabled transport has transmitted. |
| (3)(i) Operator registration number and verification code, unless the check failed | Operator ID message: the 16 public characters, the last being the check character; the 3 secret characters are never broadcast. A number that fails the check is never broadcast. |
| (3)(ii) Serial number | Basic ID message, ID type serial number. |
| (3)(iii) Time stamp, position, height above the surface or take-off point | Location message from the autopilot, with its time stamp and height reference. A Location only counts as fresh when its source time stamp moves forward from the last accepted sample (see Aircraft location freshness), so a relay repeating a cached sample is reported stale. Strict mode only reports ready to arm when all three are present. |
| (3)(iv) Course from true north and ground speed | Location direction and horizontal speed. Strict mode requires a known ground speed, and a known course above 0.5 m/s, before it reports ready to arm. |
| (3)(v) Position of the remote pilot or, if not available, the take-off point | System message. The pilot position comes from the ground station. The take-off point is captured when the bound autopilot arms (MAVLink HEARTBEAT, DroneCAN ArmingStatus) and used when no pilot position is available, including when a live pilot position stops updating. Every input reports "No pilot or take-off position" when neither is available, except while the autopilot is known to be disarmed (the take-off point is captured at arming, so requiring it earlier would deadlock). |
| Emergency status (C1 to C3) | Location status, from the autopilot or derived from its HEARTBEAT. |
| (4) Reduce the ability to tamper | Strict mode: serial in write-protected eFuse, aircraft position only from the autopilot, OTA only with Secure Boot and WPA2, no fixed position. Secure Boot and flash encryption are required for production units. |
| (5) Manufacturer's instructions: transmission protocol, installation, upload of the operator number | This README covers the protocol and setup. A product's user manual has to state them for the end user. |
Reviewed on 12 November 2026. Recheck when one of these acts or standards is amended.
| Act | Version checked | Scope of the check |
|---|---|---|
| Commission Delegated Regulation (EU) 2019/945 | Consolidated version of 24 June 2025 (CELEX 02019R0945-20250624) | Annex Part 6, the requirements for a direct remote identification add-on, in full. This is the basis of the table above. |
| Commission Delegated Regulation (EU) 2020/1058 | As incorporated in 2019/945 | Set the current Part 6 and the direct remote identification points of Parts 2 to 4 (classes C1 to C3). Parts 2 to 4 were checked in the 2020 text only, not in the 2025 consolidation. |
| Commission Delegated Regulation (EU) 2024/1108 | OJ L, 23.5.2024 | Its amendments to 2019/945, in full: the UAS definitions, certification under Article 40, and the low-battery warning for classes C1 to C3. None of them changes the remote identification requirements. |
| Commission Implementing Decision (EU) 2024/2103 | OJ | Cites EN 4709-002:2023 as the harmonised standard for direct remote identification, except for Part 6 point (3) (and the matching C1 to C3 points): following the standard gives no presumption that the broadcast can be received by existing mobile devices. That has to be shown separately, with reception tests on current Android and iOS phones. |
| EN 4709-002 (ASD-STAN) | Public sample of the draft prEN 4709-002:2020 (clauses 1 to 4.6) and ASD-STAN's introduction to the standard | Not the final EN 4709-002:2023 text, which is paywalled: see the findings below. |
EN 4709-002 findings from those sources, to confirm against the final text:
| Topic | Draft / ASD-STAN text | Firmware |
|---|---|---|
| Mandatory messages | Basic ID, Location, System, Operator ID and Message Pack mandatory; Self ID optional; emergency status not required for an add-on | All sent. BLE 5 and Wi-Fi carry Message Packs |
| Broadcast methods | BLE 5 Long Range, Wi-Fi NAN (2.4 GHz) or Wi-Fi Beacon: at least one is mandatory. BLE 4 legacy advertising is optional | Strict mode requires one of the three; BLE 4 recommended alongside |
| Update rates | Location at least every 1 s, static messages at least every 3 s | Met on every transport |
| Data age | The dynamic fields of the Location message no older than 1 s | Depends on the source. ArduPilot sends Location at a fixed 1 Hz (not configurable), so the broadcast data can be just over 1 s old just before the next sample. Meeting this with margin needs a source at 2 Hz or more |
| Operator number upload | Full 20-character string, Luhn mod 36 check, invalid numbers refused, only the public part stored and broadcast; country code upper case, the rest lower case | Implemented; upper-case input is normalised to lower case. For an add-on the standard asks for a "specific application" to enter and check the number: here that is the ground station plus the module's error report, which may need a dedicated tool for a product |
| Serial number | Loaded at the factory, not modifiable afterwards, stored in a secure memory area; shown by design documentation | Strict mode: write-protected eFuse |
| Tampering with position data | Explicitly outside the standard's scope | Strict mode still takes the aircraft position only from the autopilot |
| Output power and directivity | As high as national limits allow; omni-directional | Maximum power by default (BLE +9 dBm, Wi-Fi 20 dBm). Antenna placement is an installation matter |
| Add-on definition | "A standalone Direct Remote ID broadcast device integrating a GNSS function, a barometric function, a communication function" | Gap. This module has no GNSS or barometer; it relays the autopilot's data. As an add-on under this definition it would need its own GNSS and barometer, or it has to be placed on the market as part of the aircraft's remote ID system |
Not covered by this check:
- EN 4709-002:2023, final text, including clause 5 (transports, power, test procedures) and clause 6 (test methods).
- ASTM F3411-22a, the message format. Messages are encoded with the reference library
opendroneid-core-c; the standard text itself has not been reviewed. - Commission Implementing Regulation (EU) 2019/947, Article 14, which sets the operator registration. The check-character algorithm follows EASA's published operator number scheme and is verified against EASA's example number.
- EASA Opinion No 06/2026, a proposal to update 2019/945 and 2019/947. It is not law yet and has not been reviewed.
The code and the host tests show the behaviour described above. Conformity of a product also needs evidence that this repository does not provide yet:
- EN 4709-002:2023 reviewed clause by clause (the findings above come from draft-era sources).
- Radio measurements on hardware: sample-to-air age of the Location data, the actual message rates per transport, transmit power and directivity.
- Reception and range with current Android and iOS phones, per transport (EN 4709-002 gives no presumption of conformity for this).
- Failure behaviour on hardware: reboot in flight, loss of the autopilot link, loss of the pilot position stream.
- Source contract: the aircraft position source must deliver new Location samples with correct UTC timestamps. The module rejects repeated, backward and alternating samples but cannot detect an absolute age error or a replayed cycle of five or more old samples, because its clock is not always independent of the source (see the clock provenance in Operator-location freshness loop). ArduPilot's fixed 1 Hz rate is marginal against the 1-second data-age rule.
- Product evidence: per-unit serial provisioning (eFuse), Secure Boot and flash encryption, the serial marking on the module and packaging, and the user manual (transmission protocol, installation, operator number upload).
Select the airframe type that matches your aircraft. Helicopter / Multirotor is the default and covers most DIY multirotors.
| Scenario | Class | Category |
|---|---|---|
| Self-built drone (no CE class label) | Undeclared (default) | Open |
| Factory drone with CE class label | C0 - C6 as marked | Open / Specific / Certified |
Self-built drones do not carry a C-class label. Setting the class to anything other than Undeclared when no CE mark exists is incorrect. The default Kconfig values (Undeclared class, Open category) are the correct starting point for the vast majority of self-built aircraft.
The Location and System messages must be broadcast at 1 Hz regardless of whether position is known. Two modes are supported:
No position available (default: Broadcast a known takeoff position = disabled)
The messages are populated with the ASTM F3411 invalid sentinel values:
| Field | Sentinel value |
|---|---|
| Latitude / Longitude | 0 |
| Altitude (baro, geo, height) | −1000 m |
| Speed (horizontal / vertical) | 255 / 63 |
| Direction | 361° |
| Timestamp | 0xFFFF |
| All accuracy fields | Unknown |
| Status | Undeclared |
This is protocol-compliant. The broadcast system is active and all four message types are transmitted; receivers will decode the messages and display the UAS ID while showing the position as unknown.
Known takeoff position (Broadcast a known takeoff position = enabled; not available in strict compliance mode)
Enable this option and enter the takeoff coordinates. The firmware latches these values at compile time and broadcasts them as the UA and operator position (EU regulation permits using the takeoff location as the operator location for add-on modules). The configured altitude is geodetic (WGS-84), so the barometric altitude is broadcast as unknown. A fixed UA position does not follow the aircraft in flight; use it for bench testing, not as a substitute for live position input.
| Option | Format | Example |
|---|---|---|
| Takeoff latitude | Degrees × 10⁶ (signed) | 50962290 for 50.962290° N |
| Takeoff longitude | Degrees × 10⁶ (signed) | 4454977 for 4.454977° E |
| Takeoff altitude | Whole metres above WGS-84 ellipsoid | 50 |
Obtain the WGS-84 altitude from a GNSS receiver or an online tool such as https://www.unavco.org/software/geodetic-utilities/geoid-height-calculator/geoid-height-calculator.html.
BLE 4 legacy is enabled by default. All other transports are disabled by default so receiver testing can isolate one transport at a time. BLE 4 legacy and BLE 5 Long Range can run simultaneously; each is an independent task on the same NimBLE host.
Regulatory note on BLE 5 Long Range: Regulation (EU) 2019/945 does not list transports. It requires a broadcast over "an open and documented transmission protocol" that "can be received directly by existing mobile devices". Most phones cannot receive LE Coded PHY, so never use BLE 5 Long Range on its own in the EU: keep BLE 4 legacy advertising (or Wi-Fi) enabled alongside it. BLE 5 is disabled by default.
| Option | Default | Description |
|---|---|---|
Enable Bluetooth LE legacy advertisements |
Enabled | Broadcasts OpenDroneID messages using BLE 4 legacy advertising on service UUID 0xFFFA. Supported by all current receiver apps. |
Enable Bluetooth 5 Long Range (LE Coded PHY) |
Disabled | Broadcasts OpenDroneID Message Packs (all messages in one advertisement, every slot interval) using BLE 5 extended advertising with LE Coded PHY (S=8). Increases range significantly at the cost of a lower air data rate. Can run alongside BLE 4 legacy. One of the broadcast methods EN 4709-002 requires; many phones, iPhones included, cannot receive it. Needs CONFIG_BT_NIMBLE_EXT_ADV_MAX_SIZE=251 (the default here). |
BLE advertisement rotation interval |
250 ms |
BLE payload rotation cadence for both BLE transports (100 to 260 ms). Location and System are sent every third slot (every 750 ms at the default); Basic ID, Operator ID and Self ID once per 9-slot cycle, with the authentication pages spread between them. The 260 ms maximum keeps Location and System within 1 s and every other message within 3 s (see BLE schedule with authentication). |
Enable Wi-Fi Beacon advertisements |
Disabled | Broadcasts OpenDroneID Message Pack payloads in Wi-Fi Beacon vendor IEs. |
Enable Wi-Fi NAN advertisements |
Disabled | Broadcasts OpenDroneID Message Pack payloads in Wi-Fi NAN sync/action frames. |
Wi-Fi Remote ID channel |
6 |
2.4 GHz channel used by the ESP32-S3 Wi-Fi transport. |
Wi-Fi TX power |
20 dBm |
Converted internally to ESP-IDF quarter-dBm units. |
Wi-Fi Beacon SSID |
OpenDroneID |
SSID embedded only in Beacon frames. Receivers should parse the vendor IE, not rely on this SSID. |
Wi-Fi Beacon TX interval |
1000 ms |
Wi-Fi Beacon transmission cadence (100 to 1000 ms, fixed rate). Every frame carries the full message pack. |
Wi-Fi NAN TX interval |
1000 ms |
Wi-Fi NAN sync/action transmission cadence (100 to 1000 ms, fixed rate). |
Enable onboard RGB status indicator |
Disabled | Drives a board-mounted addressable RGB LED as a local status indicator. |
Onboard RGB LED data GPIO |
48 |
Physical ESP32-S3 GPIO connected to the onboard WS2812/SK6812-style RGB LED data input. The UICPAL ESP32-S3-N16R8 board variant used by this firmware uses GPIO48; other variants may use GPIO33 or another pin. |
Onboard RGB LED brightness |
16% |
Scales the local indicator LED brightness. |
Onboard RGB operational flash pattern |
Drone beacon 1 Hz short flash |
Pattern used after transports have started and valid Remote ID identity is available. |
Enable external GPIO lighting outputs |
Disabled | Enables up to five simple GPIO outputs for external light trigger circuits. |
Startup delay before transmissions |
10000 ms |
Development delay before starting BLE/Wi-Fi so there is time to attach the serial monitor. Not available in strict compliance mode (no delay). |
The onboard RGB indicator is intended for local module status, not for driving external aviation lights. It uses the ESP32-S3 RMT peripheral to drive one addressable RGB LED, typically a WS2812/SK6812 device on the devboard. The UICPAL ESP32-S3-N16R8 board variant used by this firmware uses GPIO48 for the onboard RGB LED.
Status behavior:
| Firmware state | Onboard RGB behavior |
|---|---|
| Waiting for Remote ID readiness or transport startup | Amber slow blink |
| Operational | Configured green flash pattern |
| Error state | Red fast blink |
Operational means the same as GOOD_TO_ARM: a valid Basic ID/UAS ID and Operator ID, all enabled transports running without a reported fault and, when the position comes from MAVLink or DroneCAN, a new, in-order Location sample with a source time stamp within the last 3 s, plus a pilot position or take-off point (or a disarmed autopilot that will provide one at arming). Anything else shows the waiting pattern. A latched Remote ID system failure, an operator ID that failed its consistency check, or an invalid serial shows the error pattern.
The RGB data pin is not a suitable transistor trigger for external lights because addressable LEDs use a high-speed encoded data waveform. Use the external GPIO lighting outputs for that purpose.
The external GPIO lighting module provides five independently configurable GPIO outputs. These outputs are logic-level triggers intended for transistor, MOSFET, relay-driver, or opto-isolator inputs. Do not power aircraft lights directly from ESP32 GPIO pins.
Each output has its own configuration:
| Setting | Description |
|---|---|
Enable output N |
Enables this lighting output. |
Output N GPIO |
Physical ESP32-S3 GPIO used as the trigger signal. |
Output N active high |
Controls whether logical ON drives the pin high or low. |
Output N open drain |
Uses open-drain output mode for compatible external circuits. |
Output N operational pattern |
Pattern used when Remote ID transports are started and identity is ready. |
Output N pattern phase offset |
Staggers matching patterns across multiple outputs. |
Outputs remain off until valid Basic ID/UAS ID and Operator ID are available and enabled transports have started.
Available operational patterns:
Solid onBeacon 1 Hz short flashBeacon 1 Hz 50% dutySingle strobeDouble strobeTriple strobeFast strobe
Example setup:
Output 0: GPIO 4, Double strobe, phase 0 ms
Output 1: GPIO 5, Double strobe, phase 500 ms
Output 2: GPIO 6, Beacon 1 Hz short flash
Output 3: disabled
Output 4: disabled
MAVLink input is available but disabled by default. When enabled, the firmware listens on a configured UART and accepts these MAVLink OpenDroneID messages:
OPEN_DRONE_ID_BASIC_IDOPEN_DRONE_ID_OPERATOR_IDOPEN_DRONE_ID_LOCATIONOPEN_DRONE_ID_SYSTEMOPEN_DRONE_ID_SELF_IDOPEN_DRONE_ID_AUTHENTICATIONOPEN_DRONE_ID_MESSAGE_PACK
It also watches HEARTBEAT and SYSTEM_TIME from the autopilot. The module binds to the first HEARTBEAT from an autopilot component (MAV_COMP_ID_AUTOPILOT1) of the configured target system, or of any system when none is configured, and never re-binds. Arm state (takeoff capture, emergency status) and the UTC clock are taken only from that autopilot; a GCS or companion SYSTEM_TIME is ignored. The arm state is unknown until the first HEARTBEAT, so a module that reboots while the vehicle is armed does not capture its in-flight position as the takeoff point.
Only data about this aircraft is accepted. A message with a non-zero id_or_mac, or one sent by an Open Drone ID transmitter/receiver component (236-238), describes another aircraft seen by a Remote ID receiver and is ignored, including inside OPEN_DRONE_ID_MESSAGE_PACK. A 0/0 target alone does not make a message about this aircraft.
Every input path (MAVLink messages, message packs, DroneCAN, Kconfig) goes through the same validation before it changes the broadcast state:
- The UAS ID must match its ID type. Serial number and CAA registration IDs are printable ASCII; UTM UUIDs and specific session IDs are binary and stored byte for byte, including NUL bytes. ID type
None, reserved types and empty IDs are rejected and never replace a valid identity. - A full EU operator registration number entered with its secret part (
FIN87astrdge12k8-xyz) is checksum-verified (Luhn mod 36), and only the 16 public characters are stored and broadcast. A wrong secret part is rejected. In strict compliance mode only this form is accepted, and Basic ID input is ignored (see Strict EU (EASA) compliance mode). - An update that the OpenDroneID encoder cannot represent (out-of-range enum, coordinate, speed or authentication page) is rejected as a whole instead of stopping the broadcast.
Part 6(3) requires real-time data, so the module only counts a Location as fresh when it is a new measurement, judged by the source's time stamp (seconds after the UTC hour), never by its arrival:
- Unknown time (
0xFFFF, as ArduPilot sends without a 3D GPS fix): the position is still broadcast, with an unknown time stamp, but it is never stamped with its arrival time and the location is not fresh from that sample on: freshness always belongs to the coordinates currently held, so an earlier timed sample cannot vouch for them. The take-off point is therefore never captured from an untimed sample. - In order: a timed sample must be ahead of the last accepted one, across the rollover at the full hour, and by no more than the local time elapsed between them plus 5 s. A repeated sample (a relay's cache), one behind the last accepted one, or alternating old samples are ignored whole: they change neither the broadcast data nor the order reference.
- Time steps: five consecutive ignored samples that move forward among themselves are taken as the source's clock having stepped back, and its new time is followed. A repeated or alternating replay never forms such a run; a relay replaying a cycle of five or more old samples cannot be told apart without an independent clock.
Ready to arm requires a fresh Location (accepted within the last 3 s).
OPEN_DRONE_ID_MESSAGE_PACK is unpacked and each contained OpenDroneID message is applied as if it had arrived on its own, so a flight controller can deliver the full set in a single frame. Authentication pages (OPEN_DRONE_ID_AUTHENTICATION, or inside a message pack) are used only when the authentication source is Relay from MAVLink; see Authentication.
Incoming Basic ID and Operator ID updates feed the same readiness gate as Kconfig values. This allows a flight controller or companion computer to provide identity at runtime while keeping the placeholder Kconfig values in flash. Broadcasts still do not start until a valid Basic ID/UAS ID and Operator ID are present.
Flight controllers do not send the OPEN_DRONE_ID_* messages by default; OpenDroneID has to be enabled and, on some firmware, compiled in.
ArduPilot. Set DID_ENABLE = 1 and reboot. The OpenDroneID feature must be present in the firmware: many boards ship without it to save flash, so you may need a build with the "OpenDroneID" feature selected (via the custom firmware build server). Related parameters:
| Parameter | Purpose |
|---|---|
DID_ENABLE |
Master enable for OpenDroneID. |
DID_MAVPORT |
Serial port index that carries the OpenDroneID MAVLink stream to this module (-1 for none). |
DID_CANDRIVER |
DroneCAN driver index, if the module is on CAN instead of serial. |
DID_OPTIONS |
Bitmask; among other things it can require a healthy Remote ID module before arming (see arm gating below). |
With DID_ENABLE=1, ArduPilot sends Location and System (operator location) at a fixed 1 Hz, and Basic ID, Self ID, Operator ID and System in rotation, as individual OPEN_DRONE_ID_* messages. Operator ID, Self ID, System and the operator location come from the ground station; Basic ID from the ground station or the DID_UAS_ID parameters. ArduPilot does not create Authentication messages: a ground station's OPEN_DRONE_ID_AUTHENTICATION reaches the module through ArduPilot's MAVLink routing. ArduPilot also expects the module to talk back; see the status output section.
PX4. Build with the remote_id module included and enable it with UXRCE-independent parameter RID_ENABLE = 1 (PX4's OpenDroneID driver). PX4 streams the same OPEN_DRONE_ID_* MAVLink messages on the configured MAVLink instance; ensure the serial port's MAVLink mode forwards the OpenDroneID stream. PX4 support is less mature than ArduPilot's and may require a recent main build; consult the PX4 OpenDroneID docs for your version.
Either way, this module consumes the standard messages once they are flowing; no module-side change is needed to switch between ArduPilot and PX4 sources.
| Option | Default | Description |
|---|---|---|
Enable MAVLink OpenDroneID input |
Disabled | Enables the MAVLink parser and state producer. |
MAVLink transport |
UART |
Physical link: UART, or USB Serial/JTAG (native USB device) for a companion computer. |
MAVLink UART number |
1 |
ESP32-S3 UART peripheral used for input (UART transport only). This does not imply physical pins. |
MAVLink UART baud rate |
57600 |
UART baud rate. Common values are 57600, 115200, and 921600. |
MAVLink UART RX GPIO |
-1 |
Physical ESP32-S3 pin routed to the selected UART RX signal. Connect this to the flight controller MAVLink TX pin. Must be configured when MAVLink input is enabled. |
MAVLink UART TX GPIO |
-1 |
Optional physical ESP32-S3 pin routed to the selected UART TX signal. Connect this to the flight controller MAVLink RX pin only for bidirectional wiring. Leave as -1 for receive-only. |
Accepted MAVLink target system |
0 |
0 accepts all systems; non-zero accepts that system or broadcast target 0. |
Accepted MAVLink target component |
0 |
0 accepts all components; non-zero accepts that component or broadcast target 0. |
Send HEARTBEAT and OPEN_DRONE_ID_ARM_STATUS |
Disabled | Enables status output back to the flight controller. Requires the TX GPIO. |
Outgoing MAVLink system ID |
0 |
System ID for outgoing messages. 0 adopts the flight controller's system ID from its HEARTBEAT (uses 1 until one is seen). |
Outgoing MAVLink component ID |
236 |
Component ID for outgoing messages. 236-238 are the Open Drone ID transmitter component IDs. |
Status output rate (Hz) |
1 |
HEARTBEAT and ARM_STATUS transmit rate. |
Own the operator-location freshness loop |
Disabled | Aircraft-local operator-location ownership (see below). Requires the TX GPIO. |
Fixed operator-location republish period (ms) |
2000 |
SYSTEM_UPDATE cadence for a fixed operator location (0.5 Hz). |
Live operator-location expiry (ms) |
10000 |
A live operator location whose source timestamp has not advanced within this window is replaced by the take-off point, or dropped when there is none. Applies to MAVLink and DroneCAN input. |
When Send HEARTBEAT and OPEN_DRONE_ID_ARM_STATUS is enabled, the module periodically transmits two messages back to the flight controller (this requires bidirectional UART wiring, i.e. the TX GPIO connected to the flight controller's RX):
HEARTBEATwith component typeMAV_TYPE_ODID, so the flight controller and ground station see the Remote ID module as a live component of the vehicle.OPEN_DRONE_ID_ARM_STATUS, reportingGOOD_TO_ARMonly when a usable identity is present, all enabled transports are running without a reported fault, (for a MAVLink/DroneCAN position source) a new, in-order Location sample with a source time stamp arrived within the last 3 s, and a pilot position or take-off point is available or will be captured at arming. In strict compliance mode that Location must also carry a position, height, time stamp, ground speed and, when moving, a course. OtherwisePRE_ARM_FAIL_GENERICwith the reason (for example "No fresh aircraft location", "Operator ID failed consistency check" or "Remote ID transmitters not running").
This is what lets ArduPilot treat the module as present and healthy. With the relevant DID_OPTIONS bit set, ArduPilot refuses to arm until it receives GOOD_TO_ARM, so the drone cannot take off without a working Remote ID broadcast. The module shares the flight controller's system ID (adopted automatically by default) and uses an Open Drone ID component ID, so the status appears as part of the same vehicle.
OpenDroneID requires the operator location to be refreshed continuously (the autopilot treats a stale operator location as a pre-arm failure). A ground station can do this by streaming OPEN_DRONE_ID_SYSTEM_UPDATE at ~1 Hz, but that ties compliance to the GCS staying connected. With Own the operator-location freshness loop enabled, the firmware keeps the operator location fresh on the aircraft, so the UAS location stays autopilot-owned while the operator location becomes aircraft-local.
The mode is derived from the operator_location_type carried in the last full OPEN_DRONE_ID_SYSTEM message:
| Operator-location type | Firmware behaviour |
|---|---|
FIXED / TAKEOFF |
The firmware republishes OPEN_DRONE_ID_SYSTEM_UPDATE (broadcast target=0/0) at the configured period (0.5 Hz default), with the fixed position and a fresh timestamp, so the autopilot stays compliant even after the GCS disconnects. |
LIVE_GNSS |
The firmware only consumes the GCS's live SYSTEM_UPDATE stream and never republishes it (re-stamping a moving position would falsify freshness). Freshness follows the source timestamp carried in SYSTEM/SYSTEM_UPDATE: only a newer timestamp counts as a refresh, so an autopilot that keeps relaying the last cached packet does not keep the location alive. A timestamp of 0 (unknown time) never counts, so a live position needs a real source timestamp. A position with an older timestamp than the stored one is out of order and ignored. If no newer timestamp arrives within the expiry window (Live operator-location expiry, checked at least every second even when all input stops), the firmware broadcasts the take-off point instead, or no operator position when none was captured; the stale position is not republished. The stored live position keeps its role, and only a newer timestamp (in SYSTEM or SYSTEM_UPDATE) brings it back, so the relayed cache cannot flip it back and forth and a second loss expires it again. A full SYSTEM that switches the role to FIXED or TAKEOFF is accepted even with timestamp 0, since those positions need no freshness; a SYSTEM_UPDATE carries no role and continues the live one. |
When neither a pilot position nor a take-off point is available, ARM_STATUS reports "No pilot or take-off position" (this is part of the shared readiness, the same over DroneCAN).
The republish timestamp (a Unix-2019 epoch) comes from the shared UTC clock, seeded from the bound autopilot's SYSTEM_TIME; until a valid SYSTEM_TIME has been seen, the loop holds off transmitting. Clock provenance differs per input: over MAVLink only the bound autopilot's SYSTEM_TIME (normally GPS time) sets it, over DroneCAN it is seeded once from the System timestamp, which ArduPilot forwards from the ground station (see DroneCAN (ArduPilot)). A GPS-derived clock is therefore not guaranteed on every path. Once seeded, the clock runs on the ESP32 crystal. The same clock stamps the broadcast System and Authentication messages. Without it those timestamps are sent as 0 and a Location without a source timestamp as unknown (0xFFFF); uptime is never broadcast as UTC.
On arm the take-off point of the previous flight is discarded, and the current position is recorded as the new take-off point when the Location is fresh. It is broadcast as the TAKEOFF operator location whenever no source pilot position is available; a supplied pilot position is never overwritten. A SYSTEM without an operator position (latitude and longitude 0, as ArduPilot sends before the ground station provides one) does not erase it, and one with an undeclared classification does not replace the configured EU category and class. The feature requires an outbound MAVLink path (the TX GPIO on the UART transport; inherent on USB Serial/JTAG) and is only available when MAVLink input is enabled.
The MAVLink link can run over a hardware UART or over the ESP32-S3 native USB port.
UART is the default and is the right choice when wiring directly to a flight-controller serial port (DID_MAVPORT). On ESP32-S3 the UART number selects the hardware UART block (UART0, UART1, or UART2); it does not uniquely select board pins. UART signals are routed through the ESP32 GPIO matrix, and many dev boards label only the programming/debug serial pins as RX/TX. Choose GPIOs that are exposed on your board and not already used by USB serial, flash/PSRAM, buttons, LEDs, or strapping functions. Receive-only wiring is enough unless status output is enabled:
Flight controller TX -> ESP32-S3 MAVLink UART RX GPIO
Flight controller GND -> ESP32-S3 GND
(status output also needs: Flight controller RX <- ESP32-S3 MAVLink UART TX GPIO)
USB Serial/JTAG uses the ESP32-S3 built-in USB Serial/JTAG controller on the native USB port (GPIO19/20) as a USB CDC device, so no GPIO wiring is needed and the same single connection carries both directions (including status output). The peer must be a USB host - a companion computer or SBC - which sees the module as a serial device (for example /dev/ttyACM0) that can be fed to mavlink-router, MAVProxy, or any MAVLink endpoint. It does not connect directly to a flight controller's USB port, because that port is itself a USB device.
The ESP32-S3 has a single native USB interface. A dev board's second "USB" port is usually a USB-to-UART bridge that is electrically just UART0.
The native port is shared with logging, so this project disables the secondary console by default (CONFIG_ESP_CONSOLE_SECONDARY_NONE=y in sdkconfig.defaults); logs go to the primary UART0 console instead. This keeps the native USB port free for the MAVLink transport, so no extra configuration is needed - the USB transport works out of the box. If the secondary console is re-enabled on USB Serial/JTAG while this transport is selected, log text would corrupt the MAVLink stream, so the build fails with an explanatory error.
To send logs over the native USB port instead (only when you are not using USB for MAVLink), re-enable a USB console with idf.py menuconfig -> Component config -> ESP System Settings -> Channel for console secondary output -> USB Serial/JTAG Controller (or set the primary console to it under Channel for console output).
The ESP only needs a small set of message IDs, and its serial/USB receive buffer is modest. Feeding it the full vehicle telemetry stream wastes link bandwidth and can overflow the receive buffer under load, which corrupts and intermittently drops OpenDroneID frames (for example, a stale broadcast position even though the source is sending fresh LOCATION). Put a MAVLink filter in front of the ESP so only the messages it consumes are forwarded to it.
With mavlink-router, filter the endpoint's egress (messages sent to the ESP) with AllowMsgIdOut. Note the direction: AllowMsgIdOut limits what the router sends to the ESP, while AllowMsgIdIn limits what the ESP is allowed to inject back into the mesh — only AllowMsgIdOut reduces the ESP's inbound load.
[TcpEndpoint opendroneid] Address = 10.0.40.3 Port = 54321 # Messages forwarded TO the ESP. HEARTBEAT (0) for takeoff capture / system-ID # adoption; SYSTEM_TIME (2) seeds the operator-location loop timestamp; the rest # are the OpenDroneID inputs and the message pack. AllowMsgIdOut = 0,2,12900,12901,12902,12903,12904,12905,12915,12919 # Messages the ESP may send back: its HEARTBEAT and ARM_STATUS. AllowMsgIdIn = 0,12918
Message IDs: 0 HEARTBEAT, 2 SYSTEM_TIME, 12900 BASIC_ID, 12901 LOCATION, 12902 AUTHENTICATION, 12903 SELF_ID, 12904 SYSTEM, 12905 OPERATOR_ID, 12915 MESSAGE_PACK, 12918 ARM_STATUS (ESP output), 12919 SYSTEM_UPDATE. Drop 2 and 12919 if the operator-location loop is not used, and drop 0 only if you do not need takeoff-position capture or system-ID adoption.
DroneCAN is disabled by default. When enabled, the module joins the CAN bus as a DroneCAN node and implements the CAN side of ArduPilot's OpenDroneID support (DID_CANDRIVER), with the standard dronecan.remoteid messages. DroneCAN is the maintained UAVCAN v0-derived protocol; it is distinct from OpenCyphal/UAVCAN v1. The implementation uses ESP-IDF's built-in TWAI driver and needs no extra library.
| Direction | DroneCAN message | Data type ID | Rate | Purpose |
|---|---|---|---|---|
| ArduPilot to module | dronecan.remoteid.BasicID |
20030 |
static rotation | UAS ID, ID type, UA type (ignored in strict mode) |
| ArduPilot to module | dronecan.remoteid.Location |
20031 |
1 Hz | Aircraft position, speeds, status, timestamp |
| ArduPilot to module | dronecan.remoteid.SelfID |
20032 |
static rotation | Self ID |
| ArduPilot to module | dronecan.remoteid.System |
20033 |
1 Hz | Operator location, area, EU category/class, timestamp |
| ArduPilot to module | dronecan.remoteid.OperatorID |
20034 |
static rotation | Operator ID |
| ArduPilot to module | uavcan.equipment.safety.ArmingStatus |
1100 |
2 Hz | Arm state, for the take-off point capture |
| Module to ArduPilot | dronecan.remoteid.ArmStatus |
20035 |
1 Hz | GOOD_TO_ARM or the pre-arm failure text, same as the MAVLink ARM_STATUS |
| Module to bus | uavcan.protocol.NodeStatus |
341 |
1 Hz | Node presence. Health is CRITICAL after a self-test failure, OK otherwise; mode is OPERATIONAL |
| Module to requester | uavcan.protocol.GetNodeInfo response |
1 (service) |
on request | Name com.peinser.remoteid, unique ID from the ESP32 MAC |
These messages carry the MAVLink OPEN_DRONE_ID_* fields with the same units, so both inputs share one conversion and the same validation (see MAVLink OpenDroneID Input). dronecan.remoteid.SecureCommand (64) is not implemented, and DroneCAN has no Authentication message.
Rules applied to DroneCAN input:
- The module binds to the first node that sends a
dronecan.remoteidmessage (the autopilot) and ignores Remote ID data from every other node. - A message with a non-empty
id_or_macdescribes another aircraft and is ignored. - Multi-frame transfers are checked against their transfer CRC; anonymous (node ID 0) transfers are ignored.
- The UTC clock is seeded once from the first non-zero
System.timestamp. ArduPilot sends no other UTC time over DroneCAN, and this value comes from the ground station, in whole seconds. Location timestamps come from ArduPilot's GPS time and are used as sent. - The take-off point is captured from
uavcan.equipment.safety.ArmingStatus(1100), which ArduPilot broadcasts at 2 Hz on every DroneCAN bus: the bound node's disarmed-to-armed transition captures it, like the MAVLinkHEARTBEAT.
- Build or download ArduPilot firmware with the OpenDroneID feature (many boards need a build from the custom firmware build server).
- Set
CAN_P1_DRIVER = 1(or the port the module is on) andCAN_D1_PROTOCOL = 1(DroneCAN), and match the bitrate (CAN_P1_BITRATE, 1 Mbit/s by default). - Set
DID_ENABLE = 1,DID_CANDRIVER = 1(the DroneCAN driver of that bus) andDID_MAVPORT = -1. - To block arming without a healthy Remote ID module, enable the pre-arm option in
DID_OPTIONS. ArduPilot then requires anArmStatuswithin the last 3 s reportingGOOD_TO_ARM, a Basic ID with an ID type, and an operator location. - Supply the Operator ID, Self ID and operator location from the ground station, as for the MAVLink connection. In strict mode ArduPilot's own pre-arm check still wants a Basic ID: set the
DID_UAS_IDparameters to the module's serial so the two agree.
The module's node ID is static (DroneCAN node ID, default 100). It must be unique on the bus; ArduPilot's node allocation server accepts static IDs.
| Option | Default | Description |
|---|---|---|
Enable DroneCAN (ArduPilot OpenDroneID over CAN) |
Disabled | Starts the DroneCAN node. |
DroneCAN RX GPIO |
-1 |
ESP32-S3 GPIO connected to the CAN transceiver RXD output. Must be configured. |
DroneCAN TX GPIO |
-1 |
ESP32-S3 GPIO connected to the CAN transceiver TXD input. Must be configured. |
DroneCAN bitrate |
1 Mbit/s |
CAN bus bitrate. Match the flight controller bus. |
DroneCAN node ID |
100 |
Static node ID, 1 to 125, unique on the bus. |
DroneCAN task stack size |
4096 |
Stack of the receive/transmit task. |
The module transmits on the bus (NodeStatus, ArmStatus, GetNodeInfo responses) and acknowledges frames, so it also works on a two-node bus with only the flight controller.
Basic wiring with an external 3.3 V-compatible CAN transceiver:
ESP32-S3 CAN transceiver Flight controller CAN port
-------- --------------- --------------------------
DroneCAN TX GPIO --------> TXD
DroneCAN RX GPIO <-------- RXD
3V3 ---------- VCC (if using a 3.3 V transceiver/module)
GND ---------- GND ------------------------- GND
CANH ------------------------- CANH / CAN_H / H
CANL ------------------------- CANL / CAN_L / L
Use a CAN transceiver that matches the ESP32-S3 IO voltage on TXD/RXD. The ESP32-S3 GPIOs are 3.3 V logic, so a 5 V CAN transceiver module is only safe if its digital IO side is explicitly 3.3 V compatible. Many bare CAN transceiver boards expose VCC, GND, TXD, RXD, CANH, and CANL; connect CANH/CANL only to the bus, never directly to ESP32 GPIO pins.
DroneCAN is a shared two-wire bus. The bus should be one physical trunk with short stubs to each node:
120 ohm terminator 120 ohm terminator
| |
v v
CANH ===+======================+======================+===============+=== CANH
| | |
| | |
FC CAN port ESP32 CAN transceiver Other DroneCAN node
| | |
CANL ===+======================+======================+===============+=== CANL
Termination rules:
- Install exactly two 120 ohm terminators, one at each physical end of the CANH/CANL trunk.
- Do not add a third terminator on the ESP module if the flight controller and another end-of-bus device already provide termination.
- If the ESP transceiver is physically at one end of the bus, enable or install one 120 ohm terminator at the ESP end and one at the opposite end.
- With power off, a correctly terminated bus normally measures about 60 ohm between
CANHandCANLbecause the two 120 ohm terminators are in parallel. - Keep the ESP transceiver stub short. If possible, place it on the trunk rather than at the end of a long branch.
Before flashing for any actual operation in the EU:
- Enable Strict EU (EASA) compliance mode
- Burn and write-protect the ANSI/CTA-2063-A serial number in eFuse (see Serial number provisioning)
- Set UA type to match your airframe
- Provide the Operator registration ID in its full form with the 3 secret characters, in Kconfig (static identity) or from the ground station (runtime identity)
- Leave EU equipment class as Undeclared if your drone has no CE class label
- Set EU operation category to Open (or your authorised category)
- Connect a live position source (MAVLink or DroneCAN); a fixed takeoff position is for bench testing only
- Enable Secure Boot and flash encryption, and keep OTA disabled or protected (see Strict EU (EASA) compliance mode)
- On the autopilot, enable the Remote ID pre-arm check (ArduPilot
DID_OPTIONS) and the module's status output, so the aircraft cannot take off without a working broadcast - Enable Wi-Fi Beacon (or BLE 5 Long Range / Wi-Fi NAN) for EN 4709-002, and keep BLE 4 legacy advertising enabled (receivable by phones)
- Run and document reception tests with current Android and iOS phones (EN 4709-002 gives no presumption of conformity for this)
Note: BLE and Wi-Fi transports wait for the store readiness gate before transmitting. The gate requires a usable Basic ID/UAS ID and Operator ID, either from Kconfig or from runtime producers such as MAVLink.
For Android app testing, use one transport at a time because many receiver apps do not display whether a detected aircraft came from BLE or Wi-Fi.
- ESP32-S3 board
- ESP-IDF environment, preferably the included devcontainer
- Initialized submodules:
git submodule update --init --recursive
For the optional BLE validation script on macOS:
python3 -m pip install bleak
Open the repository in the devcontainer. The container is based on Espressif's ESP-IDF image and includes idf.py, CMake, Ninja, socat, clang-format, and related firmware tooling.
Common commands inside the devcontainer:
make build make flash make monitor
The default ESP serial device inside the container is /dev/ttyESP32. Override it with ESPPORT if needed:
make flash ESPPORT=/dev/ttyACM0
make host-test compiles the firmware logic for the host against stub ESP-IDF headers (tests/host/stub) and runs the regression tests in tests/host; no hardware or ESP-IDF is needed:
| Test | Covers |
|---|---|
store_test.c (built in normal and strict mode) |
Identity validation (EU operator number check, CTA-2063-A serial, ID types), the operator ID error, pilot position and take-off fallback (expiry, role changes, timestamp rules, arming), aircraft location freshness and sample order (cached replay, unknown time, alternating and cyclic old samples, the hour rollover, long gaps, clock steps), take-off capture only from fresh timed coordinates, strict completeness and readiness. Linked with the real encoder and OpenDroneID core, so every accepted update is also checked for encodability |
selftest_test.c |
Transmit deadlines: a transport that never sends, and one that hangs after a pause |
auth_test.c |
Local Ed25519 signing: the signature from the broadcast pages verifies over the message set and the page 0 timestamp, and fails for another timestamp |
dronecan_test.c / .py |
DroneCAN wire format in both directions against the reference pydronecan package (skipped when it is not installed: pip install dronecan) |
The hardware test against a flashed module is tests/remoteid_test.py.
OpenDroneID BLE reception range is not guaranteed by a fixed distance in the EU documents; practical range depends on transmitter power, receiver hardware, antenna design, enclosure, orientation, and RF environment. This firmware therefore makes BLE advertising TX power explicit and configurable.
The default is +9 dBm, the highest ESP32-S3 BLE level exposed by ESP-IDF:
CONFIG_REMOTEID_BLE_TX_POWER_P9=y
Change it with make menuconfig under ESP Remote ID -> BLE advertising TX power, or by editing sdkconfig.defaults before regenerating sdkconfig. Keep the configured level within the limits of your board, antenna, enclosure, and local RF rules.
Docker on macOS does not expose /dev/cu.* serial devices directly to Linux containers. Use socat to bridge the ESP32-S3 USB serial device from the host into the devcontainer.
On the macOS host:
brew install socat
ls /dev/{cu,tty}.usb*
make bridge-host HOST_SERIAL=/dev/cu.usbmodemXXXXInside the devcontainer, in a second terminal:
make bridge-container
Keep both bridge commands running while flashing or monitoring through /dev/ttyESP32.
After flashing, verify the advertisements from macOS. Pass your configured takeoff coordinates to the --near-lat / --near-lon filters, or omit them to see all OpenDroneID advertisements:
python .dev/scripts/detect-opendroneid-ble.py --timeout 30 # or, to filter by proximity to a known location: python .dev/scripts/detect-opendroneid-ble.py --timeout 30 --near-lat <lat> --near-lon <lon>
Expected output includes app_code=0x0d and message types such as:
type=0 (Basic ID)type=1 (Location)type=4 (System)type=5 (Operator ID)
If the scanner sees valid advertisements but a phone app does not, check that Bluetooth and location permissions are granted and that the app supports BLE legacy Remote ID reception.
Use make menuconfig under ESP Remote ID within the Component config menu to switch transport combinations before building and flashing.
| Test mode | BLE | Wi-Fi Beacon | Wi-Fi NAN | Use case |
|---|---|---|---|---|
| BLE-only | Enabled | Disabled | Disabled | Default Android BLE validation and macOS scanner validation. |
| Wi-Fi Beacon-only | Disabled | Enabled | Disabled | Confirms the receiver can detect Wi-Fi Beacon Remote ID without BLE/NAN ambiguity. |
| Wi-Fi NAN-only | Disabled | Disabled | Enabled | Confirms the receiver can detect Wi-Fi NAN Remote ID without BLE/Beacon ambiguity. |
| Dual Wi-Fi | Disabled | Enabled | Enabled | Tests Beacon and NAN together after each works independently. |
| All transports | Enabled | Enabled | Enabled | Broadcasts all enabled transports after independent validation. |
For Wi-Fi-only testing, flash the firmware and use an Android receiver that supports the specific Wi-Fi transport being tested. If the app does not show a source transport, enable only one Wi-Fi transport at a time so any detection has a known source.
The screenshot below shows the OpenDroneID Android app receiving live advertisements from the module. Current firmware blocks placeholder identifiers (CHANGE_ME_UAS_ID, CHANGE_ME_OP_ID), so replace these with your registration details or provide valid MAVLink OpenDroneID identity before testing reception.
The broadcast can carry ASTM F3411-22a Authentication pages. They come from exactly one source, chosen under ESP Remote ID → Authentication → Authentication message source, so pages of two signatures are never mixed:
| Source | Default | Signing key | What is broadcast |
|---|---|---|---|
| Relay from MAVLink | Yes, when MAVLink input is enabled | With the ground station or autopilot | The pages received in OPEN_DRONE_ID_AUTHENTICATION or a message pack, byte for byte |
| None | When MAVLink input is disabled | None | No Authentication pages |
| Local Ed25519 | No | On this module (Kconfig or NVS) | A message set signature made by this module |
Both transports carry all pages: Wi-Fi in every message pack, BLE in the slots described in BLE schedule with authentication. Skipped pages take no advertising time.
The module stores the pages of one set: a different page 0 starts a new set and drops the pages of the previous one. A set is broadcast once page 0 and every page up to its last_page_index have arrived, and is dropped when page 0 has not been received for 10 s, so a signer that stops is not left on air. Up to 4 pages (64 bytes in page 0 to 3) are supported; larger sets are rejected. DroneCAN has no Authentication message.
Pages 1 and up carry no set identifier in the OpenDroneID protocol, and the module does not hold the signer's key. A late page of a previous set that arrives after a new page 0 therefore cannot be told apart from a page of the new set; only a receiver that verifies the signature can detect it. Signers should send all pages of a set together, page 0 first. Local signing does not have this limitation.
The pages go out exactly as the signer produced them. Whether a receiver can verify them depends on what was signed:
- UAS ID, Operator ID, Network Remote ID and specific-method signatures cover data this module broadcasts unchanged (the Basic ID is copied byte for byte; the Operator ID is the 16 public characters). They verify as relayed.
- A message set signature covers encoded messages. This module re-encodes every message from its own state, adds its own timestamps and schedules Location on its own, so the signature only verifies if the signer signs exactly the messages this module broadcasts. For a verifiable message set signature, use local signing.
The module signs the message set itself, so the signed bytes are the broadcast bytes. For each signature it:
- Takes the five ODID messages as last broadcast, in the order Basic ID, Location, System, Operator ID, Self ID, each in its 25-byte wire format (125 bytes)
- Appends the page 0 timestamp, seconds since 2019-01-01 UTC as a 4-byte little-endian integer (129 bytes in total)
- Signs those bytes with the Ed25519 private key
- Distributes the 64-byte signature across four authentication pages (page 0: 17 bytes + metadata, pages 1 to 3: 23/23/1 bytes), authentication type message set signature
Because the timestamp is signed, a recorded signature cannot be rebroadcast under a fresh timestamp. A verifier rebuilds the same 129 bytes from the received messages and the page 0 timestamp, and checks the signature with the device's public key.
The private key on the device is the leaf key of a standard PKI hierarchy:
Your CA root
└── Device certificate (public key + UAS ID/serial + CA signature)
└── Ed25519 private key (on device, used for signing)
The device certificate binds the public key to the drone's identity (UAS ID, operator, validity period) and is signed by your CA. A web service verifying a broadcast:
- Reads the UAS ID from the BasicID message
- Looks up the device certificate in your registry (keyed by UAS ID)
- Verifies the Ed25519 signature in the auth pages using the certificate's public key
- Verifies the certificate chain back to your CA root
The firmware only needs the private key. The certificate lives in your registry.
- Clock. The timestamp in auth page 0 is seconds since 2019-01-01 UTC from the shared clock, seeded by the autopilot's
SYSTEM_TIME(MAVLink) or the firstSystem.timestamp(DroneCAN). Until then it is 0, and a signed timestamp of 0 gives a verifier nothing to judge freshness by. - Private key security. The key is only as safe as the flash it lives in. Without flash encryption the raw key bytes are readable directly off the chip. See Flash encryption below.
Generate an Ed25519 private key (PKCS#8 PEM format):
openssl genpkey -algorithm ed25519 -out device.pem
Extract the public key:
openssl pkey -in device.pem -pubout -out device_pub.pem openssl pkey -in device.pem -pubout -outform DER | tail -c 32 | xxd -p -c 32
The public key is also logged at INFO level on every startup:
I (312) remoteid_auth: Ed25519 authentication enabled, public key: <64 hex chars>
To generate a CSR for CA signing (replace UAS-ID-HERE with the drone's UAS ID):
openssl req -new -key device.pem -out device.csr \
-subj "/CN=UAS-ID-HERE/O=YourOrganisation"Submit device.csr to your CA. Register the signed certificate in your verification service registry, keyed by UAS ID.
The firmware looks for the private key in this order:
- Compiled-in:
REMOTEID_AUTH_PRIVATE_KEY_PEMin Kconfig/sdkconfig. Used during development; takes priority when set. - NVS: NVS namespace
remoteid_auth, keyprivate_key. Used in production; the flash encryption hardware protects it at rest.
With local signing selected, if neither source has a valid key, the firmware logs an error, reports a Remote ID system failure (broadcast status, ARM_STATUS and the error indicator) and keeps broadcasting unsigned.
Format the private key for Kconfig (one line, \n as separator):
awk 'NF {printf "%s\\n", $0}' device.pemSelect Local Ed25519 and set the key in menuconfig under ESP Remote ID → Authentication, or set directly in sdkconfig:
CONFIG_REMOTEID_AUTH_ED25519=y
CONFIG_REMOTEID_AUTH_PRIVATE_KEY_PEM="-----BEGIN PRIVATE KEY-----\nMC4CAQAwBQYD...\n-----END PRIVATE KEY-----\n"
For local development, generate your own key as shown above and keep it, and any sdkconfig that contains it, out of version control. Never use a development key on a production device.
Leave REMOTEID_AUTH_PRIVATE_KEY_PEM empty in the production build. Provision the key into NVS using the ESP-IDF partition generator before the device is sealed. Follow the procedure below our apply the procedure outlined by your PKI:
-
Generate a per-device key:
openssl genpkey -algorithm ed25519 -out device.pem
-
Provision the key into the device NVS partition before first boot:
make provision-key KEY_FILE=device.pem
or with an explicit port:
python .dev/scripts/provision_key.py device.pem --port /dev/ttyUSB0
The script generates the NVS binary and flashes it in one step. To generate the binary without flashing (e.g. to inspect it or flash it manually later):
python .dev/scripts/provision_key.py device.pem --output nvs.bin parttool.py -p /dev/ttyUSB0 write_partition --partition-name nvs --input nvs.bin
After first boot with flash encryption enabled the NVS partition is encrypted by the hardware and the plaintext binary is no longer accepted.
Flash encryption uses a hardware AES-256 key generated on first boot and stored in eFuse; it never leaves the chip. All flash reads and writes go through the hardware engine transparently; no firmware changes are required.
Enable it in menuconfig under Security features → Enable flash encryption on boot. Choose Development mode during bring-up (allows re-flashing via serial) and Release mode for production units (irreversible; serial flashing is disabled).
Development mode workflow:
idf.py flash # first flash: plaintext, bootloader encrypts on first boot idf.py encrypted-flash # subsequent flashes: pre-encrypt before writing
Production mode workflow: flash the firmware and NVS partition once before sealing. After first boot the device can only be updated via OTA.
Warning: Release mode permanently burns eFuses on first boot that disable serial flashing and JTAG. This cannot be undone without replacing the SoC. A device in Release mode without a working OTA path is unrecoverable.
To prevent accidental enabling, the build will fail if CONFIG_FLASH_ENCRYPTION_MODE_RELEASE is set without an explicit confirmation. In menuconfig, navigate to ESP Remote ID → Flash encryption Release mode confirmation and type UNRECOVERABLE exactly. The build will be blocked until this string is present.
The firmware includes an optional over-the-air management server. When triggered, the device suspends normal Remote ID operation and starts a Wi-Fi access point with a lightweight HTTP server at http://192.168.4.1. The server provides endpoints for firmware updates, NVS key provisioning, factory reset, and OTA rollback.
OTA mode is required for updating sealed production devices that have flash encryption Release mode active (serial flashing is disabled after first boot in Release mode).
Enable in menuconfig under ESP Remote ID → OTA update server:
| Option | Default | Description |
|---|---|---|
Enable OTA update server |
Disabled | Compile and include the OTA server. |
OTA trigger GPIO |
-1 |
GPIO sampled at boot; hold low (button to GND) to enter OTA mode. -1 disables GPIO triggering. |
Always enter OTA mode on boot |
Disabled | Skip the GPIO check and always start the OTA server. Development only. |
OTA Wi-Fi AP SSID |
RemoteID-OTA |
SSID broadcast while OTA mode is active. |
OTA Wi-Fi AP password |
(empty) | WPA2 passphrase (minimum 8 characters). Leave blank for an open AP. |
OTA Wi-Fi AP channel |
6 |
2.4 GHz channel for the OTA access point. |
OTA HTTP server port |
80 |
TCP port for the HTTP management server. |
Wire a momentary push-button between the configured trigger GPIO and GND. Hold the button while resetting the device. The serial log will show:
I (nnn) remoteid_ota: OTA mode triggered (firmware 1.0.0), starting management server
I (nnn) remoteid_ota: OTA server ready on http://192.168.4.1:80, connect to SSID 'RemoteID-OTA' (WPA2)
I (nnn) remoteid_ota: Endpoints: GET /status POST /update POST /nvs POST /factory-reset POST /rollback
Connect to the AP (default SSID RemoteID-OTA) from a laptop or phone.
The steps below cover the full test cycle from first flash through update and rollback. All make commands assume the devcontainer with ESPPORT set and the device connected via the serial bridge.
The OTA partition table must be on the device before the OTA server can function. A standard make flash writes everything required: bootloader, partition table, initial OTA data, and the firmware image into ota_0.
make flash
After boot the device runs normally from ota_0. The ota_1 slot is empty and rollback_possible is false.
In menuconfig under ESP Remote ID → OTA update server:
- Enable Enable OTA update server.
- For bench testing without a physical button, also enable Always enter OTA mode on boot. This skips the GPIO check so every reset drops straight into OTA mode; disable it before deploying.
- For hardware testing, set OTA trigger GPIO to the pin wired to your button and leave Always enter OTA mode disabled.
- Optionally set a WPA2 passphrase under OTA Wi-Fi AP password.
Rebuild and reflash after any menuconfig change:
make flash
If Always enter OTA mode is enabled, reset the device. If using a GPIO trigger, hold the button while pressing reset. Confirm the server is up:
make ota-status
Expected output:
{
"firmware_version": "1.0.0",
"idf_version": "v5.5.4",
"running_partition": "ota_0",
"next_partition": "ota_1",
"rollback_possible": false,
"free_heap": 215340
}Make any change to the firmware (for example, bump the version string in CMakeLists.txt or add a log line), then build and upload:
make ota-flash
make ota-flash builds the firmware, reads build/project_description.json to locate the binary, and streams it to POST /update. The device validates the image and reboots into ota_1 roughly 500 ms after the response is received. The terminal will show the curl response:
{"status":"ok","message":"Update applied, rebooting"}Wait a few seconds for the device to reboot, then enter OTA mode again and query status:
make ota-status
running_partition should now be ota_1 and rollback_possible should be true, confirming the previous slot is intact.
With rollback_possible: true, test rolling back to the previous firmware:
make ota-rollback
The device reboots into ota_0. Query status again to confirm running_partition is back to ota_0 and rollback_possible is now false (the ota_1 slot was marked invalid by the rollback).
Repeating steps 4 and 5 alternates between ota_0 and ota_1 on every successful update. Each update overwrites the slot that is not currently running, so there is always exactly one previous firmware available for rollback after a successful update.
If flash encryption Development mode is active, OTA update images are uploaded in plaintext over Wi-Fi and the OTA subsystem writes them encrypted to flash transparently. No encrypted-flash step is required for OTA updates.
A machine-readable OpenAPI 3.0 specification for all endpoints is available at .dev/ota-openapi.yaml. Import it into any OpenAPI-compatible tool (Swagger UI, Insomnia, Postman, Bruno, etc.) for interactive testing against a live device.
All endpoints accept and return JSON (except POST /update which accepts a raw binary body).
Returns firmware and partition information.
curl http://192.168.4.1/status
# or: make ota-status{
"firmware_version": "1.0.0",
"idf_version": "v5.5.4",
"running_partition": "ota_0",
"next_partition": "ota_1",
"rollback_possible": false,
"free_heap": 215000
}Streams a new firmware binary to the next OTA partition and reboots. The device validates the image before setting the boot partition.
# Using curl directly: curl -X POST http://192.168.4.1/update \ --data-binary @build/remoteid.bin \ -H "Content-Type: application/octet-stream" # Using make (locates the binary automatically from build/project_description.json): make ota-flash # Override target: make ota-flash OTA_HOST=http://192.168.4.1
Writes a value to the device NVS. The primary use case is provisioning a new Ed25519 private key to a sealed device.
# Provision a private key (recommended via the provisioning script): make ota-provision-key KEY_FILE=device.pem # or: python .dev/scripts/provision_key.py device.pem --ota-url http://192.168.4.1 # Manual JSON example (string value): curl -X POST http://192.168.4.1/nvs \ -H "Content-Type: application/json" \ -d '{"namespace":"remoteid_auth","key":"private_key","type":"string","value":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"}' # Binary value (base64-encoded blob): curl -X POST http://192.168.4.1/nvs \ -H "Content-Type: application/json" \ -d '{"namespace":"my_ns","key":"my_key","type":"blob","value":"<base64>"}'
Request body fields:
| Field | Type | Description |
|---|---|---|
namespace |
string | NVS namespace (max 15 characters) |
key |
string | NVS key name (max 15 characters) |
type |
string | "string" or "blob" |
value |
string | Value to store; plain string or base64-encoded bytes for blobs |
Marks the current firmware as invalid and reboots into the previous OTA partition. Requires an explicit confirmation string.
curl -X POST http://192.168.4.1/rollback \
-H "Content-Type: application/json" \
-d '{"confirm":"ROLLBACK"}'
# or: make ota-rollbackReturns HTTP 409 if there is no previous firmware to roll back to.
Erases the NVS partition and reboots. All stored keys and configuration are lost.
curl -X POST http://192.168.4.1/factory-reset \
-H "Content-Type: application/json" \
-d '{"confirm":"FACTORY-RESET"}'
# or: make ota-factory-resetWarning: Factory reset permanently erases the NVS partition. If the device is in Release mode flash encryption and the provisioned private key was the only copy, it is gone. Back up private keys before performing a factory reset.
OTA requires a dual-partition layout. The firmware uses a custom partitions.csv instead of the single-app default:
| Name | Type | Size | Purpose |
|---|---|---|---|
nvs |
data/nvs | 24 KB | NVS key-value store (private key, config) |
otadata |
data/ota | 8 KB | OTA boot slot tracking |
phy_init |
data/phy | 4 KB | RF calibration data |
ota_0 |
app/ota_0 | 2 MB | First firmware slot |
ota_1 |
app/ota_1 | 2 MB | Second firmware slot |
The first flash writes the firmware to ota_0. Subsequent OTA updates alternate between slots. GET /status shows which partition is active and which is next.
- The HTTP server has no authentication beyond the Wi-Fi AP password. Use a strong WPA2 passphrase in any environment with untrusted wireless neighbours.
- Without Secure Boot,
POST /updateinstalls any image, including one with a different UAS serial. For an EU-compliant device enable Secure Boot (OTA images must then be signed) or leave the OTA server out of production builds. - OTA mode is only active while triggered. Normal Remote ID operation resumes after every reboot without the trigger asserted.
- When flash encryption Release mode is active, the OTA server is the only way to update firmware or provisioned secrets after the device is sealed.
- The AP MAC address is randomised on every OTA boot to avoid persistent device identification while in management mode.
BLE 5 Long Range sends the whole message set, authentication pages included, as one Message Pack every slot interval; a local signature covers exactly the messages in that pack.
BLE 4 legacy advertising sends one message per slot in a 9-slot rotation, with the authentication pages (100 ms each) spread between the slots:
Location System Basic ID [auth 0]
Location System Operator ID [auth 1]
Location System Self ID [auth 2] [auth 3]
With the slot interval T (250 ms by default, at most 260 ms), Location and System are sent at least every 3T + 200 ms (980 ms at the maximum), and every other message and the full authentication set every 9T + 400 ms (2.74 s). A local signature is made at the page 0 slot over the most recently broadcast copy of each message; Location and System are not re-encoded for signing, because their timestamps would then differ from what receivers saw. Pages 1 to 3 of that signature follow later in the same cycle.
The GitHub Actions build logic is a reusable workflow in .dev/actions/, meant to be published as the peinser/actions repository (see .dev/actions/README.md). Any ESP-IDF project can then call it:
jobs: firmware: uses: peinser/actions/.github/workflows/esp-remoteid-build.yml@v1 with: idf-version: release-v5.5 target: esp32s3 permissions: contents: read
- Signed OTA, validate firmware binaries against stored public keys before flashing.
