Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ set(LIB_SOURCE_FILES
src/mavlink.c
src/wfbcli.hpp
src/wfbcli.cpp
src/WiFiRSSIMonitor.hpp
src/WiFiRSSIMonitor.cpp
src/WiFiMonitor.hpp
src/WiFiMonitor.cpp
src/scheduling_helper.hpp
src/gstrtpreceiver.cpp
src/gstrtpreceiver.h)
Expand Down
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Typical OSD config looks like:
"x": 10,
"y": 60,
"icon_path": "device_thermostat.png",
"template": "CPU: %.0fC, GPU: %.0fC",
"template": "CPU: %.0f°C, GPU: %.0f°C",
"facts": [
{"name": "os_mon.temperature",
"tags": {"name": "soc-thermal"},
Expand Down Expand Up @@ -222,7 +222,27 @@ lot of facts to which widgets can subscribe to:
| `video.decoder_feed_time_ms` | uint | Time to feed the video packet to hardware decoder |
| `gstreamer.received_bytes` | uint | Number of bytes received from gstreamer (published for each packet) |
| `osd.custom_message` | str | The custom message passed via `--osd-custom-message` feature |
| `os_mon.wifi.rssi` | uint | rssi as reported from /proc/net/rtl88x2eu/<interface>/trx_info_debug |
| `os_mon.wifi.rssi` | int | rssi as reported from /proc/net/`<driver>`/`<interface>`/trx_info_debug |
| `os_mon.wifi.temperature` | int | RF chip temperature, degrees C, from /proc/net/`<driver>`/`<interface>`/thermal_state |

The `os_mon.wifi.*` facts are only published in APFPV mode (in WFB mode the same data comes from
wfb-ng as `wfbcli.*`). They are read from the proc interface of the Realtek drivers - every
`/proc/net/rtl*` directory is scanned, so all card families (rtl88x2eu, rtl88x2cu, rtl88x2bu, ...)
are covered; cards whose driver has no `thermal_state` simply publish no temperature.
Both are tagged with `interface` (eg `wlx0013eff604e2`) and `adapter`, plus `type`
(`rssi_a`/`rssi_b`/`rssi_percent`/`connected`) for the rssi and `rf_path` (`0`/`1`) for the
temperature. `adapter` is the index of the card among all adapters found, counted from 0 in
interface-name order - bind widgets to it (`{"adapter": "0", "type": "rssi_a"}`) rather than to the
MAC-derived interface name, which differs per ground station. Note that the index of a card changes
when other adapters are plugged in or removed. Temperature is sampled every 10 seconds, because
reading it makes the driver trigger an ADC conversion on the RF chip.

An adapter that is not associated (no drone yet, drone powered off) publishes `connected` = 0 and
`-1` for every rssi value, so a bar bound to it disappears instead of freezing at the last value it
saw. `-1` is outside the 0..100 percentage range that `IconSelectorWidget` configs cover, so it
hides by default; add a range for it (`{"range": [-1, 0], "icon_path": "no_signal.png"}`) to show an
explicit "no signal" icon instead. If an adapter is unplugged entirely, its facts are dropped back
to undefined, which hides the widget as well.

There are many facts based on Mavlink telemetry, see `mavlink.c`. All of them have tags "sysid" and
"compid", but some have extra tags.
Expand Down Expand Up @@ -333,6 +353,10 @@ to display any fact (as long as datatype matches):
* `{"type": "DebugWidget"}` - displays debug information (name, type, tags, value) about fact(s)
* `{"type": "IconSelectorWidget"}` - display a icon based on a fact's value

Text is rendered with LVGL's built-in Montserrat font, which only covers ASCII plus the degree sign
`°` (U+00B0) and a few symbols. Any other character comes out as an empty box - watch out for
look-alikes such as `⁰` (U+2070, superscript zero).

Specific widgets expect quite concrete facts as input:

* `DvrStatusWidget` - shows up when DVR is recording and is hidden when not.
Expand Down
141 changes: 141 additions & 0 deletions config_osd.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,123 @@
{"range": [-130, -91], "icon_path": "signal8.png"}
]
},
{
"type": "IconSelectorWidget",
"name": "APFPV RSSI of adapter 1 antenna 1",
"x": -250,
"y": 0,
"facts": [
{
"__comment": "APFPV counterpart of the six widgets above: same slots, but fed by the WiFi driver instead of wfb-ng. Only one of the two sets is ever published, the other stays hidden. RSSI is a percentage here, not dBm. `adapter` counts the cards from 0 in interface-name order, `type` picks the RF path",
"name": "os_mon.wifi.rssi", "tags": {"adapter": "0", "type": "rssi_a"}
}
],
"ranges_and_icons": [
{"range": [70, 100], "icon_path": "signal1.png"},
{"range": [60, 69], "icon_path": "signal2.png"},
{"range": [50, 59], "icon_path": "signal3.png"},
{"range": [40, 49], "icon_path": "signal4.png"},
{"range": [30, 39], "icon_path": "signal5.png"},
{"range": [20, 29], "icon_path": "signal6.png"},
{"range": [10, 19], "icon_path": "signal7.png"},
{"range": [1, 9], "icon_path": "signal8.png"}
]
},
{
"type": "IconSelectorWidget",
"name": "APFPV RSSI of adapter 1 antenna 2",
"x": -205,
"y": 0,
"facts": [
{"name": "os_mon.wifi.rssi", "tags": {"adapter": "0", "type": "rssi_b"}}
],
"ranges_and_icons": [
{"range": [70, 100], "icon_path": "signal1.png"},
{"range": [60, 69], "icon_path": "signal2.png"},
{"range": [50, 59], "icon_path": "signal3.png"},
{"range": [40, 49], "icon_path": "signal4.png"},
{"range": [30, 39], "icon_path": "signal5.png"},
{"range": [20, 29], "icon_path": "signal6.png"},
{"range": [10, 19], "icon_path": "signal7.png"},
{"range": [1, 9], "icon_path": "signal8.png"}
]
},
{
"type": "IconSelectorWidget",
"name": "APFPV RSSI of adapter 2 antenna 1",
"x": -160,
"y": 0,
"facts": [
{"name": "os_mon.wifi.rssi", "tags": {"adapter": "1", "type": "rssi_a"}}
],
"ranges_and_icons": [
{"range": [70, 100], "icon_path": "signal1.png"},
{"range": [60, 69], "icon_path": "signal2.png"},
{"range": [50, 59], "icon_path": "signal3.png"},
{"range": [40, 49], "icon_path": "signal4.png"},
{"range": [30, 39], "icon_path": "signal5.png"},
{"range": [20, 29], "icon_path": "signal6.png"},
{"range": [10, 19], "icon_path": "signal7.png"},
{"range": [1, 9], "icon_path": "signal8.png"}
]
},
{
"type": "IconSelectorWidget",
"name": "APFPV RSSI of adapter 2 antenna 2",
"x": -115,
"y": 0,
"facts": [
{"name": "os_mon.wifi.rssi", "tags": {"adapter": "1", "type": "rssi_b"}}
],
"ranges_and_icons": [
{"range": [70, 100], "icon_path": "signal1.png"},
{"range": [60, 69], "icon_path": "signal2.png"},
{"range": [50, 59], "icon_path": "signal3.png"},
{"range": [40, 49], "icon_path": "signal4.png"},
{"range": [30, 39], "icon_path": "signal5.png"},
{"range": [20, 29], "icon_path": "signal6.png"},
{"range": [10, 19], "icon_path": "signal7.png"},
{"range": [1, 9], "icon_path": "signal8.png"}
]
},
{
"type": "IconSelectorWidget",
"name": "APFPV RSSI of adapter 3 antenna 1",
"x": -70,
"y": 0,
"facts": [
{"name": "os_mon.wifi.rssi", "tags": {"adapter": "2", "type": "rssi_a"}}
],
"ranges_and_icons": [
{"range": [70, 100], "icon_path": "signal1.png"},
{"range": [60, 69], "icon_path": "signal2.png"},
{"range": [50, 59], "icon_path": "signal3.png"},
{"range": [40, 49], "icon_path": "signal4.png"},
{"range": [30, 39], "icon_path": "signal5.png"},
{"range": [20, 29], "icon_path": "signal6.png"},
{"range": [10, 19], "icon_path": "signal7.png"},
{"range": [1, 9], "icon_path": "signal8.png"}
]
},
{
"type": "IconSelectorWidget",
"name": "APFPV RSSI of adapter 3 antenna 2",
"x": -25,
"y": 0,
"facts": [
{"name": "os_mon.wifi.rssi", "tags": {"adapter": "2", "type": "rssi_b"}}
],
"ranges_and_icons": [
{"range": [70, 100], "icon_path": "signal1.png"},
{"range": [60, 69], "icon_path": "signal2.png"},
{"range": [50, 59], "icon_path": "signal3.png"},
{"range": [40, 49], "icon_path": "signal4.png"},
{"range": [30, 39], "icon_path": "signal5.png"},
{"range": [20, 29], "icon_path": "signal6.png"},
{"range": [10, 19], "icon_path": "signal7.png"},
{"range": [1, 9], "icon_path": "signal8.png"}
]
},
{
"name": "Video FPS and resolution",
"type": "VideoWidget",
Expand Down Expand Up @@ -212,6 +329,30 @@
"critical": 2,
"facts": [ { "name": "gstreamer.received_bytes" } ]
},
{
"name": "APFPV WiFi RF temperature adapter 1",
"type": "---IconTplTextWidget",
"x": -250,
"y": 155,
"icon_path": "device_thermostat.png",
"template": "RF %i°C / %i°C",
"facts": [
{"name": "os_mon.wifi.temperature", "tags": {"adapter": "0", "rf_path": "0"}},
{"name": "os_mon.wifi.temperature", "tags": {"adapter": "0", "rf_path": "1"}}
]
},
{
"name": "APFPV WiFi RF temperature adapter 2",
"type": "---IconTplTextWidget",
"x": -250,
"y": 185,
"icon_path": "device_thermostat.png",
"template": "RF %i°C / %i°C",
"facts": [
{"name": "os_mon.wifi.temperature", "tags": {"adapter": "1", "rf_path": "0"}},
{"name": "os_mon.wifi.temperature", "tags": {"adapter": "1", "rf_path": "1"}}
]
},
{
"name": "MspDisplayPort",
"type": "---MspDisplayPortWidget",
Expand Down
Loading