Commit Graph
21 Commits
Author SHA1 Message Date
Julian Oes 14586c2d91 fix(mavlink): stop PX4 over-driving a telemetry radio (#28714)
* fix(mavlink): rate-limit the parameter dump to its share of the link

A full PARAM_REQUEST_LIST dump was only throttled in
MAVLINK_MODE_LOW_BANDWIDTH. In every other mode the sole backpressure was
get_free_tx_buf() in send_param(), which on NuttX is just FIONSPACE on the
UART and knows nothing about what the link behind it can carry. MAV_x_RATE
scales _rate_mult, which applies to the streams only, so the dump ignored
it entirely. Since _main_loop_delay is floored at 100 Hz, the dump ran at
~100 Hz (~3.9 kB/s) no matter how low MAV_x_RATE was set.

On a 57600 SiK radio (AIR_SPEED=64) that hands the radio roughly three
times what it can carry. The radio drops whole MAVLink packets, which
shows up as 4-6% loss across everything sharing the link - the parameters
themselves still arrive, it is the rest of the telemetry that suffers.
Measured on an FMU-v6C: 4.4-6.2% loss during a dump, going to 0.00% with
this change.

Derive a minimum send interval from the configured data rate instead, so
the dump takes a bounded share of the budget and scales with the link. The
8 Hz low bandwidth cap is kept as a floor so that mode does not speed up.
Fast links are unaffected: on USB the computed interval falls below the
main loop period, so it never fires.

Also stop advancing _send_all_index when send_param() fails for want of TX
buffer space. The return value was discarded after the index had already
moved on, so that parameter was skipped silently and never resent, leaving
the ground station to notice the gap and re-request it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): let streams yield budget during a parameter dump

With the dump now taking a defined share of the link budget, the streams
were still sized against the whole of it, so the two together could
over-subscribe the link and push it back into dropping packets.

Reserve the dump's share in update_rate_mult() while a full dump is in
progress, the same way const_rate streams and ulog streaming are already
accounted for. Links with spare bandwidth are unaffected by construction:
bandwidth_mult is capped at 1.0 regardless, so subtracting the reserve only
bites once the streams are actually close to the limit. Verified on USB,
where tx rate mult stays at 1.000 throughout a dump.

This keys off a full PARAM_REQUEST_LIST transfer rather than the existing
sending_parameters(), which stays true for 2 s after any single parameter
goes out and would reserve bandwidth far more often than intended.

Measured on an FMU-v6C over a 57600 SiK: during a dump the streams scale
back from 0.473 to 0.232 and total output drops from 1428 to 1052 B/s,
inside the 1200 B/s budget, with no loss.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): pin the TELEM1 data rate to a radio-safe default

MAV_0_RATE defaulted to a hardcoded 1200 B/s while every other instance
defaulted to 0, meaning baudrate/20. The value predates the yaml config
migration in 2018 and no rationale is recorded for it.

Deriving it from the baudrate is tempting but wrong for a telemetry
radio, where the serial rate says little about what goes over the air. A
SiK radio at 57600 baud with the common 64 kbps air rate carries around
2000 B/s with error correction enabled, and roughly twice that without,
where baudrate/20 would suggest 2880. Error correction is not visible to
us from here, so 2880 over-drives the link on any radio that has it on,
and the radio drops packets rather than telling us.

Measured on an FMU-v6C over a 57600 SiK: at 2880 with error correction
enabled a parameter download loses 1.3-1.8% and an FTP burst download
fails outright, while at 2000 both complete cleanly. With error
correction off there is more headroom and 2880 is fine, so 2000 is the
value that works either way.

Pin instance 0 to 2000 rather than deriving it, and say why in the
parameter description so that anyone on a better link knows they can
raise it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): keep the FTP session alive while a burst is streaming

_last_work_buffer_access is only updated by _ensure_buffers_exist(), which
runs when a client request arrives. A burst download streams without any
client requests, so nothing refreshes it for the duration of the burst and
send() closes the session out from under the transfer once the inactivity
timeout expires.

A burst is bounded by a 35 KiB chunk, which over USB is done long before
the timeout, so this never shows there. Over a telemetry radio a single
chunk easily takes longer than 30 s, and the session is then torn down
mid-transfer: reproducible against an FMU-v6C over a 57600 SiK as a
failure at just over 31 s, every time.

Treat streaming a burst as the activity it is.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): fit FTP burst downloads to a telemetry radio

A burst download was bounded only by get_free_tx_buf(), the local UART
buffer, which knows nothing about what the radio behind it can carry. Over
a 57600 SiK that hands the radio several times its capacity: the radio's
reported txbuf collapses to zero, PX4 sheds 600-1500 B/s of its own, the
regular streams are squeezed to 40%, and the transfer dies around 10% of
the way through a 128 KiB file. It cannot be reproduced over USB, where
there is no such bottleneck.

Three things are needed, and none of them is sufficient alone.

Keep the packet inside one radio packet. A SiK splits anything larger than
its max_data_packet_length across several radio packets and reassembles
them correctly, but the split costs air time and drops the rate the link
can carry by roughly a third, which is enough to push the burst over the
edge. That limit is 250 bytes without error correction and 118 with it,
and we cannot tell which from here, so size for the smaller. The payload
is derived rather than hardcoded because the framing overhead depends on
whether signing is active.

Pace the burst against its share of the configured rate, scaled by the
radio's own txbuf feedback so it finds whatever the link actually carries:
that differs by more than two to one depending on error correction. Note
this deliberately does not use get_rate_mult(), which folds in the budget
split that this share has already been subtracted from - applying it here
too counts the reduction twice and starves the burst into the client's
inter-packet timeout.

Reserve that share in update_rate_mult() so the streams yield it instead
of the two together over-subscribing the link.

All of it is conditional on a radio reporting RADIO_STATUS, so a direct
serial or USB connection is unaffected.

Measured on an FMU-v6C over a 57600 SiK, downloading a 128528 byte file
with MAVSDK. Without error correction, at the default rate: three runs of
three complete byte-identical in 2:05, with no timeouts, no gap-fill reads
and 1414 burst packets for 1414 packets' worth of file, where the same
download fails outright before this change. With error correction enabled,
which halves both the capacity and the packet size, it completes in 3:10.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* docs(telemetry): note what a SiK link actually carries

The page says the vehicle-side radio typically needs no configuration,
which is true for getting a link up but leaves out that the serial
baudrate says little about what goes over the air, and that setting
MAV_0_RATE above what the link carries makes the radio drop packets rather
than making telemetry faster.

Add a short section with the rough figures, what to do about it, and the
two AT commands that report the radio's own limits.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): honour the size requested for an FTP burst

_workBurst recorded the offset, sequence number and target ids from a
BurstReadFile request but not its size, and the streaming loop always read
a full payload. A client could not ask for smaller packets, which the
spec provides for and which ArduPilot already honours, so the two servers
behaved differently for the same request. The single-shot ReadFile path
was never affected.

Record the requested size, treating zero as "as much as fits" to match
ArduPilot, and use it for the burst.

The clamp against what a radio carries in one piece stays, and has to be
applied after the request rather than instead of it. Every ground station
in the field asks for a full payload today, so honouring the request on
its own would hand a radio packets it has to split, which is the behaviour
this series set out to fix. Asking for less than the radio can carry is
respected; asking for more is not.

Reported by @DonLakeFlyer.

Measured against an FMU-v6C over a 57600 SiK with error correction on,
where the radio carries 118 bytes in one piece: a request for 239 is
answered with 91 bytes per packet, 200 likewise, and a request for 64 is
answered with 64.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): keep single-shot FTP reads within one radio packet too

_workRead already honoured the size a client asked for, so it was left
alone when the burst path was taught to stay inside one radio packet. That
leaves a hole: when a burst loses something, the client fills the gap with
ReadFile requests, and those go out at the size it asked for. Against a
radio carrying 118 bytes in one piece, a 110 byte request is 137 bytes on
the wire and is split - which is exactly what the burst clamp exists to
avoid, reappearing on the recovery path.

Observed against QGroundControl master over a 57600 SiK with error
correction on: burst packets came back at 91 bytes as intended while the
gap-filling reads came back at 110, and both of the retries in that
download were on the latter.

Apply the same clamp to both, and share it rather than repeating it.

Reducing the reply is safe and stays within the spec, which lets a server
return less than was asked for. Clients already handle it because they
track what is outstanding from the size in the reply: QGroundControl
answers a short read by requesting the remainder, and MAVSDK writes
whatever arrives at the offset given.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(boards): no more RGB LEDs for out of flash v2

* fix(mavlink): address review of the FTP and parameter pacing

Keep batching parameters. The dump was throttled with a minimum interval
between messages, which the batch loop for USB and UDP links immediately
ran into: it sends up to 20 messages per call, and every one after the
first was refused. Take the budget in bytes instead, accumulated over
time, so a link with room to spare still sends its batch while a slow one
is spread out as before.

Share one budget between bulk transfers. A parameter dump and an FTP burst
each paced themselves against half the link, and the streams only yielded
the larger of the two shares, so the pair of them together could take the
whole link and leave the telemetry nothing. Split one bulk share between
whichever of them are running.

Leave MAVLink 1 replies alone. Only MAVLink 2 drops the trailing zeros of
a payload, so shrinking an FTP reply on a MAVLink 1 link costs the client
bytes without making the packet any smaller, and the pacing has to budget
for the whole payload there.

End a burst that fails. The server returned 'not complete' for a failed
read, so it sent the same NAK every couple of milliseconds until the
client reset the session. ArduPilot marks that packet as the end of the
burst; do the same.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fixup! fix(mavlink): rate-limit the parameter dump to its share of the link

Signed-off-by: Julian Oes <julian@oes.ch>

* fixup! fix(mavlink): fit FTP burst downloads to a telemetry radio

Signed-off-by: Julian Oes <julian@oes.ch>

* fixup! fix(mavlink): address review of the FTP and parameter pacing

Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): treat a UDP data rate of 0 like USB

Now that the parameter dump follows the configured data rate, MAV_x_RATE=0
on an ethernet link matters more. UDP has no baudrate, so 0 fell through to
the 57600 serial initialiser and resolved to 2880 B/s, throttling the dump
to about 39 parameters per second. Every in-tree ethernet configuration
sets a rate explicitly, so this only bites when ethernet is moved to an
instance left at 0, or on av/x-v1, which starts UDP without -r.

Give UDP the same 100000 B/s fallback that USB already has.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

* fix(mavlink): pace LOG_DATA log downloads behind a radio

A LOG_DATA download was bounded only by the local UART buffer, so it
over-drives a telemetry radio the same way an FTP burst did: the radio
gets far more than it can carry over the air and drops packets, including
the telemetry sharing the link.

Pace it like the FTP burst. Behind a radio that reports RADIO_STATUS, send
one packet per call, against the bulk share of the configured rate scaled
by the radio's txbuf feedback. A log download now also counts as a bulk
transfer, so it splits the bulk share with a parameter dump or FTP burst
running at the same time, and the streams yield that share while it runs.

A direct serial, USB or UDP link is unaffected.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julian Oes <julian@oes.ch>

---------

Signed-off-by: Julian Oes <julian@oes.ch>
2026-10-18 19:08:09 -06:00
PX4BuildBot b66576916a docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-07-19 16:22:01 +00:00
Jacob Dahl 5ea7337a31 feat(crsf): add local altitude/vertical-speed telemetry and fix GPS frame (#27948)
* fix(crsf): correct GPS telemetry ground speed, course, and altitude offset

Ground speed was sent from the NED down-velocity component with the km/h conversion inverted, course over ground wraps negative values through the uint16 field, and the rc_input frame applied a +1 m offset where the protocol expects +1000 m.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* feat(crsf): send local altitude and vertical speed telemetry

Add the CRSF barometric altitude frame (0x09), fed from vehicle_local_position, to both the crsf_rc driver and the legacy rc_input telemetry. Shows up as Alt and VSpd sensors on EdgeTX/OpenTX radios, complementing the MSL altitude already sent in the GPS frame.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* docs(crsf): clarify local-altitude telemetry semantics and units

Note that the Alt/VSpd sensors reuse the CRSF baro-altitude frame to carry PX4's fused local altitude (above the estimator origin), not a raw barometer reading, and document the EdgeTX version requirements. Add terse unit comments on the GPS-frame fields.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-07-19 10:16:23 -06:00
PX4BuildBot 12f99ac841 docs: auto-sync metadata [skip ci]
Co-Authored-By: PX4 BuildBot <bot@px4.io>
2026-07-02 07:04:51 +00:00
Hamish Willee 96e760a782 docs(docs): Fix almost all broken external links (#27790)
* docs(docs): Add missing uorb topics sidebar
* docs(docs): discontinue cuav v5 plus/nano
* docs(docs): Fix 404 and 303 status HTTP links
* docs(docs): more link fixes
* update(drivers): Docs fix to fix up link
* docs(docs): Fix up all remaining  broken links and add exclusions
2026-07-02 16:58:40 +10:00
Peter C. c838206024 docs(telemetry): Add Holybro sik long range to telemetry hardware documentaions (#26931) 2026-04-08 17:02:27 +10:00
Hamish Willee b37733459d docs: Codespell check on English sources + swd fixes (#26657) 2026-03-05 12:50:59 +11:00
Hamish Willee 209c971c1b docs: Link fixes in docs - including 404 fixes (#26605)
* Redirect 301/308 HTTP link fixes
* Easy 404 fixes - easy
* Add internal anchor fixes and generate msg docs fix
2026-02-28 17:09:53 +11:00
Hamish Willee dd0dcbb82c Link fixes - mostly redirects (#25186) 2025-07-10 17:35:07 +10:00
Hamish Willee 5d5e23bcfa [Docs] Fix links and tidy config (#25184)
* Fix links and tidy config

* Add updated lock files
2025-07-10 16:11:58 +10:00
Hamish Willee 2c31e2bad5 Fix all possible HTTP to HTTPS docs links (#25153) 2025-07-03 18:09:58 +10:00
Hamish Willee 375f421c61 Link fixes galore (#25151) 2025-07-03 14:53:12 +10:00
Hamish Willee 2bda1b08c9 Add image to repo, prettier 2025-06-26 12:49:44 +10:00
Jakub KákonaandHamish Willee 804af78245 Update docs/en/telemetry/index.md
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-06-26 12:49:44 +10:00
Jakub Kákona 56e8d23fb0 Adding the TFSIK01 page. 2025-06-26 12:49:44 +10:00
Jakub Kákona 3ea9069ada Adding TFSIK01 telemetry radio docs page. 2025-06-26 12:49:44 +10:00
Seungbin Lee 8e399ed78e Update jfi_telemetry.md
Change the range from 500 meters to 1000 meters.
2025-06-04 17:18:51 +10:00
Hamish WilleeandPX4BuildBot eb72925045 Docs Metadata updates (#24929)
* Failsafe metadata update

* docs: update module reference metadata

* docs: update parameter reference metadata

* docs: metadata: update uORB graph JSONs

* uorb message metadata updates

* Add new uorb topics to sidebar

* Remove uorb topics that no longer exist

* fix up resulting docs links

---------

Co-authored-by: PX4BuildBot <bot@pixhawk.org>
2025-05-28 12:23:02 +10:00
Seungbin LeeandHamish Willee 881d58b79f [Doc] Update JFI Telemetry v1.1 Changes (#24747)
* update jfi image

* Update jfi_telemetry.md

* update images

* File size compression

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-05-07 10:37:32 +10:00
Seungbin LeeandHamish Willee 9cc1e01bd8 [Doc] Added J.Fi Wireless Telemetry Module (#24656)
* add jmarple product

* update youtube link

* Move/shrink images

* Move above discontinued items

* Minor update

* Fix broken link

* update PX4 Setup guide

* Subedit

---------

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-04-03 15:16:56 +11:00
Hamish WilleeandRamon Roche 88d623bedb Move PX4 Guide source into /docs (#24490)
* Add vitepress tree

* Update existing workflows so they dont trigger on changes in the docs path

* Add nojekyll, package.json, LICENCE etc

* Add crowdin docs upload/download scripts

* Add docs flaw checker workflows

* Used docs prefix for docs workflows

* Crowdin obvious fixes

* ci: docs move to self hosted runner

runs on a beefy server for faster builds

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci: don't run build action for docs or ci changes

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* ci: update runners

Signed-off-by: Ramon Roche <mrpollo@gmail.com>

* Add docs/en

* Add docs assets and scripts

* Fix up editlinks to point to PX4 sources

* Download just the translations that are supported

* Add translation sources for zh, uk, ko

* Update latest tranlsation and uorb graphs

* update vitepress to latest

---------

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
Co-authored-by: Ramon Roche <mrpollo@gmail.com>
2025-03-13 16:08:27 +11:00