I believe the reason can be in the kernel config and patches (mentioned here). Could you sent the output of lsusb
to check the vid:pid
variables together with Mobian kernel version? Could you also do the same (lsusb
) and check if ttyUSBx
are exist in the next time when you will check Cri
or Byz
images?
Finally got around to do this. The lsusb
for this card is 1e0e:9001 Qualcom / Option [...]
It’s seen by Crimson (backports) as a usb device but not by mmcli, so it doesn’t exist as a modem there. No /dev/ttyUSB*s created, I’m afraid.
Something to note is that unlike most vendors, as I’ve understood it, Simcom doesn’t differentiate different models via that ID (there are some internal command to change that ID for specific usecases but those do not help here), which has been a problem with the qmi driver. Hence, with Mobian, my surprise was great when the card came to life and was recognized.
I’ll see if I can pull any more info out from the systems tomorrow-ish.
Ok, so, after a lot of log lines compared from the two systems, and several dead ends, I think I finally got the 8202g modem alive in PureOS Crimson backports. I’m expecting that up to date kernel and modem manager are needed (6.6.-librem5 and 1.24.0 should do). I’m going to verify this with Byzantium in a moment (some testing will be skipped until tomorrow), and also see if settings persist (haven’t thought about that far yet).
Needed steps seem to be in the end:
- loading a couple of missing kernel modules with modprobe for drivers that PureOS kernel has commented out but luckily are already present (option, qmi_wwan, cdc_wdm)
- authorizing usb device (since PureOS kernel is hardened):
echo 1 | sudo tee /sys/bus/usb/devices/usb*/authorized_default
[not good, as this allows all] and/orecho 1 | sudo tee /sys/bus/usb/devices/1-1.2/authorized
[specific device path used identified from lsusb and logs] - setting up udev rules (not sure if works without 2. step):
maybe create/etc/udev/rules.d/99-modem-authorize.rules
withACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1e0e", ATTR{idProduct}=="9001", ATTR{authorized}="1"
(reload rules withsudo udevadm control --reload-rules && sudo udevadm trigger
) - binding the modem manually (not sure if needed):
echo 1e0e 9001 | sudo tee /sys/bus/usb-serial/drivers/option1/new_id
Then flick the modem HW switch to off and back to on, check with ls /dev/ttyUSB*
if there are USB devices 0-4 (modem may appear a few seconds later - it’s not the fastest to appear).
Yes, it works! I got the modem to give 5G in PureOS byzantium backports (didn’t have non-backports available, but shouldn’t be a problem if kernel and modemmanager are recent enough [no idea how recent], so update first). Needed steps are (but they are not persistent, so need to do after every reboot - not sure how, as first tries didn’t take):
- Load missing kernel modules with
sudo modprobe option && sudo modprobe qmi_wwan && sudo modprobe cdc_wdm
- Authorize usb device with
echo 1 | sudo tee /sys/bus/usb/devices/1-1.2/authorized
[specific device path used (that 1-1.2) is identified from lsusb and logs from turning modem HWKS on/off/on and doingsudo dmesg | tail - 50
] - Set up udev rules with
sudo nano /etc/udev/rules.d/99-modem-authorize.rules
where add the line
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1e0e", ATTR{idProduct}=="9001", ATTR{authorized}="1"
and can now reload rules withsudo udevadm control --reload-rules && sudo udevadm trigger
- Flick the modem HWKS off and back to on, check with
ls /dev/ttyUSB*
that there are USB devices 0-4. Modem should appear in a few seconds later (it’s not the fastest to appear). - Check mobile network settings from Settings (or from top slider if newer phosh) and enable mobile data (LTE) to remove the orange marker from the mobile connection icon (may need a proper SIM card).
And just to note: this is how I got it to work, but it’s manual and this may not be the most efficient way. The modprobes and rules re-load and trigger, and maybe modem power cycling, need to happen at boot to get this persistent… if anyone has suggestions…
Tested the manual modem installation with normal old PureOS byzantium and since it has older modemmanager, it only offers 4G (5G is not an option).
[Edit to add: Just a though, but as this troubleshooting has shown the challenges, it seems to me VERY likely that some other modems could also be options on PureOS/Librem5 - not sure if there are any other suitable 5G options, though]
Here are the steps to install Sim8202g m.2 alternative 5G global modem and the workaround to get the the modem persistently available in Librem 5. I guess @dos or someone can use it to make something permanent and built-in to PureOS.
Tested on PureOS basic Byzantium and Crimson backports.
Steps in general:
0. Physically install the modem. See some pointers for instance from the disassembly manual or video. Be careful with the antenna connectors, use ANT0 and ANT3.
Doing
lsusb
should show “1e0e:9001 Qualcom / Option…” somewhere in the list.
- Copy the two scripts from below to text files and name the as shown.
- Place both of the scripts to appropriate folders, as shown.
- Run the shown commands to make sure the scripts run.
- Reboot. Expect to see in the left corner the 5G icon (4G if you use old ModemManager, or maybe if you don’t have 5G service available or contract).
init-sim8202g.sh (script to add missing stuff with automatic fetch of modem path)
#!/bin/bash
# This is Sim8202g modem installation workaround persisntance script (part 1 0f 2) to Librem5: init-sim8202g.sh
# place this: sudo cp init-sim8202g.sh /usr/local/bin/
# and also do: sudo chmod +x /usr/local/bin/init-sim8202g.sh
# The other is init-sim8202g.service which should be placed: sudo cp init-sim8202g.service /etc/systemd/system/
# and also do: sudo systemctl enable init-sim8202g.service
# reboot and check logs if needed (journalctl -u init-sim8202g.service)
# Load kernel modules
modprobe option
modprobe qmi_wwan
modprobe cdc_wdm
# Dynamically find the USB device path for the modem
DEVICE_PATH=$(find /sys/bus/usb/devices/ -maxdepth 1 -name "1-*" -exec grep -l "1e0e" {}/idVendor 2>/dev/null \; | xargs -I{} dirname {})
if [ -n "$DEVICE_PATH" ]; then
echo 1 > "$DEVICE_PATH/authorized"
else
echo "Modem USB device not found" >&2
exit 1
fi
# Reload udev rules
udevadm control --reload-rules
udevadm trigger
# Wait for udev to settle
sleep 5
# Send AT+CFUN=1,1 to reset the modem via AT command port
if [ -e /dev/ttyUSB2 ]; then
echo -e "AT+CFUN=1,1\r" > /dev/ttyUSB2
else
echo "AT command port /dev/ttyUSB2 not found" >&2
fi
# Wait for modem to reinitialize
sleep 10
# Check for modem devices, report to log
if ls /dev/ttyUSB* 1>/dev/null 2>&1; then
echo "Modem Sim8202g initialized successfully."
else
echo "Modem Sim8202g ttyUSBs not detected." >&2
fi
Place this from the folder you have it with: sudo cp init-sim8202g.sh /usr/local/bin/
And also do: sudo chmod +x /usr/local/bin/init-sim8202g.sh
init-sim8202g.service (initialize the previous script at startup)
[Unit]
Description=Initialize Sim8202g modem
After=network.target
[Service]
ExecStart=/usr/local/bin/init-sim8202g.sh
Type=oneshot
[Install]
WantedBy=multi-user.target
Place this from the folder you have it with: sudo cp init-sim8202g.service /etc/systemd/system/
And also do: sudo systemctl enable init-sim8202g.service
Reboot:
- If success (which is very likely), check audio by making (unimportant) call (if no audio, check audio settings that you have right mic and output and that volume is up).
- If you don’t see the 5G (or 4G) icon, check logs if needed, start with:
journalctl -u init-sim8202g.service
If you see 4G (or lower) icon, check to see that you have 5G as an option in Settings → Mobile Network → Network Mode (it seems that without the rules and installed modules other icons may show up intermittently in crim).
[I’ve had one random occasion when the audio disappeared but haven’t been able to reproduce the problem and reboot has fixed it. Oh, and just to make a note of the “first” of it, I’ve now done the linux PureOS Librem5 5G to Librem5 5G call. The main parts of this thread have been added to the community wiki, where any further how-to steps and info can be edited.]
[Edit to add: Before anyone asks, Purism has responded they are aware of this development. I’d expect it to take a moment to do proper testing and commercial planning.]
Very nice work!
So, I feel like you are saying that your 5G rig is more stable than the stock U.S. Evergreen setup. Would you say that’s true? My stock Evergreen drops, hangs, freezes or otherwise looses cell connectivity about four times a week (but I would never trade it for a spy phone), so I would consider your 5G conversion on that basis alone.
That has been my experience so far, yes. I only have limited testing, but it seems to work more reliably. To emphasize, the card is not new, but it has more mature tech [than BM818 as it’s newer that that] and more efficient chip (also [potentially] more power efficient, in addition to other features). But, I have also noticed that there are still some issues that now seem to pinpoint more to Calls app or something else that is not modem or connection related - minor stuff, like, I once managed to “answer” a call but actually had to tap the answer button again to really answer. Having another modem gives troubleshooting a comparison to work with. It will take more people with the modem to really suss out any remaining quirks and really see how well it behaves (in all the device setup variations in all the different networks globally).