Operations: links, logs, rules and fleets in service · 7 MIN READ
Remote ID: the broadcast message set, a binary teaching format and a validating receiver
State what standard Remote ID broadcasts and how often according to the FAA, and what EASA says the European broadcast carries; encode a simplified message set (identity, position and altitude, velocity, control station, time mark, emergency status) with encoding/binary; and build a receiver that checks freshness, plausibility and missing fields on simulator telemetry.
Remote ID is a drone's digital licence plate: while it flies it broadcasts who it is, where it is and where its control station is, so that people nearby, the authorities and other airspace users can see it. For a developer it is also a small protocol problem: a fixed message set, scaled integers in a few bytes, a strict clock, and a receiver that must decide which frames to believe. This lesson builds both ends with a teaching format, and is explicit about which parts are the regulators' requirements and which are the model's.
drones · A MAP OF THE IDEA
- Encode the message set
- Broadcast at least 1 Hz
- Check age, jumps, gaps
- Show the track and its age
Useful when
- Fixed-size binary structs make encoding short and exact.
- Dropping implausible frames keeps one bad frame out of the track.
Watch out
- This teaching format is not ASTM F3411; real devices differ.
- Plausibility checks do not authenticate the sender.
Implementation & operation cost: A fixed binary layout, a clock synchronised to UTC, and a receiver that keeps each sender's last good position.
What the rules ask for
In the US, drones that are registered or required to be registered must comply with the Remote ID rule, 14 CFR Part 89, in one of three ways: a Standard Remote ID drone, a broadcast module (then the pilot must be able to see the drone throughout the flight), or flying inside an FAA-Recognized Identification Area. The FAA says a Standard Remote ID drone broadcasts from takeoff to shutdown: its ID (serial number, or in future a session ID), its location and altitude, its velocity, the control station's location and elevation, a time mark and its emergency status. A broadcast module sends the take-off location instead of the control station and no emergency status. The rule's performance requirements ask for at least one message per second, position and altitude broadcast no later than 1.0 s after they were measured, positions accurate to within 100 feet with 95 percent probability, and no take-off unless the broadcast works. In the EU, EASA's open-category page says that drones operating in the open category, with limited exceptions, need a remote identification system, and EASA's announcement for 1 January 2024 lists the drone's serial number, the operator registration number, the drone's location and the remote pilot's position, or the take-off point if that is not available.
A teaching format in encoding/binary
The program's format is a model for learning, not ASTM F3411, the standard real Remote ID equipment implements over Bluetooth and Wi-Fi; real devices differ in layout, scaling and message split. Here a frame is a type byte, a 2-byte sender address that plays the part of a radio's MAC address, and a fixed-size body. Identity carries a kind (serial number or session ID) and 20 ASCII bytes. Location carries the time mark in milliseconds after midnight UTC, latitude and longitude in degrees times 10 million, geometric altitude in decimetres, velocity east, north and up in centimetres per second, the control station's position and altitude, and the emergency status, with 0, 0 meaning the station has no position yet. Because every field has a fixed size, binary.Append encodes the struct in one call and binary.Decode reads it back, both since Go 1.23. On real aircraft the autopilot feeds a Remote ID module: PX4 sends it OPEN_DRONE_ID MAVLink messages such as OPEN_DRONE_ID_LOCATION at 1 Hz, and both PX4 and ArduPilot can refuse to arm when the module reports a problem.
A receiver decides what to believe
Anything can arrive over a broadcast: delayed frames, corrupted ones, nonsense. A receiver keeps a track per sender with the last position it accepted, and checks each location frame against it. Freshness compares the time mark with the receiver's own clock, synchronised to UTC from GNSS or the network: a position measured more than about a second ago, the latency the FAA allows, is dropped rather than drawn. Rate compares the gap since the last frame with one second. Plausibility divides the distance from the last accepted position by the time between the time marks: faster than the aircraft can fly, here 45 m/s, about the 100 mph that Part 107 allows, and the frame is dropped while the track keeps its last good position, so one bad frame cannot drag the track two kilometres away and back. Missing fields are reported as a list that shrinks as identity and station position arrive, and the emergency status is reported whenever it changes.
Broadcast from the simulator, receive with faults
The drone takes off to 40 m and flies towards a point 199 m away, beyond its 150 m control link, so the link-loss failsafe brings it home. Once a second the program builds a location frame from the drone's telemetry, around a home at 47.3977419, 8.5456320 and 488 m, and every third second puts the identity frame ahead of it; while the control link is down it sets the emergency status to 1. The receiver starts listening at 1 s, the operator's phone has no position for the first 4 s, and three faults are injected on the way: a 3 s old frame delivered late at 25 s, a position corrupted by 2 km at 50 s, and a fade from 60 to 62 s.
package main
import (
"cmp"
"encoding/binary"
"fmt"
"log"
"math"
"strings"
"gopherforge.app/drone"
)
// A TEACHING FORMAT, not ASTM F3411 or any certified Remote ID encoding. It carries the
// elements the FAA lists for standard Remote ID: identity, position and geometric altitude,
// velocity, control station position and altitude, a time mark and an emergency status. A frame
// is a type byte, a 2-byte sender address (a radio's MAC address does this) and a fixed-size body.
const TypeIdentity, TypeLocation = 1, 2
type Identity struct {
Kind uint8 // 1 serial number, 2 session ID
ID [20]byte // ASCII, zero padded
}
type Location struct {
TimeMs uint32 // time mark: when the position was measured, ms after 00:00 UTC
Lat, Lon int32 // degrees x 1e7
AltDm int16 // geometric altitude, decimetres
VE, VN, VU int16 // velocity east, north, up, cm/s
StnLat, StnLon int32 // control station; 0, 0 while it has no position
StnAltDm int16
Emergency uint8 // 0 none, 1 lost link
}
func Encode(kind uint8, sender uint16, body any) []byte {
b, err := binary.Append(binary.LittleEndian.AppendUint16([]byte{kind}, sender), binary.LittleEndian, body)
if err != nil {
log.Fatal(err)
}
return b
}
const (
lat0, lon0, elev = 47.3977419, 8.5456320, 488.0 // home, and its height
earth = 6378137.0 // m
day0 = 36000000 // 10:00:00 UTC in ms, when the simulation starts
maxSpeed = 45.0 // m/s, about 100 mph
)
func toLatLon(p drone.Vec3) (int32, int32) {
lat := lat0 + p.Y/earth*180/math.Pi
lon := lon0 + p.X/(earth*math.Cos(lat0*math.Pi/180))*180/math.Pi
return int32(math.Round(lat * 1e7)), int32(math.Round(lon * 1e7))
}
// metres between two encoded positions, on a local flat plane
func metres(aLat, aLon, bLat, bLon int32) float64 {
n := float64(bLat-aLat) / 1e7 * math.Pi / 180 * earth
e := float64(bLon-aLon) / 1e7 * math.Pi / 180 * earth * math.Cos(lat0*math.Pi/180)
return math.Hypot(n, e)
}
// Track is what a receiver knows about one sender.
type Track struct {
ID string
Loc Location // the last location accepted
Missing string // fields not received yet
HeardAt float64 // receiver time of the last location frame
Accepted, Dropped int
}
func (t *Track) warn(now float64, format string, args ...any) {
fmt.Printf(" %5.1f s %-16s %s\n", now, t.ID, fmt.Sprintf(format, args...))
}
// Receive validates a frame: freshness against the receiver's own clock,
// plausibility against the last accepted position, and missing fields.
func Receive(tracks map[uint16]*Track, now float64, f []byte) {
sender := binary.LittleEndian.Uint16(f[1:3])
t := tracks[sender]
if t == nil {
t = &Track{HeardAt: now}
tracks[sender] = t
}
if f[0] == TypeIdentity {
var id Identity
if _, err := binary.Decode(f[3:], binary.LittleEndian, &id); err == nil {
t.ID = strings.TrimRight(string(id.ID[:]), "\x00")
}
return
}
var l Location
if _, err := binary.Decode(f[3:], binary.LittleEndian, &l); f[0] != TypeLocation || err != nil {
return
}
if gap := now - t.HeardAt; gap > 1.5 {
t.warn(now, "no location for %.1f s, under 1 per second", gap)
}
t.HeardAt = now
if age := float64(day0+int64(math.Round(now*1000))-int64(l.TimeMs)) / 1000; age > 1 {
t.Dropped++
t.warn(now, "stale: measured %.1f s ago; dropped", age)
return
}
if t.Accepted > 0 {
dt := float64(l.TimeMs-t.Loc.TimeMs) / 1000
if d := metres(t.Loc.Lat, t.Loc.Lon, l.Lat, l.Lon); d/dt > maxSpeed {
t.Dropped++
t.warn(now, "moved %.0f m in %.1f s, %.0f m/s; dropped", d, dt, d/dt)
return
}
}
var missing []string
if t.ID == "" {
missing = append(missing, "identity")
}
if l.StnLat == 0 && l.StnLon == 0 {
missing = append(missing, "control station position")
}
if m := strings.Join(missing, ", "); m != t.Missing {
t.Missing = m
t.warn(now, "missing: %s", cmp.Or(m, "nothing now"))
}
if l.Emergency != t.Loc.Emergency {
t.warn(now, "emergency status %d (0 none, 1 lost link)", l.Emergency)
}
t.Loc = l
t.Accepted++
}
func main() {
sim := drone.New(drone.Config{LinkRange: 150, Wind: drone.Vec3{X: 2, Y: -1}, Gust: 1, MaxSpeed: 8, Seed: 7})
d := sim.Drone()
if err := d.Arm(); err != nil {
log.Fatal(err)
}
d.TakeOff(40)
id := Identity{Kind: 1}
copy(id.ID[:], "GF-1581F4A7C2D90")
const me = 0x0B17 // this drone's sender address
tracks := map[uint16]*Track{}
var history [][]byte
sent, out := 0, false
for k := 0; k == 0 || !d.State().Landed; k++ { // one broadcast per second
now, tel := sim.Time(), d.Telemetry()
loc := Location{TimeMs: uint32(day0 + math.Round(tel.Time*1000)), AltDm: int16(math.Round((elev + tel.GPS.Z) * 10)),
VE: int16(tel.Velocity.X * 100), VN: int16(tel.Velocity.Y * 100), VU: int16(tel.Velocity.Z * 100), StnAltDm: (elev + 1.5) * 10}
loc.Lat, loc.Lon = toLatLon(tel.GPS)
if k >= 4 { // the operator's phone needs a few seconds for a fix
loc.StnLat, loc.StnLon = toLatLon(drone.Vec3{X: -3, Y: -2})
}
if !d.Link() {
loc.Emergency = 1
}
frames := [][]byte{Encode(TypeLocation, me, &loc)}
history = append(history, frames[0])
if k%3 == 0 { // the identity never changes: every 3 s, ahead of the location
frames = append([][]byte{Encode(TypeIdentity, me, &id)}, frames...)
}
sent += len(frames)
if k == 1 {
fmt.Printf("location frame, %d bytes:\n % x\n", len(history[1]), history[1])
fmt.Printf(" time %d ms, %.7f, %.7f, %.1f m, velocity %d %d %d cm/s, emergency %d\nreceiver\n",
loc.TimeMs, float64(loc.Lat)/1e7, float64(loc.Lon)/1e7, float64(loc.AltDm)/10, loc.VE, loc.VN, loc.VU, loc.Emergency)
}
switch {
case k == 0: // the receiver starts listening at 1 s
frames = nil
case k == 25: // a frame from 3 s ago arrives late, ahead of the current one
frames = append([][]byte{history[k-3]}, frames...)
case k == 50: // a corrupted position, 2 km off
bad := loc
bad.Lat += 180000
frames[len(frames)-1] = Encode(TypeLocation, me, &bad)
case k >= 60 && k < 63: // a fade: nothing arrives
frames = nil
}
for _, f := range frames {
Receive(tracks, now, f)
}
if t := tracks[me]; k%20 == 0 && k > 0 {
l := t.Loc
fmt.Printf(" %5.1f s %-16s %.7f, %.7f, %.1f m, %.1f m/s, pilot %.0f m away\n", now, t.ID, float64(l.Lat)/1e7, float64(l.Lon)/1e7,
float64(l.AltDm)/10, math.Hypot(float64(l.VE), float64(l.VN))/100, metres(l.Lat, l.Lon, l.StnLat, l.StnLon))
}
sim.Run(1, func(float64) {
if d.Arrived() && !out {
out = true
d.GoTo(drone.Vec3{X: 60, Y: 190, Z: 40}) // beyond the 150 m control link
}
})
}
t := tracks[me]
fmt.Printf("frames sent %d; locations accepted %d, dropped %d\n", sent, t.Accepted, t.Dropped)
if err := sim.Save(); err != nil {
log.Fatal(err)
}
}The location frame of 1 s is 34 bytes: 02 is the type, 17 0b the sender 0x0B17 little-endian, e8 54 25 02 the time mark 36001000 ms, then latitude 47.3977456 and longitude 8.5456223 times 1e7, 22 13 for 489.8 m, velocity -3, 0 and 266 cm/s on the climb, eight zero bytes for a control station without a position, 1f 13 for its 489.5 m, and emergency 0. At 1.0 s the receiver reports both the identity and the control station position missing; the identity arrives at 3.0 s and the station's fix at 4.0 s, when nothing is missing any more. At 25.0 s a frame measured 3.0 s ago is dropped as stale. At 36.0 s the emergency status becomes 1: the drone is beyond its control link and says so, while its own ground station sees nothing; it returns to 0 at 48.0 s. At 50.0 s a jump of 1995 m in 1.0 s is dropped, and the fade shows at 63.0 s as no location for 4.0 s. The status lines put the pilot 34 m away at 20 s, 193 m at 40 s and 3 m at 80 s. 119 frames were sent; 84 locations were accepted and 2 dropped.
Privacy, trust and limits
Remote ID is a public broadcast by design, and the rules limit what the public learns from it. The FAA keeps the link between a serial number or session ID and the registration database to itself, available to law enforcement on request; EASA says anyone can read the broadcast with a smartphone app, but only enforcement authorities can associate the operator registration number with a name. A receiver should show what it heard, how old it is and what it dropped, and leave identification to them. The plausibility checks catch errors and crude spoofing, but they do not authenticate anyone: a careful forger can send frames that pass them. Treat a track as a claim. For operators, Remote ID is a preflight item: verify that the module works and that the control station has its position before take-off, and never fly with a broadcast you know is wrong.
Fly it in GopherForge
In GopherForge choose New project > Robotics and simulation > Drone flight, replace main.go with this program and keep mission.go, then tap Run. The console shows the encoded frame and everything the receiver reported; Output replays flight.gfflight with the drone crossing the dashed 150 m link circle, turning back when the link-loss failsafe fires and landing at home. Move the faults, lower maxSpeed to 10 m/s, or send the identity every 10 s, and watch which checks fire.
TAKE THIS WITH YOU
Standard Remote ID broadcasts identity, position, altitude, velocity, the control station, a time mark and an emergency status at least once a second, from take-off to shutdown. Fixed-size structs make a teaching format short with encoding/binary; a receiver should drop stale and implausible frames, keep the last good position, report missing fields, and treat every track as an unauthenticated claim.
Check your understanding
A Remote ID receiver gets a location frame whose time mark is 3 s older than its own UTC clock. What should it do with it?
Go to the source
Progress stays in this browser. No account needed.