Home Blog

eSIM and WWAN on a ThinkPad P14s under Arch

I put these notes together while setting up a Quectel WWAN modem and an eSIM on a ThinkPad P14s Gen 5 AMD running Arch. The setup involved firmware, FCC unlocking, slot selection, and profile management, with the instructions spread across several sources.

At the time of writing, the profile downloaded and enabled successfully, but I had not got the modem connected to the network. The final section records that unresolved state.

Hardware

Component Value
Laptop ThinkPad P14s Gen 5 AMD
Modem Quectel RM520N-GL (5G, Qualcomm)
USB ID 2c7c:0801
Firmware RM520NGLAAR03A03M4G
SIM slots 1 = physical nano-SIM, 2 = embedded eSIM (eUICC)
eUICC free memory ~411 KB
AT port /dev/wwan0at0
MBIM port /dev/wwan0mbim0

The two device nodes matter. lpac talks to the eUICC over the AT port, while radio state is set over MBIM. Reaching for the wrong one produces errors that look like hardware faults.

1. Firmware

I used fwupdmgr for the firmware update, but had to downgrade fwupd to 1.9.x from the Arch Archive. With the newer version I tried, the update did not work. Stop ModemManager and unload libmbim/libqmi first to avoid a busy-device failure.

fwupdmgr refresh --force
fwupdmgr get-devices
fwupdmgr update

Confirm the modem still answers afterwards:

minicom -D /dev/wwan0at0

Type AT, expect OK.

2. FCC unlock

Lenovo ships the modem FCC-locked. The radio stays off until an unlock runs. ModemManager has the script, it just is not wired up:

sudo ln -s /usr/share/ModemManager/fcc-unlock.available.d/1eac \
           /etc/ModemManager/fcc-unlock.d/1eac:1007

If the automatic unlock does not take, force the radio on directly:

mbimcli --device-open-proxy --device="/dev/wwan0mbim0" \
        --quectel-set-radio-state=on

There is also an AUR package that handles this as a service:

yay -S lenovo-wwan-unlock
sudo systemctl enable --now lenovo-wwan-unlock

3. Switch to the eSIM slot

The eUICC is slot 2. Stop ModemManager before touching the AT port, otherwise the two fight over it:

sudo systemctl stop ModemManager
sudo minicom -D /dev/wwan0at0
AT+QUIMSLOT=2

AT+QUIMSLOT? reports the current slot.

4. Install lpac

lpac is the eSIM profile manager, the LPA in the specification's terms.

paru -S lpac-git
sudo pacman -S pcsclite ccid
sudo systemctl enable --now pcscd.socket

Pass the environment variables after sudo, as part of the command it runs:

sudo LPAC_APDU=at LPAC_APDU_AT_DEVICE=/dev/wwan0at0 lpac chip info

When I set them before sudo, they did not reach lpac. It fell back to PC/SC and failed with SCardEstablishContext, which initially sent me looking at the smartcard daemon.

Also note the older names AT_DEBUG and AT_DEVICE are deprecated. Use LPAC_APDU_AT_DEBUG and LPAC_APDU_AT_DEVICE.

5. Download a profile

An eSIM QR code encodes LPA:1$<SMDP_ADDRESS>$<ACTIVATION_CODE>. Split it on the $ and feed the halves in:

sudo LPAC_APDU=at LPAC_APDU_AT_DEVICE=/dev/wwan0at0 \
     lpac profile download -s <SMDP_ADDRESS> -m "<ACTIVATION_CODE>"

The download needs an existing internet connection, such as Wi-Fi. It cannot use the cellular profile being installed.

6. Enable it

The downloaded profile still needs to be enabled. Before that step, mine reported esim-without-profiles, despite the successful download:

sudo LPAC_APDU=at LPAC_APDU_AT_DEVICE=/dev/wwan0at0 \
     lpac profile enable <ICCID>

Then reset the modem from minicom so it re-reads the eUICC:

AT+CFUN=1,1

7. Connect

sudo systemctl start ModemManager
mmcli -m 0 --enable
nmcli connection add type gsm ifname "*" con-name <name> apn <apn>
nmcli connection up <name>

Known issues

These are the failures I encountered during setup:

The part that does not work

The profile is installed and enabled. The modem does not attach.

mmcli -m 0 --3gpp-scan fails with PhoneFailure even directly after a successful radio-state-on, and the correct APN for the provider is still unknown; the plausible candidates each fail the same way, so the scan failure is probably the real blocker rather than the APN.

I still need to determine whether newer RM520NGL firmware fixes the repeated resets, and whether the provider requires another activation step. I will update this post when the connection works.

Command reference

Task Command
List modems mmcli -L
Modem details mmcli -m 0
Network scan mmcli -m 0 --3gpp-scan
Radio on mbimcli --device-open-proxy --device="/dev/wwan0mbim0" --quectel-set-radio-state=on
eUICC info sudo LPAC_APDU=at LPAC_APDU_AT_DEVICE=/dev/wwan0at0 lpac chip info
List profiles sudo LPAC_APDU=at LPAC_APDU_AT_DEVICE=/dev/wwan0at0 lpac profile list
Enable profile sudo LPAC_APDU=at LPAC_APDU_AT_DEVICE=/dev/wwan0at0 lpac profile enable <ICCID>
Modem reset AT+CFUN=1,1 (minicom)
Check SIM slot AT+QUIMSLOT? (minicom)
Switch to eSIM AT+QUIMSLOT=2 (minicom)

Your own IMEI, EID, and ICCID appear throughout lpac and mmcli output. They identify your hardware and your SIM subscription, so keep them out of anything you paste into a forum thread or an issue tracker.