mirror of https://github.com/openwrt/openwrt.git
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> |
||
|---|---|---|
| .. | ||
| adb-enablemodem | ||
| arptables | ||
| bpftool | ||
| comgt | ||
| ebtables | ||
| ethtool | ||
| iproute2 | ||
| ipset | ||
| iptables | ||
| iw | ||
| iwcap | ||
| iwinfo | ||
| layerscape/restool | ||
| linux-atm | ||
| ltq-dsl-base | ||
| modemsignal-leds | ||
| nftables | ||
| resolveip | ||
| rssileds | ||
| tcpdump | ||
| umbim | ||
| uqmi | ||
| wireguard-tools | ||
| wireless-tools | ||
| wpan-tools | ||
| wwan | ||
| xdp-tools | ||