diff --git a/device/cheetah/MODEM-CLIENT.md b/device/cheetah/MODEM-CLIENT.md index 07ab68723..a1f504861 100644 --- a/device/cheetah/MODEM-CLIENT.md +++ b/device/cheetah/MODEM-CLIENT.md @@ -36,7 +36,7 @@ Two packages: | `sit.py` | ported | The single-owner IPC0 transport: framing, token matching, indication queue (signal and physical-channel snapshots coalesced so telemetry can't crowd out an SMS reply). Two guards: the allow-list of requests this stack sends, and our do-not-send list (NV, identity, carrier lock, AT forwarding, VSIM, satellite) checked first, so an edit to the allow-list can't let one through. Dial and SMS sends need the owner's flags | | `sit_names.py` | ours | The 602 message names, for logs | | `bringup.py` | ported, carrier values moved to the config | The start-up order (section 1.1) | -| `data_call.py` | ported, APN from the config | Setup (983 bytes), initial attach (251), data profile (246), PDU sessions; bearer ownership recorded in RAM before each setup, never retried blindly | +| `data_call.py` | ported, APN from the config | Setup (983 bytes; no PDU session ID on cellular, as stock), initial attach (251), data profile (246); bearer ownership recorded in RAM before each setup, never retried blindly | | `ims.py` | ported (identity strings ours) | IMS stack start, hidden-menu configuration, ADD_PDN_INFO from the IMS bearer, the registration indication | | `radio_settings.py` | ported | NR mode byte (3 -> 0 keeps LTE; the original kept in RAM) | | `sms_codec.py` | ported | GSM 7-bit / UCS-2 SMS-SUBMIT with concatenation, SMS-DELIVER with the SMSC prefix the modem adds, WAP push kept as bytes | diff --git a/device/cheetah/MODEM-PLAN.md b/device/cheetah/MODEM-PLAN.md index a0b1a3c56..417a82c15 100644 --- a/device/cheetah/MODEM-PLAN.md +++ b/device/cheetah/MODEM-PLAN.md @@ -2605,7 +2605,8 @@ tools/phone-ssh 'omamobile-sit status; systemctl is-active omamobile-sitd; /usr/ # stop: the unit fails before "ready". The journal names the step: "SIM not usable: ..." (S1); # "No ready USIM within 120 s (...)"; "Modem registration deadline exceeded" (no service, the APN, or # the SIM not activated: check coverage and activation in the other phone); "data call did not become -# active" with its status (36 = APN refused: check the APN); a CP crash (the watcher writes +# active" with its status (Android DataFailCause numbers: 27 or 33 is a refused APN, 36 +# REGULAR_DEACTIVATION); a CP crash (the watcher writes # /var/log/omamobile/modem-crashes.log). Record step and status, then reboot before another try # rollback: `omamobile-sit radio off` (AT+CFUN=0: deregisters; on again may stall until a reboot), then # `systemctl stop omamobile-sitd`; or reboot (one UFS pass) diff --git a/device/tegu/MODEM-PLAN.md b/device/tegu/MODEM-PLAN.md index ff631ed46..1ad0c50db 100644 --- a/device/tegu/MODEM-PLAN.md +++ b/device/tegu/MODEM-PLAN.md @@ -20,8 +20,12 @@ SoC within minutes. Kept on (), five sessions ran with no reset, the longest 30 minutes and 3759 link cycles (G3-L1). -Left: the GNSS and CPIF drivers aren't in the published kernel, and GNSS -still starts by hand. Next: the SIM. +**The SIM (2026-11-02): registered on LTE, mobile data up, texts both +ways** on the owner's kernel, with `omamobile-modem-sit` 0.3.8 (its first +five data requests were refused with status 36 until the RIL let the +modem settle after the data permission; "SIM test results" below). +Left: the GNSS and CPIF drivers aren't in the published kernel, GNSS and +the modem still start by hand, and calls have no audio route. The staged plan (sections F, K, U and runbooks M0.2-M6, G1-G4) is below, with each step's results under it. Kernel branches `omamobile-tegu-modem` and `omamobile-tegu-gnssif` (section K). @@ -1905,7 +1909,8 @@ tools/phone-ssh 'omamobile-sit status; systemctl is-active omamobile-sitd; /usr/ # Not the PLMN, the carrier or any number. # stop: the unit fails before "ready"; the journal names the step ("No ready USIM within 120 s", "Modem # registration deadline exceeded": coverage, activation or the APN; "data call did not become active" with -# its status, 36 = APN refused; a CP crash). Record step and code, reboot before another try (SIM-5). +# its status (Android DataFailCause numbers: 36 is REGULAR_DEACTIVATION, not a refused APN, which is 27 +# or 33); a CP crash). Record step and code, reboot before another try (SIM-5). # rollback: omamobile-sit radio off (deregisters; the radio may not come back until a reboot), then # systemctl stop omamobile-sitd; or the reboot @@ -1951,6 +1956,78 @@ tools/phone-ssh 'test -d /sys/module/cpif && echo cpif-loaded || echo cpif-not-l # pass: cpif-not-loaded; the SIM can stay in the tray ``` +#### SIM test results (2026-11-02, `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`) + +The prepaid nano-SIM arrived a day early and the test ran the same +afternoon, six CP starts over six boots, all attended on the charger, with +`omamobile-modem` 0.1.10 (installed with `pacman -U -dd`: the package +depends on `omamobile-device-cheetah`, which conflicts with +`omamobile-device-tegu`; the `omamobile-modem-policy` virtual planned in +raven's plan is the fix) and the carrier's published APN, IPv4v6, no +authentication, `ims = yes`, `nr = off`. No identifiers here: the carrier +is a US MVNO on a large LTE network. + +- **SIM-0 to SIM-4 passed.** The NV partitions matched the 2026-10-28 + backup and read `ro=1`, unmounted, before and after every boot. +- **SIM-5 passed six times:** CP ONLINE in about 9 s, UFS error handler 0. +- **SIM-6:** the first probe timed out on GET_SIM_STATUS and the CP + answered it 9.4 s later, so the probe's first request now waits 20 s + (0.3.6). Then: card state 1, applications (2, 5) and (5, 5) (a USIM and an + ISIM, both ready), radio state 10, SMSC present. +- **SIM-7 failed five times the same way, then passed.** Each time: PS + registration state 1, reject 0, RAT 14 (LTE, at home) within a few + seconds; `SET_INITIAL_ATTACH_APN` and `SET_DATA_PROFILE` error 0; NR mode + set to 0; then `SETUP_DATA_CALL` answered within 150 ms with status 36 + (Android's REGULAR_DEACTIVATION, not "APN refused"), CID 1, active 0, + and `GET_DATA_CALL_LIST` empty before and after. Three changes were + tried one at a time, each on its own boot: + 1. 0.3.5: no PDU session ID on cellular bearers (stock sends 0; sitd + reserved one). Still 36. + 2. 0.3.7: the APN-type bitmap at 0xf1 of the setup request (stock sends + the APN's types; sitd sent 0, taken for an MTU). Still 36. + 3. 0.3.8: the recording build (0.3.6) had shown that about a second + after every refusal the modem sent three IND_REG_FAILED, two + IND_NTW_STATE_CHANGED and an empty data-call list. With 0.3.8 the + same indications arrived after the data permission + (SET_MOBILE_DATA_STATE, SET_PS_SERVICE) and before the setup; the + three IND_REG_FAILED read domain CS+PS, PS, PS, each with LTE cause + 10 (implicitly detached) and additional cause 0 (decoded with the + stock library's layout). Whether the permission writes trigger the + detach isn't proven; the setup succeeds once it is over. The RIL now waits until the modem has + been quiet for 3 s after the permission (at most 20 s), reads the + registration again, and then sends the setup. On its first run the + six indications came and went in the wait, the registration read 1, + 0, 14 again, and the setup answered status 0, CID 1, active 1, PDP + type 3 (IPv4v6). The IMS bearer followed (status 0, CID 2, PDP type + 2), AIMS registration came back "LTE, IMS voice and SMS registered", + and the RIL reported "Calls and SMS service ready". + The first two changes stay in: they match stock's requests, and the + 9a's stock libraries (verified against the owner's `vendor_a.img`) write + both fields that way. +- **SIM-8 passed:** `omamobile-sit data on` brought `rmnet0` up with an + address and the default route at metric 700; three pings over it to + 9.9.9.9 answered (78 ms average); an HTTPS GET over it returned 200. +- **SIM-9 passed:** the carrier's welcome text had already arrived during + SIM-7 ("SMS stored and acknowledged"), the owner's text from another + phone arrived within seconds, and a text sent from the palmtop + (`omamobile-sit sms send`) reached the owner's phone. A text sent to + the palmtop's own number was accepted ("sent") and never came back, + which is common on this network. +- **SIM-10:** no call; the 9a has no audio route. +- **SIM-11 passed:** radio off, the RIL stopped, an attended reboot + (the unit's stop powered the CP off during shutdown), then M0.1: the + six partitions unchanged, `cpif` not loaded, UFS error handler 0. + +The run kept the full refused record (292 bytes: status 36, CID 1, the +IPC extension version at 132, an unidentified extension byte at 133, the +suggested retry time at 235-242 as an s64) and the raw indications of the passing run in +`logs/tegu-sim-20261102/private/` (off the repository). The open +question is what triggers the implicit detach. Stock's handlers send the +two permission requests separately (SET_PS_SERVICE's success path then +sleeps 500 ms) and its setup path doesn't send them; the libraries don't +show when Android's callers do. Sending them earlier, before the last +registration check, is a reasonable next try, with the wait kept. + **Unqualified after a passing run:** suspend with the modem on (the inhibitor stays; M6, two reboots with the CP up: this runbook's attended reboots count toward it but don't pass it; a power-off from Linux with the diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 4f4adbbd4..d480b273c 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -25,7 +25,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and ยง3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | -| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS once the modem is up, started by hand: a 30-minute session through the switch on 2026-11-01 (omamobile-gnss 0.2.5's start, the modem link left to cycle) ran clean, 1763 of 1765 GGA sentences fixed, first fix 37 s after a client connected; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150), merged, the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172) in review (without it the modem link hung the palmtop within minutes) and [#114](https://github.com/derekross/omarchy-mobile/pull/114); [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | WIP (ONLINE with IPC on an unpublished kernel, no SIM yet; [plan](../device/tegu/MODEM-PLAN.md)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but five test sleeps from 10-28 to the morning of 11-01 did not (one in 21 on the clock-fix kernel), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | +| Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | works ([#28](https://github.com/derekross/omarchy-mobile/issues/28): native boot from slot B, the Arch root on `userdata`, `omamobile-device-tegu`; slot B was marked successful by hand on 2026-10-28 with the `devinfo` write approved on 2026-10-22, now on hold ([#125](https://github.com/derekross/omarchy-mobile/pull/125)), unmarked by the 10-31 fastboot recovery and marked again on 2026-10-31 during the hold ([record](../device/tegu/NOTES.md#2026-10-31-a-fastboot-flash-of-slot-b-cleared-its-successful-mark-and-b-was-marked-again)), and the package does not mark it; unpublished kernel: the SoC and board device tree is [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (UFS behind the read-only guard; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (120 Hz through gs-decon; the panel driver [kernel #89](https://github.com/derekross/linux-omarchy-mobile/pull/89), 120 Hz [kernel #88](https://github.com/derekross/linux-omarchy-mobile/pull/88), merged, the display DT, merged with [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96); brightness, DPMS off and on and the 60/120 Hz switch on the boot of [kernel #125](https://github.com/derekross/linux-omarchy-mobile/pull/125), merged, which also checks the panel's ID; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on), [brightness record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (Panthor, the desktop renders, runtime suspend when idle; this boot runs at a fixed 160 MHz, so frequency scaling and the GPU thermal zone count as in review, [kernel #85](https://github.com/derekross/linux-omarchy-mobile/pull/85) in review, [kernel #87](https://github.com/derekross/linux-omarchy-mobile/pull/87) in review; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (Synaptics S3908 over SPI, [kernel #81](https://github.com/derekross/linux-omarchy-mobile/pull/81), merged; survives sleep, [kernel #82](https://github.com/derekross/linux-omarchy-mobile/pull/82), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (gpio-keys: power and volume; the power key wakes from sleep; unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (CDC NCM and SSH; reconnects after a replug, `omamobile-tegu-usb-rescue`, also after a replug the gadget didn't see ([#280](https://github.com/derekross/omarchy-mobile/pull/280); [the replug record](../device/tegu/NOTES.md#2026-10-28-what-the-device-tables-claims-rest-on)); [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (BCM4383 on PCIe channel 1 through the shared gs201 host and zuma PHY, [kernel #178](https://github.com/derekross/linux-omarchy-mobile/pull/178) on [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156), in review, and brcmfmac, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56) in review; started at boot by `omamobile-device-tegu` 0.2.4 ([#238](https://github.com/derekross/omarchy-mobile/pull/238)) with the extractor's firmware; WPA2 with iwd, kept loaded across sleep by the package's sleep hook; [record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) | works (hci_uart on the bootloader's address, BlueZ, A2DP; [kernel #94](https://github.com/derekross/linux-omarchy-mobile/pull/94); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (MAX77779 gauge with temperature, current and time estimates through UPower; [kernel #66](https://github.com/derekross/linux-omarchy-mobile/pull/66); unpublished kernel; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (the MAX77779 charger binds from the device tree, [kernel #161](https://github.com/derekross/linux-omarchy-mobile/pull/161), merged, built by [#227](https://github.com/derekross/omarchy-mobile/pull/227); the charge limit in `omamobile-device-tegu` 0.2.3 holds charging off at the limit through `charge_behaviour` and lets it run again 5 below; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (CS40L26A through feedbackd, with brownout prevention, [kernel #95](https://github.com/derekross/linux-omarchy-mobile/pull/95); its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (LM3644, 25 steps to 75 mA, quick-settings tile; its DT [kernel #96](https://github.com/derekross/linux-omarchy-mobile/pull/96), merged; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | testing (Omarchy's Location switch serves fixes from GPS, Galileo, BeiDou and GLONASS once the modem is up, started by hand: a 30-minute session through the switch on 2026-11-01 (omamobile-gnss 0.2.5's start, the modem link left to cycle) ran clean, 1763 of 1765 GGA sentences fixed, first fix 37 s after a client connected; needs [kernel #150](https://github.com/derekross/linux-omarchy-mobile/pull/150), merged, the PERIC0 clock fix [kernel #172](https://github.com/derekross/linux-omarchy-mobile/pull/172) in review (without it the modem link hung the palmtop within minutes) and [#114](https://github.com/derekross/omarchy-mobile/pull/114); [plan](../device/tegu/MODEM-PLAN.md), record with [#202](https://github.com/derekross/omarchy-mobile/pull/202)) | works (audio and sensor DSP through the GSA and Trusty, 93 services, started at boot by `omamobile-device-tegu` 0.2.3 from the device tree, [kernel #162](https://github.com/derekross/linux-omarchy-mobile/pull/162) in review; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (the TAS2572 amplifiers and the microphone through the AoC card and PipeWire, at boot with the AoC: a tone from the speaker, the microphone at -32 dBFS; speakers at a -10 dB ceiling; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (accelerometer, light, proximity, compass and gyroscope through the AoC and the sensor proxy, at boot with the AoC; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | WIP (on the owner's kernel, 2026-11-02: registered on LTE, mobile data over `rmnet0` and texts both ways with `omamobile-modem-sit` 0.3.8 ([#356](https://github.com/derekross/omarchy-mobile/pull/356)); the package doesn't start the modem, CPIF isn't in the published kernel, and calls have no audio route; [plan](../device/tegu/MODEM-PLAN.md), [record](../device/tegu/MODEM-PLAN.md#sim-test-results-2026-11-02-730-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty)) | works (NXP ST54L through nxp-nci, its clock pad from the PMU ([kernel #104](https://github.com/derekross/linux-omarchy-mobile/pull/104) and [kernel #105](https://github.com/derekross/linux-omarchy-mobile/pull/105), merged, with [kernel #131](https://github.com/derekross/linux-omarchy-mobile/pull/131), merged), loaded at boot by `omamobile-device-tegu` 0.2.3 with neard and the link opener: polls with no I2C errors and read a payment card; polling stops before sleep; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | works (main, ultrawide and front from the device tree, [kernel #164](https://github.com/derekross/linux-omarchy-mobile/pull/164) in review, with [kernel #63](https://github.com/derekross/linux-omarchy-mobile/pull/63) and [kernel #103](https://github.com/derekross/linux-omarchy-mobile/pull/103) in review: their drivers load at boot with nothing by hand, libcamera lists all three, and each streams, main at 19 fps and the others at 30 fps at 1280x960; basic picture quality through libcamera's software ISP; [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; the power key lights the lock screen on the first press ([#268](https://github.com/derekross/omarchy-mobile/pull/268), [#275](https://github.com/derekross/omarchy-mobile/pull/275)), and the RTC wakes it; on 2026-11-01 thirty attended 120 s sleeps ([plan](../device/tegu/SLEEP-PLAN.md) S1) and a day of real use with auto-sleep on ([record](../device/tegu/NOTES.md#2026-11-01-afternoon-and-evening-wi-fi-from-the-package-the-wake-and-the-replug-storage-idle-the-panel-id)) all woke, but five test sleeps from 10-28 to the morning of 11-01 did not (one in 21 on the clock-fix kernel), so sleep tests stay attended ([plan](../device/tegu/SLEEP-PLAN.md) S1); the drain is about 300 mA asleep, the same as awake with the screen off, because nothing below the CPUs sleeps yet; [record](../device/tegu/NOTES.md#2026-10-29-the-device-package-boot-and-what-this-row-rests-on)) | works (opt-in) (enrolls, matches, refuses other fingers and unlocks the lock screen through Trusty and `omamobile-fingerprint`, 2026-10-29; the sensor binds from the device tree, [kernel #165](https://github.com/derekross/linux-omarchy-mobile/pull/165) in review, with [kernel #126](https://github.com/derekross/linux-omarchy-mobile/pull/126), merged; opt-in as on the 7 Pro, because the service's first run writes Trusty's secure storage; [plan](../device/tegu/FINGERPRINT-PLAN.md), [record](../device/tegu/NOTES.md#2026-10-31-and-11-01-every-testing-row-on-a-published-style-kernel)) | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): slot B, not marked successful; Omarchy's image from the signed repository boots to the lock screen; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13), [#53](https://github.com/derekross/linux-omarchy-mobile/pull/53))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer: console and Omarchy's lock screen) | no | testing (ST FTM5 over SPI, merged, [kernel #153](https://github.com/derekross/linux-omarchy-mobile/pull/153); [NOTES](../device/husky/NOTES.md)) | testing (power and volume through `gpio-keys`, merged, [kernel #148](https://github.com/derekross/linux-omarchy-mobile/pull/148); [NOTES](../device/husky/NOTES.md)) | testing (USB and SSH) | testing (BCM4398 on a test kernel, [kernel #156](https://github.com/derekross/linux-omarchy-mobile/pull/156); firmware from the owner's image, [#214](https://github.com/derekross/omarchy-mobile/pull/214); [NOTES](../device/husky/NOTES.md)) | no | testing (gauge with Google's ATL model through a bring-up overlay, temperature, MFD, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | testing (the charger driver by hand under a dead-man tool, slow on plain 5 V, on a test kernel, [kernel #163](https://github.com/derekross/linux-omarchy-mobile/pull/163); [notes](../device/husky/BATTERY-NOTES.md)) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 7 ([notes](../device/panther/NOTES.md)) | panther | gs201 (Tensor G2) | WIP (slot B, not marked successful; Arch and Hyprland boot; [BRINGUP-M1](../device/panther/BRINGUP-M1.md); board file merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (UFS behind the read-only guard; Arch on `userdata`; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | WIP (simple-framebuffer: console and the Hyprland desktop; brightness and display off/on over DCS through the S6E3FC3 panel driver and device-panther 0.1.4, in review, [kernel #177](https://github.com/derekross/linux-omarchy-mobile/pull/177); [DISPLAY-PLAN](../device/panther/DISPLAY-PLAN.md)) | testing (Panthor on the Mali-G710; Hyprland renders on it; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the always-on rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | WIP (FocalTech FT3658: touches drive Hyprland and unlock the PIN screen on a test kernel; the driver, [kernel #109](https://github.com/derekross/linux-omarchy-mobile/pull/109), and the touch node, [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), are merged; stock's interrupt pull-up and CS delay, [kernel #166](https://github.com/derekross/linux-omarchy-mobile/pull/166), the driver's review fixes, [kernel #133](https://github.com/derekross/linux-omarchy-mobile/pull/133), and the kernel option with the touch notes, [#149](https://github.com/derekross/omarchy-mobile/pull/149), are merged) | testing (gpio-keys: power, volume; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108)) | testing (USB and SSH; merged, [kernel #108](https://github.com/derekross/linux-omarchy-mobile/pull/108); a replug comes back through `omamobile-usb-rescue` in device-panther 0.1.3, on the MAX77759's I2C bus, merged, [kernel #167](https://github.com/derekross/linux-omarchy-mobile/pull/167); [notes](../device/panther/NOTES.md#2026-10-29-usb-comes-back-after-a-replug-u1)) | no | no | WIP (MAX77759 fuel gauge with stock's battery model on a test kernel: percentage, capacity and temperature in upower and the bar; in review, [kernel #171](https://github.com/derekross/linux-omarchy-mobile/pull/171) and the driver fix [#170](https://github.com/derekross/linux-omarchy-mobile/pull/170); [BATTERY-PLAN](../device/panther/BATTERY-PLAN.md)) | no | testing (CS40L26 with the phone's own firmware, `tools/extract-vendor-firmware -d panther`; merged through [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134), with the feedbackd rule in device-panther 0.1.1, [#145](https://github.com/derekross/omarchy-mobile/pull/145); [notes](../device/panther/NOTES.md#2026-10-28-the-gpu-and-the-haptics-power-off-and-usb-after-a-replug)) | no | no | no | no | no | no | no | no | no (s2idle by default since [kernel #134](https://github.com/derekross/linux-omarchy-mobile/pull/134) and device-panther 0.1.1; not run yet) | no | | OnePlus 13 ([notes](../device/dodge/NOTES.md)) | dodge | sm8750 (Snapdragon 8 Elite) | testing (kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [BRINGUP](../device/dodge/BRINGUP-M1.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (msm/dpu; warm-boot drop fixed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (Adreno 830 / gpu2; Vulkan untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing ([notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (CDC NCM + SSH; gadget stuck after replug until reboot; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (WCN7860 / ath12k; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (pairing; A2DP untested; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (gauge; charging path not claimed; kernel [mrlund/linux-omarchy-mobile `dodge-v3-20261101`](https://github.com/mrlund/linux-omarchy-mobile/tree/dodge-v3-20261101); [kernel #115](https://github.com/derekross/linux-omarchy-mobile/pull/115) closed; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | no | no | - | testing (speakers, earpiece, mics; headset plug untested; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (accel, prox, compass; autorotate; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | testing (LTE data; calls/SMS untested; opt-in flag; [modem](../device/dodge/modem/README.md), [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | no | WIP (s2idle not default; [notes](../device/dodge/NOTES.md#2026-10-28-matrix-evidence)) | no | diff --git a/packages/omamobile-modem-sit/lib/bringup.py b/packages/omamobile-modem-sit/lib/bringup.py index 718e7054b..45e2a98aa 100644 --- a/packages/omamobile-modem-sit/lib/bringup.py +++ b/packages/omamobile-modem-sit/lib/bringup.py @@ -58,6 +58,23 @@ def sim_lock(payload): return LOCKS.get(app[1]) + +def data_snapshot(client, label): + """Registration and the data-call list, as the modem reports them, before + and after the NR change: whether a bearer is ever listed before the + setup, and whether the change makes one appear or disappear. States, + codes and counts only.""" + try: + reg = client.request(0x0701) + calls = client.request(0x0602) + except (TimeoutError, RuntimeError) as error: + print(f'{label}: snapshot unavailable: {error}', flush=True) + return + state = (reg[0], reg[1], reg[3]) if len(reg) >= 4 else tuple(reg[:4]) + print(f'{label}: PS state, reject, RAT {state}; data calls listed {calls[0] if calls else "none"}', + flush=True) + + def packet_registered(payload, *, lte=False): return len(payload) >= 4 and payload[0] in (1, 5) and (not lte or payload[3] == 14) @@ -137,11 +154,13 @@ def usim_ready(): print('Startup: waiting for packet registration', flush=True) timeout = net.getint('register_timeout', 180) wait_for(service, lambda: packet_registered(client.request(0x0701)), timeout, stopped) + data_snapshot(client, 'before the NR change') if net.get('nr', 'off') == 'off': nr_mode(client) wait_for(service, lambda: packet_registered(client.request(0x0701), lte=True), 120, stopped) + data_snapshot(client, 'after the NR change') service.stage('data') - activate(client, apn, ip_type=ip_type) + activate(client, apn, ip_type=ip_type, on_event=service.event) service.pump() if not net.getboolean('ims', True): service.ims_state = 'off' @@ -151,7 +170,7 @@ def usim_ready(): service.stage('ims') try: start_stack(client) - activate(client, net.get('ims_apn', 'ims'), ims=True) + activate(client, net.get('ims_apn', 'ims'), ims=True, on_event=service.event) register(client) print('Startup: waiting for IMS voice and SMS registration', flush=True) wait_for(service, lambda: service.registration().get('state') == 2 and diff --git a/packages/omamobile-modem-sit/lib/data_call.py b/packages/omamobile-modem-sit/lib/data_call.py index b271a97c2..25302561d 100644 --- a/packages/omamobile-modem-sit/lib/data_call.py +++ b/packages/omamobile-modem-sit/lib/data_call.py @@ -4,15 +4,24 @@ The APN comes from /etc/omamobile/modem-sit.conf. Ownership is recorded in RAM before a setup is sent: a setup or release with an unknown outcome -keeps its record and its PDU session, and nothing is retried blindly. +keeps its record, and nothing is retried blindly. + +A cellular setup carries no PDU session ID (0), as stock's does: Android's +data stack reserves one (ALLOC_PDU_SESSION) only for a bearer carried over +Wi-Fi (IWLAN), and stock's builder copies the framework's value into the +request unchanged, so on LTE and NR the modem picks the ID itself. Records +from 0.3.4 and earlier hold an allocated ID, which deactivate() still +releases. """ import json import os from pathlib import Path import re import struct +import time from paths import RUN +from sit_names import NAMES STATE = RUN / 'data-session.json' RESPONSE = RUN / 'data-call-response.bin' @@ -62,7 +71,8 @@ def owned_ids(): state, _ = paths(cid) if state.exists(): owned = json.loads(state.read_text()) - if owned.get('cid') != cid or not 1 <= owned.get('session', 0) <= 15: + # session 0: no PDU session ID was sent (the modem chose one). + if owned.get('cid') != cid or not 0 <= owned.get('session', -1) <= 15: raise RuntimeError('invalid bearer ownership record') result.add(cid) return result @@ -88,8 +98,15 @@ def setup_payload(cid, radio_technology, pdu_session, apn, *, ims=False, ip_type full[0xda] = IP_TYPES['ipv6'] if ims else IP_TYPES[ip_type] full[0xdb] = 2 if ims else 0 # IPv6 P-CSCF request # No handover addresses, roaming override or slice. - # MTU at 0xf1 stays zero (network/default choice). + # 0xf1 (u32): the APN-type bitmap, as stock's builder copies it from + # ApnSetting's supported types (vendor.radio.base + # ApnSetting::SetSupportedTypesBitmask, member +0x160; the 983-byte + # builder writes it at 0xf1). DEFAULT for the internet bearer, IMS for + # the IMS one. Until 0.3.6 this was sent as 0 (taken for an MTU), and + # the 9a's modem answered every internet setup with status 36. + struct.pack_into(' 1: + count = payload[0] + size = (len(payload) - 1) // count + records = [] + for index in range(count): + record = payload[1 + index * size:1 + (index + 1) * size] + if len(record) >= 5: + records.append(struct.unpack_from('= deadline or now - last >= SETTLE_QUIET: + break + packet = client.next_indication(min(.5, deadline - now)) + if packet is None: + continue + seen += 1 + last = time.monotonic() + keep_packet(packet) + print(f'{label}: {describe(packet)}', flush=True) + if on_event: + # Handled as the service handles any indication (an SMS arriving + # now is stored and acknowledged), not only recorded. + on_event(packet) + print(f'{label}: {seen} indication(s), then quiet' if seen else f'{label}: quiet', flush=True) + +def listen_after_failure(client, seconds=5, on_event=None): + """After a refused setup, keep the channel open a few seconds and log + what the modem sends next: on 2026-11-02 two or three messages arrived + about a second after each status 36 and were dropped because the channel + had already closed. Message names and lengths only; for a data-call list + change, the per-record status, CID, active and PDP type, nothing else.""" + deadline = time.monotonic() + seconds + seen = 0 + while True: + remaining = deadline - time.monotonic() + if remaining <= 0: + break + packet = client.next_indication(min(1, remaining)) + if packet is None: + continue + seen += 1 + keep_packet(packet) + print(f'after the failure: {describe(packet)}', flush=True) + if on_event: + on_event(packet) + print(f'after the failure: {seen} indication(s) in {seconds} s', flush=True) + +def activate(client, apn, *, ims=False, ip_type='ipv4v6', lte_access=False, on_event=None): requested_cid = 2 if ims else 1 state_path, response_path = paths(requested_cid) state = client.request(0x0701) @@ -142,26 +243,28 @@ def activate(client, apn, *, ims=False, ip_type='ipv4v6', lte_access=False): if state_path.exists() or requested_cid in calls or calls != owned: raise RuntimeError('existing target or unresolved bearer ownership') allow_data(client) - allocated = client.request(0x061a) - if len(allocated) != 4: - raise RuntimeError('unexpected PDU-session response') - session = struct.unpack('= 4 and state[0] in (1, 5): + break + if second == 0: + print('registration lost after allowing data; waiting for it', flush=True) + time.sleep(1) + else: + raise RuntimeError('PS network is not registered after allowing data') + print('registration before the setup: PS state, reject, RAT', (state[0], state[1], state[3]), flush=True) + # No ALLOC_PDU_SESSION on cellular (module docstring): session 0. + session = 0 + # Persist ownership before setup. A timeout has an unknown outcome: the + # record stays while the modem may still be activating the bearer. + private_write(state_path, json.dumps({'cid': requested_cid, 'session': session}).encode()) released = False try: rat = 14 if lte_access else state[3] - print('data setup access RAT', rat, 'registered RAT', state[3], flush=True) + print('data setup access RAT', rat, 'registered RAT', state[3], 'PDU session ID', session, flush=True) result = client.request(0x0600, setup_payload(requested_cid, rat, session, apn, ims=ims, ip_type=ip_type), timeout=45) if len(result) < 132: @@ -169,9 +272,15 @@ def activate(client, apn, *, ims=False, ip_type='ipv4v6', lte_access=False): status, cid, raw_active, pdp = struct.unpack_from('= 3 and sim[2] <= 8 and len(sim) >= 3 + sim[2] * 63: print('SIM card state', sim[0], 'applications', [(sim[i], sim[i + 1]) for i in range(3, 3 + sim[2] * 63, 63)], flush=True) diff --git a/packages/omamobile-modem-sit/test/test_bringup.py b/packages/omamobile-modem-sit/test/test_bringup.py index e8f3e1911..a347908b7 100644 --- a/packages/omamobile-modem-sit/test/test_bringup.py +++ b/packages/omamobile-modem-sit/test/test_bringup.py @@ -52,6 +52,7 @@ def test_failed_data_setup_never_attempts_ims(self): with patch.object(bringup, 'wait_for'), patch.object(bringup, 'radio'), \ patch.object(bringup, 'initial_attach'), patch.object(bringup, 'provision_default_profile'), \ patch.object(bringup, 'nr_mode'), patch.object(bringup, 'activate', side_effect=TimeoutError), \ + patch.object(bringup, 'data_snapshot'), \ patch.object(bringup, 'start_stack') as stack, patch.object(bringup, 'register') as register: with self.assertRaises(TimeoutError): bringup.start(service, SETTINGS) diff --git a/packages/omamobile-modem-sit/test/test_data_call.py b/packages/omamobile-modem-sit/test/test_data_call.py index a3c4dee5f..27ebf1e23 100644 --- a/packages/omamobile-modem-sit/test/test_data_call.py +++ b/packages/omamobile-modem-sit/test/test_data_call.py @@ -19,6 +19,9 @@ def __init__(self, status=0, fail_release=False): self.status = status self.fail_release = fail_release + def next_indication(self, timeout=1): + return None + def request(self, ident, payload=b'', **kwargs): self.sent.append((ident, payload)) if ident == 0x0701: @@ -45,7 +48,9 @@ def setUp(self): self.state = root / 'owned.json' self.response = root / 'response.bin' self.patches = [patch.object(data_call, 'STATE', self.state), - patch.object(data_call, 'RESPONSE', self.response)] + patch.object(data_call, 'RESPONSE', self.response), + patch.object(data_call, 'SETTLE_QUIET', 0), + patch.object(data_call, 'SETTLE_LIMIT', 0)] for item in self.patches: item.start() @@ -54,14 +59,107 @@ def tearDown(self): item.stop() self.directory.cleanup() - def test_rejected_setup_releases_pdu_without_creating_ownership(self): + def test_rejected_setup_leaves_no_ownership(self): modem = Modem(status=36) with self.assertRaises(RuntimeError): data_call.activate(modem, APN) - self.assertEqual(modem.sent[-1], (0x061b, struct.pack('