ARSDK3 as observed
Sources: pyparrot wifiConnection.py, DroneSensorParser.py, the XML in
pyparrot/commandsandsensors/, and first-contact traffic.
Discovery and handshake
Section titled “Discovery and handshake”- mDNS service
_arsdk-090c._udp.local.(product id0x090c= Bebop 2;0901Bebop 1,0914Anafi,090eDisco). - Fixed address works without mDNS: TCP
192.168.42.1:44444. - Controller sends JSON:
d2c_port(43210 in pyparrot),controller_type,controller_name,arstream2_client_stream_port55004,arstream2_client_control_port55005. - Drone replies JSON terminated by NUL, with
status(0 = accepted) andc2d_port. A second controller is accepted, not refused: the drone redirects its telemetry to the newcomer and the first session is starved while still reporting itself connected. Measured 2026-10-02; seenetwork.md. Thestatusfield exists and can be non-zero, but “already taken” is not what it means here.
Framing (UDP)
Section titled “Framing (UDP)”- Header
<BBBI: data type, buffer id, sequence, total size including the 7-byte header. Several frames may share a datagram. - Data types: 1 ACK, 2 DATA, 3 LOW_LATENCY, 4 DATA_WITH_ACK.
- Buffers, controller to drone: 10 no-ack (piloting), 11 with-ack, 12 high priority (emergency), 13 video ack.
- Buffers, drone to controller: 0 ping, 126 data no-ack, 127 data with ack, 125 video.
- Ack for buffer N goes on buffer N+128, payload is the acked sequence byte.
- Pong goes on buffer 1 echoing the ping payload.
- Command payload
<BBH: project, class, command id; then arguments.
Argument encoding
Section titled “Argument encoding”- u8/i8/u16/i16/u32/i32/u64/i64/float/double little-endian.
- enum: i32 (pyparrot upstream read 1 byte).
- string: NUL-terminated UTF-8.
- List events carry
list_flagson newer messages: 0x01 first, 0x02 last, 0x04 empty (ignore other args), 0x08 remove.
Ids seen
Section titled “Ids seen”| Command | Tuple |
|---|---|
| common.Common.AllStates | (0, 4, 0) |
| common.Settings.AllSettings | (0, 2, 0) |
| ardrone3.Piloting.TakeOff | (1, 0, 1) |
| ardrone3.Piloting.PCMD | (1, 0, 2) |
Conventions in values
Section titled “Conventions in values”- 500.0 means “no position” for latitude, longitude and altitude.
- Speeds are NED: +X north, +Y east, +Z down.
- Attitude in radians; camera orientation in degrees.
- XML
supportfield:dronesmeans every drone; otherwise product ids with optional minimum firmware (090c:4.0.0). - Some events marked for other products are still sent by the Bebop 2
(
ConnectedAccessories,AlertSound).
Video (ARStream2), confirmed on the live unit
Section titled “Video (ARStream2), confirmed on the live unit”Firmware 4.7.1 does not serve RTSP: 192.168.42.1:554 refuses the
connection, and rtsp appears nowhere in the rootfs. pyparrot’s
DroneVision uses rtsp://192.168.42.1/live, which is older-firmware only.
It uses ARStream2 instead: plain RTP/H.264 pushed to the port the controller named in the handshake. There is no URL; the client describes its own port in an SDP file and binds it.
- Enable:
ardrone3.MediaStreaming.VideoEnable= (1, 21, 0), oneu8arg. - Drone sends from
192.168.42.1:5004to the controller’sarstream2_client_stream_port(55004 as pyparrot declares it); control is 5005 to 55005. The drone’s own ports are in its handshake JSON ("arstream2_server_stream_port": 5004). - RTP payload type 96, H.264 at 90 kHz.
- Measured: 2401 packets / 2.05 MB in 6 s; a 12 s recording gave 343 frames,
856x480, about 30 fps, 2.5 Mbit/s. 856x480 matches the
rec1080_stream480setting, so the stream is the 480p leg. - The stream only flows while a controller is connected, and stops when the
link drops.
bebop-2 videodisables it again on exit, as we found it.
Joining mid-stream, the first frames reference parameter sets that have not arrived yet, so ffmpeg logs “non-existing PPS 0 referenced” a few times and then recovers. Discard the first seconds rather than treating it as an error. The parameter sets therefore recur throughout the stream rather than appearing only at the start, which is the property that makes a late join recover at all.
What the NAL-type counts do and do not say
Section titled “What the NAL-type counts do and do not say”Over those 6 s the outer NAL header byte of each packet was: type 24 (STAP-A) 1461, type 28 (FU-A) 740, type 1 (non-IDR single NAL) 200.
Read that as outer types only. For a FU-A packet the carried type lives in the next byte and was never examined, so we do not know whether the stream contains IDR frames: a keyframe at 856x480 would be fragmented and would be counted in the 740. Any claim either way needs a capture re-read, which is one pass over the FU-A payloads’ second byte.
The counts also raise a question the measurement cannot answer. 1461 STAP-A over roughly 180 frames is about eight per frame, and parameter sets alone cannot account for that — a repeating SPS/PPS pair is one small packet. Either the aircraft wraps most NALs in STAP-A regardless of size, or it uses several slices per picture and aggregates them. Deciding needs a capture.
Noted while building the simulator’s video path 2026-10-02: an RFC 6184 packetiser reproduces the format faithfully and the packet mix not at all, so a client tested only against the synthetic path is tested against a stream with a different shape to the aircraft’s. That is why the simulator also takes a recorded stream and replays it packet for packet.
The stream has no keyframes at all (measured 2026-10-02)
Section titled “The stream has no keyframes at all (measured 2026-10-02)”From a raw capture of 6641 packets / 5.69 MB over 18 s, unwrapping FU-A fragments and walking the NALs inside each STAP-A, which is the step an earlier reading of this stream skipped:
| outer packet type | count | actual NAL type | count | |
|---|---|---|---|---|
| 24 STAP-A | 3639 | 1 non-IDR slice | 17631 | |
| 28 FU-A | 2728 | 6 SEI | 540 | |
| 1 single slice | 274 | 7 SPS / 8 PPS | 18 / 18 | |
| 5 IDR slice | 0 |
There is not one IDR frame in 18 seconds. 540 SEI over 18 s is one per frame at 30 fps, so about 540 pictures carrying 17631 slices: roughly 33 slices per picture. SPS and PPS repeat once per second.
That shape is slice-based intra refresh. Instead of periodic keyframes the encoder renews a moving band of slices so every region is refreshed over a cycle, which is a deliberate choice for a low-latency link: a keyframe is a bandwidth spike, and a spike on a congested Wi-Fi link is a dropout.
Consequences for anyone decoding this:
- There is no clean entry point, and waiting for one waits forever. A
decoder must start on a non-IDR slice and tolerate broken output until the
refresh cycle completes. ffmpeg logging
non-existing PPS 0 referenceda few times and then recovering is that cycle passing, not a keyframe arriving. - A stateless V4L2 decoder that expects an IDR before emitting anything will emit nothing. That is the case to test deliberately.
- It also explains the packet mix: 33 slices per picture is why STAP-A dominates, which repeated parameter sets never could.
An earlier note reported only outer packet types and was read, reasonably, as
evidence about keyframes. It was not: the outer byte of a FU-A packet describes
the fragmentation, and any IDR would have been hiding exactly there. The
conclusion is the same but it is now measured rather than guessed. See
lessons.md.
Acknowledgement: trust the data type, not the buffer name
Section titled “Acknowledgement: trust the data type, not the buffer name”Found 2026-10-02 while bringing up mcbebop against the live aircraft, after a
tap counted every inbound frame by (data_type, buffer_id):
type=2 (DATA) buffer=127 169 framestype=4 (DATA_WITH_ACK) buffer=126 46 framesThe convention, which pyparrot’s constants also state, is that buffer 126
is the drone’s non-acknowledged data buffer and 127 its acknowledged one.
A live Bebop 2 on 4.7.1 does the opposite: plain DATA arrives on 127 and
DATA_WITH_ACK on 126.
So the data type is authoritative and the buffer id is only a label. Any
inbound frame of type DATA_WITH_ACK must be acknowledged on
(buffer_id + 128) % 256, whichever buffer it came in on. pyparrot gets this
right by accident: it dispatches on data type and keeps both buffers in one
data_buffers tuple, so its own misleading constant names never matter.
Requiring both to agree looks correct and fails quietly. Nothing errors; the drone simply retransmits state it never hears acknowledged and does not move on. Measured cost on this aircraft: 35 telemetry keys instead of 192, and a connect taking 4.1 s instead of 1.7 s, with sensor health, motor state and alert state among the values that never arrived.
Argument-less events, and the end of a state dump
Section titled “Argument-less events, and the end of a state dump”Eight events carry no arguments at all, so their arrival is the entire
message. Keyed strictly as <Command>_<arg> they decode to an empty dict and
vanish. They are, in both files: AllSettingsChanged, ResetChanged,
AllStatesChanged, OverHeatChanged, StartingErrorEvent, SpeedBridleEvent,
AllWifiScanChanged, AllWifiAuthChannelChanged. Record them under the bare
command name, which is how our earlier captures keyed them.
Two of those matter operationally: AllStatesChanged and
AllSettingsChanged are how the drone says a dump is complete. That is the
honest finish condition after Common.AllStates / Settings.AllSettings.
Waiting for a quiet link instead does not work, because the drone streams
attitude, speed and altitude at about 5 Hz the whole time, so the link is never
quiet and the wait always expires on its timeout holding a partial burst.
Unacknowledged commands, and how to tell they worked
Section titled “Unacknowledged commands, and how to tell they worked”15 commands travel on the unacknowledged buffer, including all the piloting
and camera ones (Piloting.PCMD, Camera.Orientation, Camera.OrientationV2,
Camera.Velocity). The drone never replies to them, so there is no ack to
wait for and nothing to retry. A client reporting acked: false for one of
these is reporting normal behaviour, not a failure, and should say so.
What does work is the drone’s own echo. After
ardrone3.Camera.OrientationV2(tilt=15, pan=0) the aircraft reported
OrientationV2_tilt = 14.999999 about a second later, and -13 likewise.
So the confirmation is a state read, not an ack, and it has to be given
time: reading immediately after the send returns the previous value and
makes a command that worked look like one that did not. Confirmed on the live
unit 2026-10-02.
Camera limits this aircraft reports (CameraSettingsChanged): FOV 78°,
pan −35° to +35°, tilt −83° to +17°, default tilt −13°. The virtual gimbal is
a crop of the fisheye, so tilting costs nothing mechanically.
The ulogcat CKCM log format (ckcm.bin)
Section titled “The ulogcat CKCM log format (ckcm.bin)”Not ARSDK, but it is the other wire format this aircraft writes, and reading
internal_000/Debug/current/ckcm/ckcm.bin needs it. This is Parrot’s own
format, not reverse-engineered: the authority is
ulogcat/libulogcat_ckcm.c in Parrot-Developers/ulog,
at the commit before cec8877 (2017-10-12, “major overhaul to get rid of
obsolete features”) which deleted the CKCM renderer from master. That is why
searching the current repo finds nothing. The file itself says in a comment
that it copies its constants because the real CKCM headers were never
published, so there is no primary spec for CKCM; the renderer is as close as
it gets. CKCM is unrelated to camera calibration — a 2005 Parrot forum post
calls it the Car Kit Control Module, their Bluetooth-handsfree-era PC debug
tool, which fits the UART_RT_* constant names.
Confirmed as the code this unit ran: rootfs/usr/lib/libulogcat.so in the
4.7.1 image contains the literal CCCEWIID, which is the cprio[8] table
from that source byte for byte, and rootfs/usr/bin/ulogcat’s usage text
lists the same format set (short aligned process long csv binary ckcm). The
producer is rootfs/usr/bin/ckcm_log.sh, which runs ulogcat -uk -v ckcm > $CKCM_FILE. The tag is ckcm because that is the running process; it is the
log’s own name for itself.
Independently derived from a 560 KB sample off this aircraft and verified across all of it: 5520 entries, every header consumed to the byte, no residue and no resyncs.
frame := D5 E6 <kind:u8> <body> E5 F6
header (kind E7) := opt:u8 priority:u8 [colour:3 if opt&01] stamp:u64le tid:i32le [tname:pstr if opt&20] [tag:pstr if opt&40]
data (kind 02) := pstrdata (kind 24) := colour:3 02 pstrdata (other) := raw bytes, a ulog_bin entryOne log entry is two frames written back to back in a single write(): a
header frame then the data frame carrying its message. There is no file header
and no rotation framing; the file is the raw concatenation. pstr is one
length byte then that many bytes, and messages are truncated to 255 bytes by
the renderer (len = (len <= 255) ? len : 255).
The opt bitmask is COLOR=0x01, PC=0x02, DATE=0x04, TID=0x08, TPRIO=0x10, TNAME=0x20, LAYERNAME=0x40. DATE and TID are written unconditionally, so
0x0c is always set. PC and TPRIO are never written by this renderer, so
no public source says how wide they are; a reader should refuse a header that
sets one rather than guess, because an unread field makes every field after it
wrong.
Four things that matter when reading one:
- Priority is a single ASCII letter and it is lossy.
cprio[]maps EMERG, ALERT and CRIT all toC, and NOTICE and INFO both toI, with a FIXME saying the CKCM tooling does not know NOTICE. So a notice cannot be told from an info, and offering a “notice” filter would offer one that can never match. Letters seen in the sample: I 3836, E 811, W 659, D 214. stampis microseconds, and on this firmware it is monotonic since boot. Which clock the ulogger driver uses changed upstream on 2017-10-02 and the firmware’s build date brackets that change without settling it, so the question was decided from the data instead: userspace stamps top out around 2067 s rather than 1.7e9, and 779ARlibsmessages carry libARSAL’s own uptime stamp in their text, agreeing to a constant 8 ms. There is no wall clock anywhere in the file.struct ulog_entrystill commentstv_secas “seconds since Epoch”; that comment was never updated and should not be trusted. Kernel entries carry the printk uptime, the same clock, but merged in from/proc/kmsgand so landing a few milliseconds out of order against the userspace stream (one inversion in 5520 entries).- There is no pid field. Only
tidis stored, and the process name is smuggled intotnameasprocess/threadwhentid != pid, baretnamewhen they are equal. So a/is the only signal that an entry came from a named thread rather than a process main, and the pid itself is simply absent. - Tags are raw.
-lis not passed, so there is noU:/K:label andtag == "KERNEL"is the only way to tell a kernel entry from a userspace one.kmsgd_fix_entry()sets that tag along withpid = tid = 0.
The colour bytes are RGB and the drone really does colour its output: 23 of
the 5520 sample entries carry them, all from the camera and ISP code, white
for ulogcat’s own banner lines and oranges and yellows for the rest. The data
frame clamps each channel to a minimum of 1, which is why a header colour of
ff d0 00 arrives as ff d0 01 in the message frame. The header’s value is
the true one.
Two robustness properties are not optional. The markers are not escaped, so a parser must drive off the length prefixes and use the end marker only to check them; and a ulog_bin data frame has no kind, no length and so nothing to check, which makes it indistinguishable from corruption. The way out is that a data frame only ever follows a header, so an unreadable frame is only read as a binary payload there and treated as damage anywhere else. The log is also live — the sample grew from 445 KB to 560 KB inside a minute — so a fetch landing mid-record is the normal case and has to end a parse quietly.
COMMANDS is firmware-internal naming, not resolvable to the XML
Section titled “COMMANDS is firmware-internal naming, not resolvable to the XML”Worth settling because the tag looks like an ARSDK trace and is the largest
userspace tag in the sample (1561 of 5520 entries). It is not: the entries are
prose from the drone’s own command handler, and no numeric project/class/
command id appears anywhere in the log. 219 of those 1561 lines carry a
COMMANDS_<Project>_<Symbol> C function name, with 11 distinct symbols, and
matching them against arsdk-xml by name resolves 4 of the 11, covering 54
lines, 3.5% of the tag:
ardrone3.PilotingSettings.MaxDistance COMMANDS_ARDrone3_SettingsSendMaxDistanceardrone3.PilotingSettings.NoFlyOverMaxDistance COMMANDS_ARDrone3_SettingsSendNoFlyOverMaxDistancecommon.Settings.AutoCountry COMMANDS_Common_SettingsSendAutoCountryardrone3.SettingsState.MotorErrorStateChanged COMMANDS_ARDrone3_SendSettingsStateMotorErrorStateChangedThe seven that do not resolve fail for four distinct reasons, which is what
makes this a naming difference rather than a missing rule: SendFlyingState
against an XML command called FlyingStateChanged; SendSettingsStateMotor
FlightInfoChanged against nothing at all (the nearest is
MotorFlightsStatusChanged, and the log line carries four argument values
where that command declares three); SendSettingsStatMotorSoftwareVersion
Changed, a typo for State in the firmware; Common_SettingsSendOutdoor,
where the XML puts Outdoor under ardrone3, not common; and
CommonStateAnyChangedCallback and WifiDefaultCallback, which are internal
callbacks and not commands. Inference, on 11 symbols from one capture: the
firmware’s names predate or diverge from the published XML, so a resolver
built on them would be a guess that reads as a fact. mcbebop deliberately does
not resolve them, and says so where a caller would ask.
The drone’s own log is an oracle for client correctness
Section titled “The drone’s own log is an oracle for client correctness”A use for read_log worth knowing: the aircraft reports, in its own words,
when a controller fails to acknowledge it. That turns the log into an
independent check on a client’s acking, which is otherwise hard to test because
the failure is silent from the client’s side.
The lines to look for are from ARlibs:
ARNETWORK_Sender_ProcessBufferToSend:405 - Timeout waiting for ack in buffer 126ARNETWORK_Sender_ProcessBufferToSend:421 - Will retry sending data of buffer 126ARNETWORK_Sender_TimeOutCallback:661 - Did timeout sending command : project = 1 | class = 1F | command = 0COMMANDS: Setting ACK timeout / Setting cmd : CANCELOur client, measured
Section titled “Our client, measured”Fetched the log, connected for 25 s, fetched again. The log advanced 28 s and took 1434 frames to our session with 192 telemetry keys, and the ack-timeout count was 79 before and 79 after: zero new. So the fix recorded above (ack on data type alone, never on buffer id) is confirmed by the drone rather than only by our own tests.
This is the check to run after any change to the receive path. It costs two FTP fetches and needs no debug shell.
Where the 79 came from
Section titled “Where the 79 came from”All 79 fall inside the first ~564 s of this boot and stop there; nothing since, across several of our sessions. That window is when FreeFlight Pro held the link and was then force-stopped, which gives a controller that vanishes without disconnecting. The drone kept trying to deliver acknowledged data to an address that had gone, retrying each frame several times before cancelling.
So the likely reading is not that Parrot’s own app fails to ack, but that an
abruptly vanished controller produces exactly the same log signature as a broken
one. Worth knowing before concluding anything from these lines: check whether
the controller was still there. The retry pattern, several Will retry per
Timeout followed by Setting cmd : CANCEL, is also a useful picture of how
long the drone persists before giving up on a lost controller.
The drone emits two conflicting battery values
Section titled “The drone emits two conflicting battery values”Found 2026-10-02 after our client reported 0% on an aircraft that was plainly
not flat. The aircraft genuinely sends common.CommonState.BatteryStateChanged
(ids 0-5-1) twice, with different values, on different buffers:
type=4 buffer=126 payload 00 05 01 00 40 -> 64type=4 buffer=127 payload 00 05 01 00 00 -> 0 (repeatedly)Our decode is correct in both cases; the payloads really do differ. The 64 is
the true figure: the drone’s own log carries BEHAVIOUR_COLIBRY: Battery percentage : 64 and COMMANDS: Cmd Tx : battery level <64%>, and the series
declines smoothly 73, 72, 71 … 64 over an hour of uptime, which is what real
discharge looks like.
The zeros appear nowhere in the drone’s log. Every Cmd Tx : battery level
line says 64%; nothing logs a transmission of 0. So one component reports the
battery and is logged, while something else emits the same command id with 0 and
is not.
A candidate worth testing rather than believing: this airframe runs flird and
reports SDK_send_thermal_cam_state 1 despite having no FLIR
(feature.flir: -1), failing repeatedly with ENOTCONN. A phantom accessory
reporting a battery level of 0 would fit the shape of this. Unconfirmed. Q.
Why it matters, and why last-writer-wins is the wrong rule here
Section titled “Why it matters, and why last-writer-wins is the wrong rule here”Our telemetry store keeps the most recent value for a key, so the frequent zeros
overwrite the one true reading and the aircraft appears flat. preflight_check
treats battery as a blocking check, so the effect was a preflight that refused
on a healthy drone, which is the safe direction to fail but still wrong.
This was invisible until now because the old battery agreed with itself: earlier in the same session the key read 62, 58 and 41, all plausible. Whatever produces the zeros started doing so after the pack was swapped, so a bug that had presumably always been there only became visible with a different battery.
Fixed 2026-10-02. Events now carry the buffer they arrived on and the store
keeps the last value per source, so the disagreement is visible rather than
silently resolved; get_state returns a sources map whenever two buffers
differ. preflight_check breaks the tie on physical grounds rather than
preference: an aircraft that is powered and holding a link is not at 0%, so
a zero from a live drone is not a credible reading while a non-zero one is. It
reports that the number was contested either way, and a genuine zero from every
source still reports zero and still blocks.
What was deliberately not done: silently preferring the larger number. That would be a guess dressed as a fix, and it would hide the next disagreement instead of surfacing it.
Comments
Spotted a mistake, or tried this on your own Bebop? Leave a note. Comments are kept on this site's own server.