Commit Graph
70 Commits
Author SHA1 Message Date
Abdurrahman Kaan DikeçandClaude Fable 5.1 53234365c6 thermal: a handoff that does not fail open, a read-only Thermal card, FINDINGS 48
Review of the first commit: one flaky sensor made the whole virtual zone unreadable while its cooling maps stayed
bound, and thermal-guard trusted the bindings alone - nothing would have throttled. mu300_thermal now reports the
hottest of the zones that read and fails only when none does (the core then skips the update and the sysfs temp
read fails). thermal-guard hands over only when the bound zone also has a passive trip at or below HOT and reads a
number within 15 C of the hottest reading of the round; a missing, non-numeric or stale reading, or trips above
HOT, keep it capping. Tests for each, for mainline without the zone, and for the 105 C power-off under native
cooling.

System > CPU gets a read-only Thermal card from standard thermal sysfs (mu300-cpu status --json: "thermal", every
zone's type, temperature, trips and bound cooling devices with their states), in the 31 catalogs. FINDINGS 48 has
the device tree facts, the module-or-DT decision and its evidence, how the kernel's QoS cap and the profile ceiling
compose, and the handoff rules; the upstream README, the panel wiki page and tests/README follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
2026-10-12 14:45:50 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 9608ba57d5 mainline: the stock virtual thermal zone (mu300_thermal) and thermal-guard's handoff to the kernel
The stock device tree has trip points on one zone only, soc-thmzone (passive 70 and 85 C, critical 110 C, cooling
maps from the 85 C trip to the three CPU clusters), and its sensor is /virtual-sensor@0, the hottest of eleven
physical zones, whose driver mainline does not have; so under 6.18 and 7.2 the zone did not exist and thermal-guard
capped cpufreq by hand. upstream/modules/mu300_thermal (after kanoqwq's clean-tf-7.2, 5c8c2f9) binds to that sensor
node and reports the hottest referenced zone; thermal_of then registers soc-thmzone with its trips, binds the cpufreq
cooling devices and the step_wise governor throttles. build-modules.sh builds it for both kernels, extra-modules
loads it (modprobe, else insmod from the bundle's directory; the vendor 5.4 kernel has no such module).

thermal-guard: the vendor kernel is told by its release (5.x), not by "a zone has trips", since the mainline zone
has trips too; on mainline the 105 C power-off stays always, and while an enabled zone with a passive trip has
every cpufreq cooling device bound the guard only watches: it lifts the cap it set itself (a marker survives a
restart) and leaves scaling_max_freq to the profile's ceiling, under which the kernel's QoS cap sits; with the zone
gone it caps again. Tests: the handoff, a cluster left out, a disabled zone, the module gone, the marker, and
extra-modules' load by name and by path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
2026-10-12 14:31:30 +03:00
Sheldonato d9493f5d1d mu300-update: a boot image written while Android is the default boot says so
An update on a device whose default boot is Android cannot try the boot image it just wrote: every Linux
boot there is a one-shot trial armed from Android (mu300-linux, the panel), and a plain reboot goes to
Android by itself. `mu300-next-boot --trial` answered "default boot is not linux, nothing to do" and
exited 0, and `unlock_for_trial` threw that away - so the update ended with "Reboot to start the updated
openwrt-luci" and the reboot started Android (U30 Air, v2026.10.17 -> v2026.10.20, 2026-10-12). The image
and the systems were fine; the reboot after it was not what anything had said it would be.

- `mu300-next-boot --trial` exits 3 when there is nothing to arm, and 1 when this slot's block cannot be
  rebuilt and the initramfs' own one-shot block goes in instead (one boot, not N, FINDINGS 32) - that
  arm was a silent success before. `--rearm` keeps exit 0: there, "nothing to do" is normal.
- `mu300-update` says both (`unlock_for_trial`) and keeps going either way: the image is written by then,
  and a warning is no reason to roll it back.
- What `apply`, `boot`, `kernel`, `rollback` and `rollback-boot` print last is how to start Linux by hand
  (`mu300-linux`) and keep it (`mu300-next-boot linux`) when a reboot goes to Android.
- `docs/FINDINGS.md` 17: what that device's init log showed (`stage=misc-restored`, no
  `stage=default-boot-linux`, `.mu300/boot-tries` 0) and why nothing was broken.

Tests: `test_device_scripts.py` (`NextBoot`: the two states the arming can be in) and `test_update.py`
(`FromStock`: what the update reports for each, and the line the subcommands end with).
2026-10-12 11:14:30 +08:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 8bc2db40fb Merge origin/main into pr72-rebased (F50 SIM selection, PR #72)
Conflicts: unisoc-modem/cell (slot-aware dashboard channels + main's round deadline, both kept),
unisoc-modem/dashboard-info (main's wan_dns_servers replaces the PR's jarr_dns; the per-slot APN
option is kept), mu300-atd (main's fractional read -t re-exec, then the PR's slot-derived channel).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-12 00:25:06 +03:00
KAAN DIKEC f3d76ee8bd Merge pull request #137 from dikeckaan/panel-at-resilience
Panel: one stuck AT command no longer wedges the control panel
2026-10-11 19:09:33 +03:00
KAAN DIKEC 7a2a5eff84 Merge pull request #133 from dikeckaan/u30-charge-limit
U30 Air: 0-100 % charge limit, Type-C Rp input current, host on outside power, Wi-Fi phy address (based on oswaldxdd's charge2)
2026-10-11 17:28:11 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 a99ec227df test: a killed process the system has not reaped yet counts as gone
The macOS runner reaped the hung test modem's processes late; os.kill(pid, 0)
still found the zombie and the test failed with "still runs".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-11 13:13:00 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 d8387d9e82 U30 Air: a 0-100 % charge limit, a Type-C source's Rp current, host on outside power, the Wi-Fi phy's address
Based on oswaldxdd/mu300-linux v2026.10.15-charge2 (tag commit 321f771, the source snapshot under
experimental/u30air-charge2/source), reviewed and redone in our stack (FINDINGS 33l):
- mu300-power: CHARGE_TO is any whole number 0-100 (was 100|80). 1-99 stops at N % and starts again under N-5
  (at once when the limit changed), 0 never charges, 100 lets go at once; never held under 5 % (the SGM41511
  supplements a load its input does not cover from the battery); the temperature guard keeps the last word.
  `mu300-power charge-limit [N]`. Nothing on the F50 (no battery).
- System > Power: the limit as a number 0-100, only with a battery; the charger's input current; the note in all
  31 catalogs. The adapter no longer shows the F50's phantom battery.
- patch 0012 (6.18 and 7.2): bq256xx raises the input current to a Type-C source's Rp (1.5 A, 3 A taken as 2 A),
  read from the UMP9620 Type-C block's STATUS: a hub or splitter with a charger behind it was an SDP, 500 mA.
  On the Mac's USB-C port: 0x6082 (sink, 3 A), input 2 A, the battery at 1.6 A instead of 0.36 A.
- mu300-usb host with something on VBUS: host with the boost left off (charger + USB NIC on a splitter),
  instead of refusing.
- sprd_wlan_combo: the wiphy's permanent address is the factory one from LK (it was 00:00:00:00:00:00).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-11 13:12:04 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 01d590cc9c OpenWrt: one Wi-Fi reopen per WCN reset, however many FW_ERROR events arrive
A chip reset can send FW_ERROR more than once (sprd_wlan_combo's watchdog and wcn_bsp's own reset), and every event
started its own background "wifi down; wifi up": two of them raced each other through netifd. The hotplug hook now
takes a lock in /run that names its holder; an event while a reopen runs is dropped (the running one reopens what is
there by then), and a lock left by a killed run is taken over. The Ubuntu side already had this from systemd.

Kept from the fork: the single recovery owner. Not taken: its per-radio reopen by uci phy/path, which skips a radio
whose section names neither (the MU300 has the one radio, and "wifi" without a section covers it).

Based on kanoqwq/mu300-linux@23361ce

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-11 12:39:25 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 dc91745773 mu300-at and mu300-atd: one framing rule for a request, the lock wait in seconds, a final result code on the direct path
From the fork's AT client, with the request framing made identical on every path:

- One request is one modem command, refused otherwise in mu300-at before anything is written and again in
  mu300-atd (one_request, the same function in both; a test keeps them equal). A line feed would make the rest a
  second fifo request with an answer file of the writer's choosing, and a CR a second modem command. The only CR
  allowed is the PDU send "AT+CMGS=<length><CR><hex PDU><Ctrl-Z>" (or CMGW), which mu300-sms needs in one request.
  The panel's unisoc-modem/at already refused CR and LF; NUL cannot be in an argument.
- -t is 1-99 whole seconds: exactly what the daemon parses. The fork allowed 1-999, and the daemon read
  "120 /run/... AT" as a line without a timeout and sent all of it to the modem.
- mu300-atd parses a request strictly and drops a malformed line (it used to fall back to "the whole line is the
  command"); the answer file must be $DIR/answer.<digits>.
- The client lock waited MU300_AT_LOCK_WAIT * 10 rounds of `sleep 0.1 || sleep 1`; where no sleep takes fractions
  the 90 s wait became 900 s. It now ends at a deadline of the clock.
- The direct-tty path (no daemon) exited 0 after a timeout with no answer; it now succeeds only with a final code.

Based on kanoqwq/mu300-linux@25f8d0c

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-11 12:36:46 +03:00
test 0a55ab18d9 Expose SIM selector on PATH and update slot-aware test fixtures 2026-10-11 06:46:07 +08:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 e840e642a3 Merge origin/main (SMS forwarding) into panel-traffic-rates-leds
Both sides kept: forward_* and traffic_* in mu300dash, its ACL and the
security tests; #112's Cellular order unchanged, Data usage after it
(8); the catalogs are main's with the data usage messages added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-11 00:33:12 +03:00
KAAN DIKEC 886652e28d Merge pull request #114 from dikeckaan/test-fetch-addr-timing
test: fetch_addr's budget check is not flaky on a fast runner
2026-10-10 23:39:42 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 91db9add43 Merge origin/main (CPU profiles) into panel-traffic-rates-leds
Both sides kept: cpu_* and traffic_* in mu300dash, its ACL and the
security tests; both pages in the menu; mu300-cpu and mu300-traffic in
path-commands, build-rootfs.sh and assemble.sh; the catalogs are main's
with the data usage messages added (tools/luci-i18n.py check clean).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-10 23:38:52 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 eef262dec2 test: fetch_addr's budget check allows a run that $SECONDS shows as 1
Flaky on the macOS runner (t=1 several times today): the budget is counted
on whole seconds of the clock and $SECONDS on whole seconds since the shell
started, so the same run can read 1, 2 or 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-10 23:07:56 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 ac51d281f1 OpenWrt: the Wi-Fi LED follows hostapd's ubus object
mu300-led events listens for ubusd's object add/remove events and sets
the Wi-Fi LED from hostapd.wlan0's status whenever that object comes or
goes: wifi down/up from the shell, the panel's toggle, a WCN reset, a
hostapd that died. Before, only a wireless config reload re-synced it
(by polling wlan0 for two minutes), and "wifi down" left the LED lit.
mu300-post runs it as a procd instance instead of the reload trigger.
Ubuntu already does this through the hotspot unit's ExecStartPost/
ExecStopPost; the data LED stays mobile-data's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-10 22:49:25 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 ec6f18d433 mu300-cpu: CPU performance profiles (saving/balanced/performance); LuCI System > CPU; thermal-guard honours the cap
A profile is a governor and a per-cluster scaling_min/max set only inside the hardware frequency table
(cpuinfo_min_freq..cpuinfo_max_freq); it never changes voltage and never touches the kernel thermal trips, so the
device still throttles at its thermal limit in every profile. "saving" caps each cluster at the highest table step
<= ~60 % of its maximum, "balanced" is schedutil over the full range (stock), "performance" pins the hardware
maximum with the performance governor. One dash/bash/busybox-ash script shared by Ubuntu (mu300-cpu.service) and
OpenWrt (/etc/init.d/mu300-cpu) applies the saved profile at boot; /etc/mu300/cpu.conf keeps it across updates.

It does not fight the rest of the power logic: mu300-power's idle "eco" still drops the big core while the device
is asleep and restores to whatever this profile set, and thermal-guard caps a hot policy a step lower and lifts it
on cool-down - but no longer above the ceiling a profile wrote (/run/mu300/cpu-ceiling), so a "saving" cap is not
undone by the cooling path (verified on the F50-B board: without the ceiling fix the cap rose a step after a hot
run, with it the cap held at 75 C idle).

LuCI: System > CPU (view mu300/cpu, mu300dash cpu_get/cpu_set, unisoc-modem/cpu adapter, ACL, catalogs); tr and
zh_Hans translated, the other catalogs carry the new ids.

Voltage offsets (the risky part of the request) are deliberately not included; the PR explains why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-10 22:09:29 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 e960122f9b Ubuntu: Wi-Fi client mode comes back after a WCN reset too (#94)
The udev rule only restarted mu300-hotspot. With the device a client of
another network the hotspot is not running, wlan0 was never reopened, and
the recovery watchdog rebooted the device 70 s after the assert (seen on an
F50, v2026.10.17 test build). wcn-reopen restarts the hotspot as before,
or takes wlan0 down and up and joins the saved network again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-10 19:27:44 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 6177959d6d mu300-next-boot lock: Linux stays, whatever happens; Android only by hand
The user asked for a Linux that never changes slot by itself. "mu300-next-boot lock" arms the Linux slot successful=1 (LK never counts a successful slot down, so it never rolls back), keeps the wish in .mu300/boot-lock on the Linux disk, and every good boot re-arms it locked. The initramfs sees the lock (the bit in misc and the file on the disk) and skips its backstop count; with no system to start it does not restore Android's slot either but waits on telnet with /run/to-android. A new kernel is the one thing that could leave a locked device with no Linux at all, so mu300-update arms the usual attempts (mu300-next-boot --trial) before it writes a boot image or rolls one back, and the first boot that reaches mu300-boot-ok locks again. "unlock" goes back to the attempts; "android" switches by hand and keeps the wish for when Linux is chosen again. A slot marked successful without the file keeps the backstop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-09 19:57:47 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 b2015b33e5 Fix round 2: a resume whose AT+SPENDC=1 is not answered OK leaves the EN-DC restore marker, a failed or timed-out VPN probe counts as wanted (asked through the new network-free mu300-vpn enabled), a failed VPN start is retried by the throttled self-check, the hold marker's grace covers the toggle deadline, the hold's direction probe is bounded, an idled hotspot stays down for a Wi-Fi client or scan mode, and tree_kill kills every process any look saw, so the re-review's findings stay closed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-07 12:03:13 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 cc374e63bb Tests for the review's findings (the hold/wake race, the stale marker, EN-DC restore, no VPN flap, VPN before the modem, wifi-client, TERM during a bounded step) and FINDINGS 36 brought up to date, so each fix stays fixed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-07 08:38:17 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 7977a1a011 mobile-data suspend and resume end within a 60 s deadline with short AT lock waits and budgets, ignore a dead terminal, go through netifd on OpenWrt, and hand the modem back to the watcher on any failure, so a silent modem or a lost SSH session can no longer leave them hanging.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-07 07:46:12 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 31173068fb Every key press lights the LEDs first, also under mu300-power's idle flag and with no daemon running, and wakes mu300-power in the background, so a device held dark can never look powered off again.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-07 07:46:12 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 4e623269a8 Merge origin/main into power-profiles (TTL, suspend, README/FINDINGS refresh)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-07 06:38:18 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 3492ee0780 mobile-data suspends and resumes through netifd (ifdown/ifup wan) when mu300-power runs with MU300_NETIFD=1, refuses to dial while suspended off except from resume, and gains resume nodial, so OpenWrt's WAN, firewall and DNS survive an idle and a stopping daemon never waits for a dial.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-07 00:55:43 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 9a58a40a8d mu300-ttl: tc on clsact egress where the kernel has pedit, so flow offloading stays on; LuCI Cellular > TTL
The nft rule sits in postrouting, which fw4's software flowtable skips, so it needed offloading off. The flowtable
transmits with dev_queue_xmit, which still runs clsact's egress hook: on the mainline kernels (act_pedit, act_csum,
cls_matchall) a matchall filter there rewrites the TTL/hop limit of every packet on every sipa_eth*, and offloading
is left alone. The 5.4 vendor kernel keeps the nft backend with offloading off (ttl.offload-off records that this
script turned it off, so tc and "off" only turn back on what it turned off). matchall cannot replace a filter
(EEXIST, seen on the U30 Air), so apply deletes and re-adds; mobile-data's bring-up calls it.

LuCI: Cellular > TTL (view mu300/ttl, mu300dash ttl_get/ttl_set, unisoc-modem/ttl adapter, ACL, catalogs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-07 00:32:08 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 5c9f7767f5 mu300-power runs on both systems; the keys wake it; OpenWrt's tap-to-poweroff handler goes.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 23:28:26 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 d71bf8c9d8 mu300-led: idle (dark until told otherwise) and charge (blinking power LED) for mu300-power
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 22:39:59 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 d86dd8f950 mobile-data: suspend lte switches EN-DC off with AT+SPENDC=2, no restart, and resume only restores it if it was on
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 22:28:28 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 08fa9ec773 mobile-data: suspend/resume keep data up on LTE, redial on resume, run under the radio lock, keep ENDC off
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 22:22:49 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 8a60a76989 mobile-data: suspend (radio off or LTE only) and resume, which the watcher respects
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 22:15:30 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 1c78517147 mainline: bq256xx drives the U30 Air's charger, which Android leaves with charging switched off
The SGM41511 (a bq25601, I2C 6-006b, vendor node "ti,bq2560x_chg") had no driver under 6.18 and 7.2, so it kept
what Android left in its registers: CHG_CONFIG 0, 500 mA input. The battery never charged and drained while
plugged in. port/install.py adds the compatible to bq256xx's OF and I2C tables; patch 0009 handles that node
without a register cache, with ICHG at most 1.98 A and VREG at most 4.208 V, sets the input current from the
chip's own input detection at probe and on every VBUS change from the extcon, switches charging on unless
userspace wrote "N/A" to charge_type, and names the fuel gauge in supplied_to. Patch 0010 makes sc27xx-fgu take
its status from the charger. mu300-usb reaches the chip past the driver with -f and leaves its watchdog off.
FINDINGS 33d no longer says the chip charges on its defaults. Built for 6.18.55 and 7.2.9, untested on hardware.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 21:19:04 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 91bcf27590 mu300-atd: a reply budget of T seconds is at least T seconds, not up to the next second boundary
collect() ended at $(date +%s) + T, which with whole-second clocks is anywhere from T - 1 to T seconds
away. With T=1 a command written at x.995 had 5 ms: its reply came back empty, or cut after its first
line with the OK landing in the nr1 log as a stray line. That is the macOS CI flake in
Atd.test_stray_lines_while_idle_do_not_shift_the_answers (bash 3.2, every drain waits 1 s, so the
command lands at a random point of the second). The stray-line handling itself was never at fault:
the pre-command drain always takes what arrived while idle.

The deadline is now now + T + 1, also in mu300-at's direct-tty path; mu300-at's live-daemon budget
grows from T + 30 to T + 31 to keep its slack. A new test answers just past a second boundary and
failed every time before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 09:34:09 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 ab7cb2a929 Merge main: the F50 LEDs and the Magisk device fixes next to openwrt-luci
FINDINGS: main's 34 (LEDs, the second F50) before this branch's 35, under its own heading. The F50 lamp states that
K68/K38 point to are on main now. Host 650 OK, busybox OK, check-i18n and luci-i18n clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 20:11:57 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 cb3008096b mu300-at and its neighbours: a process gone from /proc no longer prints "can't open" into radio.log
`tr < /proc/$pid/cmdline 2>/dev/null` reports a failed redirection before its own 2>/dev/null applies, so every
check of a dead owner put "/opt/mu300/bin/mu300-at: line 96: can't open /proc/7668/cmdline" into mobile-data's
radio.log lines (seen on both devices while the modem was down). The read is braced in mu300-at, mu300-atd,
mobile-data, mu300-sms and mu300-smsd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 17:44:20 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 7e429273f9 android-vendor-start: no initramfs slot file is not the end of the script, so the modem starts with an older boot image
Under set -e, L=$(cat /run/mu300/linux-slot) failing ended the script before modem_control: with a boot image that
does not publish the file (F50 #1, booted by the v2026.10.08 image), procd respawned it every 10 s and the AT
channel never answered (measured on openwrt-luci: vendor-perms, then nothing, eight times in 100 s). Now the slot
falls back to the command line as intended; with the fix the same boot registered at 30.6 s and had data at 46 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 17:35:58 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 4f2a3e1994 Merge main: the SD card, the driver fixes, the Magisk installer, mu300-extra and the eMMC by type next to openwrt-luci
Conflicts kept both sides: boot/init's region marker before the usb-net and pick-root blocks; android-vendor-start
links the partitions of the eMMC found by type, through the fork-free link_partitions; the OpenWrt build links the
shared path-commands list and keeps the panel's own services and mu300-sms; no VPN engine in either image (the vpn
extra) while the panel's docker mounts stay positional; assemble.sh enables mu300-atd2 next to the update notice;
android-install keeps openwrt-luci and the extras on a legacy wipe; make-release audits both the panel asset and the
vpn extra.

The third system in main's new places: mu300-extra counts a disk with only openwrt-luci as mounted, the Magisk
installer sees an installed openwrt-luci (space, plan, MU300_BOOT_OS) and names the installed systems in its last
hint (the fixed "ubuntu|openwrt" text became the {1} form install.sh already uses). Tests that read what git tracks
skip where there is no checkout (a container with only the worktree mounted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 17:25:26 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 d068aaae7e Merge origin/main into f50-leds-fixes
Conflicts: mu300-update keeps main's comment ("its boot image") and this
branch's clean_broken before the download; FINDINGS takes main's 31l
(the card slot took mmc0) before this branch's 31m (hard hangs), and 31m's
table now points at 31l instead of the mmc-order-fix branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 16:52:16 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 8378da9bc9 After the branch review: the Wi-Fi LED follows a slow hotspot, the button's "on" lights it, test shows it
"wifi sync S" reads wlan0 again every 2 s for S seconds and sets the LED on every change: a hotspot LuCI turned on
can take longer than one moment to come up (the reload trigger now follows it for a minute), and the Wi-Fi button
on OpenWrt ran "wifi up" with nothing to light the LED afterwards. "mu300-led test" now includes the F50's Wi-Fi
light, and thermal-guard says the siren is red, white and blue. The kmsg-forward test filters only where grep has
--line-buffered (GNU's: the script runs on Ubuntu alone).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 13:22:23 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 6e6fdb86dc mu300dash: the AT terminal waits at most 5 s for the lock and 20 s for the answer, under rpcd's 30 s, and says so when the modem is slow
With a live daemon mu300-at could wait 12 s for the lock and T + 30 = 38 s for the answer, so rpcd killed the call and
the page showed a generic failure. mu300-at takes MU300_AT_BUDGET to shorten (never lengthen) its answer wait; the
panel sets both limits for its AT call only, and a budget that runs out is a translated busy reply saying the command
may still run (final review minor 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 12:53:44 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 9da3d6ff14 luci-app-mu300: the panel's radio on/off, modem reset and lock-apply restart take mobile-data's radio lock, and answer busy while it is held
mobile-data gains radio-locked CMD (CMD under the lock radio_on takes, held by mobile-data itself, so its
lock_owner_alive and reaper keep working unchanged; 75 when busy) and radio-busy. The action adapter runs its radio
ops through it and the backend refuses them with a translated "busy" before detaching; a lock apply's or late
replay's SFUN restart waits up to two minutes for the dial or the watchdog instead. Without mobile-data the panel
runs as before (final review minor 3, K57).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 12:49:27 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 dd3669cd55 mobile-data: an ERROR to AT+SMMSWAP=0 is an answer from a live channel, so the radio round goes on to CFUN
Any answer without OK ended every radio round before CFUN, for the whole boot, on a firmware that refuses the
handshake. A final ERROR, +CME ERROR or +CMS ERROR is now logged, the once-per-boot marker written and the round goes
on; only no answer (a timeout, the client lock busy, no final result code) still ends it. All systems (final review
minor 2, K57).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 12:38:51 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 269415b135 Merge main: the driver fixes next to the Magisk installer and the slot-aware boot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 12:19:43 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 15714c1f48 kmsg-forward: the first start of a boot forwards the kernel's buffer from its start, with its timestamps
It read with --follow-new, so the early call traces (seconds before the service starts) never reached the
journal; a restart still forwards only what is new. With an ignore list, "exec" in the pipeline replaced only a
subshell, and the unfiltered dmesg ran once the filtered one ended. The README says where the warnings are:
journalctl -t kernel (journald has ReadKMsg=no, so -k shows nothing).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 11:59:32 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 9f106e4939 F50 LEDs as ZTE's Android shows them: network blue on 4G, white on 5G, red without service; Wi-Fi on the keypad sink
The F50's Wi-Fi light is the PMIC's keypad backlight sink (ZTE lights it at 48 of 127 while the hotspot is up);
mu300-led mapped no Wi-Fi LED on the F50, so it stayed dark. "wifi sync" reads wlan0 back, and OpenWrt runs it after
a wireless reload (LuCI turning Wi-Fi off or on). mu300cell no longer turns a 5G connection blue with "data on", and
the watchdog keeps red while there is no service. Measured on both F50s: every state read back from /sys/class/leds;
F50 #1 (OpenWrt) LuCI-style off/on: 48 -> 0 -> 48.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 11:57:23 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 d44fe9d4c0 mu300-usb-reset: never in host mode, and one 100 ms rebind once the LAN is up
K12, K67 (K10 stays c). Ported from the kanoqwq fork: cd4fb28 (--fast-run, usb-ready one-shot), 4e70d02 (role check, configfs mount, --ready).
mu300-usb-reset keeps --if-no-lease and the 20 s re-enumeration stays; mu300-post runs the usb-ready one-shot in addition to --if-no-lease.
The K12 gate (macOS, Windows 11, Linux, 5 boots each) is deferred to the device phase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 11:56:21 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 701eb01ad9 mobile-data: the bring-up lock is the radio lock's kind, and the dial loads sipa-dele only on a kernel that has it
R35, from Task 23's review:
- up()'s lock had the empty-pid moment the radio lock lost in Task 23 (a directory with a pid file: a waiter that
  read an empty pid removed a lock that had just been taken). The radio lock's code is now lock_take/lock_drop
  over lock_owner_alive/lock_reap (renamed, same bodies), used by radio_on and up() alike; the up lock is the
  symbolic link /run/mu300-mobile-data-up.owner, waited for MU300_UP_LOCK_WAIT real seconds (150). down() reads it.
- The dial calls sipa-dele-start and marks dial-sipa-dele only when /lib/modules/<release> has sipa-dele.ko (or
  extra/sipa-dele.ko), as kanoqwq/clean-tf-7.2 checks (cd4fb28), so the mark is truthful; without it radio.log
  says so and the dial goes on.

Tests: a bring-up holder killed mid-round and two waiters (one round at a time, nothing left), the holder named
from the start, the wait giving up with the holder's pid, the dial with and without the module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 09:08:11 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 cba8e92541 After the final review: no eMMC CID fallback, only failed connections retried, build-wlan.sh strict
* init: the eMMC serial only from androidboot.emmcid. The /sys CID fallback ran before the modules that find the
  eMMC, so it would have come and gone between boots; without the argument the identity is the serial number alone.
  An emmcid without a serial number no longer gives "MU300LINUX--<emmc>".
* mu300-update: fetch_stdout retries only a failed connection (curl 6 7 35 52 56, GNU wget 4). A timeout (28) had
  been retried by curl already; four more rounds held "check" for half an hour. A 404 through wget is not retried.
* mu300-at: a test of the loop itself (a writable directory, a dead owner's lock that cannot be removed: "busy").
* build-wlan.sh: a Wi-Fi patch either applies or is applied already, as in upstream/build.sh (it was `|| true`).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 08:29:46 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 578dc1b6aa sipa-dele is loaded by mobile-data between registration and the PDP context, never in the background
K45, K46, K47, ported from kanoqwq/clean-tf-7.2 cd4fb28 (the CFI panic the spec cites with 45222e6), for
every system rather than OpenWrt only as in the fork: Ubuntu (mu300-extra-modules.service), OpenWrt and
openwrt-luci (init.d/mu300-hw) all run the same extra-modules, which no longer starts sipa-dele-start.

- extra-modules: the background start is gone (K45).
- sipa-dele-start: refuses with exit 1 after MU300_DELE_WAIT instead of loading anyway (K46); an insmod
  failure is exit 1 too; the wait is a deadline in seconds (date +%s), not a count of 2 s rounds; the dmesg
  sbuf-line precondition is dropped (the caller has just registered over the AT channel, and a late first
  dial could find the line gone from the ring buffer).
- mobile-data up_locked: after "registered" and before CGDCONT/CGACT, when sipa_dele is not in
  /proc/modules, runs MU300_DELE_WAIT=20 sipa-dele-start (log /tmp/mu300-sipa-dele.log); a failure ends the
  attempt (radio.log, led error, exit 1) without a PDP context (K47).

Ruling R32, radio_on's lock:
- The lock is a symbolic link /run/mu300-radio-on.owner -> owner pid, made in one step, so it never exists
  without its owner (no empty-pid grace and no race on it).
- A dead owner is taken over through radio_reap: only the waiter that creates the marker LINK.dead.PID may
  remove the link, after looking again under the marker, so two waiters that saw the same dead owner cannot
  remove each other's fresh lock. A dead marker maker is reaped the same way one level down.
- MU300_RADIO_LOCK_WAIT is a real-seconds deadline ($SECONDS).

Tests: SipaDele (extra-modules never starts it; refusal without insmod; both module layouts; insmod
failure; already loaded); MobileData: delegate between registration and CGACT and the dial stops on
failure; two waiters on a killed owner's lock run one state machine; the lock names its owner from the
start; the lock wait in seconds.

Device cycles (10 down/up per device and system, dmesg CFI/panic count, lsmod) are deferred.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 08:28:34 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 77ccbe442a mobile-data: the radio comes up after the modem's first word and the RIL handshake, without an early power cycle
K57: radio_on waits (30 s at most) for nr0's first URC, sends AT+SMMSWAP=0 to the nr1 daemon once per boot
(/run/mu300-ril-handshake), sends no AT+SFUN when AT+CFUN? is unanswered, and after AT+SFUN=4 waits for
"+CFUN: 1" (30 real seconds) before the SFUN=2/SFUN=4 power cycle. A lock (/run/mu300-radio-on.lock) keeps two
radio state machines apart; the second caller waits for the first (120 s) instead of the fork's 8 s, since a
dial that gives up costs netifd's 20 s pause.
K58: AT+CAVIMS=1 after the radio is on, in up and in radio-on.
K65: the unisoc-modem plugin's early lock replay ($PLUGIN_LOCK, MU300_PLUGIN_LOCK in tests) runs between the
radio-off answer and AT+SFUN=4; the pending marker is cleared on success only.
K66: `mobile-data radio-on`. K20: mu300-atd's radio-warmup instance runs it once nr1's daemon reads commands.
Ported from kanoqwq/clean-tf-7.2 cd4fb28 and 6404c10 (tests/test_early_replay_hook.py, paths adjusted).

R30: the CGACT=1 comment says only a timeout ends the bring-up; the address waits state their real worst case
and fetch_addr no longer sleeps past its budget; at() writes its own pid (not the parent's $$) into the AT lock,
so operator_log's background query owns the lock it holds. A modem reset during the registration wait is left to
the next attempt, which starts with radio_on (as in the fork).

Gate K57/K58 (cold boots, SMS) is deferred to the device phase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 08:03:55 +03:00