openwrt/package/network/utils
Carlo Szelinsky 5fa5ca5f9e
modemsignal-leds: new package to drive cellular signal LEDs
Many LTE routers carry cellular signal LEDs - :mobile-N, :signal-N or
:rssi-N in their DTS - that nothing in the tree drives, so they stay
dark. Light them from the modem's own signal report.

A small daemon polls a backend script and maps the result onto the LEDs,
as a bar graph or as a single in-service indicator. The backend
normalizes every source to 0..100:

 - QMI (uqmi), AT (gcom) and ModemManager (mmcli); "auto" derives the
   channel and the device from the proto of a cellular interface, and
   for proto wwan from the driver that proto detected. Not MBIM, as
   umbim has no signal query, and not proto 3g, where pppd runs on the
   only tty.
 - RSRP wherever the radio reports it, with its own window per radio:
   LTE -115..-85 dBm, which is what Android ships as its default bar
   thresholds, and NR -110..-65, since a good NR cell sits higher
 - RSSI where there is no RSRP - 2G, 3G, and the LTE modems that answer
   only +CSQ, an RSSI index. It is wideband power and moves with
   bandwidth and load, which is why RSRP comes first where it exists.

A single-modem device needs no configuration: the LEDs are found by
their DTS function, and ones already claimed in /etc/config/system or by
a status function are left alone. Several modems can be driven by
assigning LEDs per instance, and a board can ship defaults in
/usr/share/modemsignal-leds/profiles/<board_name>, which the first boot
installs as the config.

Each bar switches with a small hysteresis around its edge, about 1.5 dB
of RSRP on LTE. A stationary router wanders by more than that, so
without it the topmost lit bar toggles on nearly every poll.

The poll loop is a uloop_interval timerfd, so the period stays the
configured one whatever the backend costs, and a backend slower than the
interval loses ticks instead of being started on top of itself. It runs
in its own process group with a deadline inside the interval, so a stuck
gcom is killed with everything under it before the next tick. Values
coming from UCI are range-checked rather than quietly defaulted, and
messages go through ulog() so they reach syslog with a priority. The
init script keeps the interval at 5 s or more, as one AT poll alone
takes over a second.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Tested-by: Fredrik Hallin <fredappsdev@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/24845
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
2026-11-01 10:10:53 +01:00
..
adb-enablemodem
…
arptables
…
bpftool bpftool: update to 7.8.0 2026-10-11 09:49:28 +02:00
comgt comgt: add ncm support for Fibocom FG621-EA modem 2026-09-22 23:07:48 +02:00
ebtables
…
ethtool ethtool: update to 7.2 2026-10-27 10:44:32 +01:00
iproute2 iproute2: update to 7.3.0 2026-10-27 10:50:10 +01:00
ipset
…
iptables
…
iw iw: fix the documentation URL 2026-10-27 10:47:00 +01:00
iwcap
…
iwinfo libiwinfo: update to Git HEAD (2026-05-26) 2026-05-26 01:37:18 +02:00
layerscape/restool restool: sort source files for reproducible builds 2026-10-03 20:22:20 +02:00
linux-atm
…
ltq-dsl-base ltq-dsl-base: restore the DSL LED state after the LED init 2026-10-08 09:21:15 +02:00
modemsignal-leds modemsignal-leds: new package to drive cellular signal LEDs 2026-11-01 10:10:53 +01:00
nftables nftables: update to version 1.1.7 2026-10-13 01:17:20 +02:00
resolveip
…
rssileds
…
tcpdump tcpdump: update to 4.99.7 2026-09-26 21:58:04 +02:00
umbim package: utils: umbim: add dns servers independent of peerdns 2026-07-26 16:09:25 +02:00
uqmi package: utils: uqmi: add dns servers independent of peerdns 2026-07-26 16:09:25 +02:00
wireguard-tools wireguard-tools: handle whitespace around list values 2026-08-15 11:16:06 +02:00
wireless-tools
…
wpan-tools
…
wwan wwan: add Quectel modems 2026-04-03 18:47:49 +02:00
xdp-tools xdp-tools: find the arch headers of the toolchain for the BPF programs 2026-09-22 18:18:58 +02:00