Skip to content

fix(4g): make 4G reachable — dongle probe is the gate, re-enable Mini 4 Pro - #40

Merged
doesthings merged 1 commit into
mainfrom
fix/4g-gate-mini-support
Aug 9, 2026
Merged

doesthings merged 1 commit into
mainfrom
fix/4g-gate-mini-support

Conversation

@doesthings

Copy link
Copy Markdown
Owner

The bug: 4G could never activate on any aircraft

The model gate in send4gActivationFrames() was self-contradictory:

  • Guard 1 rejected serials < 6 chars. But probeSerial()'s model-code fallback returns exactly 5 chars (WA341, WM630, WA140) → always rejected as "too short."
  • Guard 2 did serial.take(5). But probeSerial() prefers the full 1581… factory serial, whose first 5 chars are "1581x" → never in the allowlist.

So a full serial failed Guard 2, and a short model code failed Guard 1. 4G activation was unreachable regardless of hardware — this is why "make 4G work" kept hitting a wall.

Fix

  • is4gDonglePresent() is now the single authoritative gate. If the /duss/mb/0x205 abstract socket is connectable, a cellular module is attached — that's ground truth, unlike a hardcoded model list that can't even be extracted from a 1581… serial.
  • Require only a non-empty serial for the payload (dropped the bogus length floor).
  • The model allowlist is now an advisory log note, matched with a regex that finds a W[AM]xxx code anywhere in the serial (or nothing) — never a hard block.
  • Re-added wa140 (Mini 4 Pro). DJI's Cellular Dongle 2 is officially compatible with the Mini 4 Pro (with the 4G mounting kit), Air 3, Air 3S, Matrice 4T/4E. The prior "Mini has no cellular" exclusion was factually wrong.
  • Fixed the misleading "only on Mavic 4 Pro / Matrice / Inspire 3" message.

Safety

  • Send-only path is unchanged (NO_ACK, unverifiable — as documented). No frames, ports, timing, or CRC touched.
  • The FCC path is completely untouched.
  • Built locally: assembleRelease + testDebugUnitTest green.

⚠️ Needs on-hardware confirmation

This makes 4G reachable; whether the Mini 4 Pro actually activates must be confirmed on a real dongle-equipped aircraft before cutting a release.

…i 4 Pro

The 4G model gate could never pass for ANY aircraft:
- Guard 1 rejected serials < 6 chars, but probeSerial()'s model-code fallback
  ("WA341") is exactly 5 chars, so it was always rejected as "too short".
- Guard 2 did serial.take(5), but probeSerial() prefers the full 1581...
  factory serial, whose first 5 chars ("1581x") are never a model code.
Full serial -> failed Guard 2; short model code -> failed Guard 1. 4G was
unreachable regardless of hardware.

Fix:
- is4gDonglePresent() (/duss/mb/0x205 socket) is now the single authoritative
  gate: if the cellular module is attached, proceed.
- Require only a non-empty serial for the payload (drop the bogus length floor).
- Demote the model allowlist to an advisory log note; extract a W[AM]xxx code
  from anywhere in the serial (or nothing) instead of assuming take(5).
- Re-add wa140 (Mini 4 Pro): DJI's Cellular Dongle 2 is officially compatible
  with Mini 4 Pro (with the 4G mounting kit), Air 3, Air 3S, Matrice 4T/4E, so
  the earlier "Mini has no cellular" exclusion was wrong.
- Fix the misleading "only on Mavic 4 Pro / Matrice / Inspire 3" message.

Send-only behavior unchanged (NO_ACK, unverifiable); FCC path untouched.
Needs on-hardware confirmation on a real dongle-equipped aircraft.
@doesthings
doesthings merged commit 1a3d4db into main Aug 9, 2026
2 checks passed
@doesthings
doesthings deleted the fix/4g-gate-mini-support branch August 9, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant