EM120R-GL for Linux

Dear,

I bought the latest Lenovo X9, used Fedora on it, and only hardware not working out of the box is the Quectel modem.

I can see it under a lspci:
08:00.0 Unassigned class [ff00]: Device 1eac:1001

Seams driver is missing.

Would it be possible to get a working driver for Linux, please?

Thanks!

Hi,
Thanks for your query in Quectel forums.
We cannot provide this linux driver directly to the end user, because there will be authentication problems when installing this driver. Lenovo will launch a customized ubuntu in the future. It is recommended that you obtain it from Lenovo.
Thanks.

This device is supported by the mhi_pci_generic driver in Linux v5.13 and later. See bus: mhi: pci_generic: Introduce quectel EM1XXGR-L support - kernel/git/torvalds/linux.git - Linux kernel source tree

You’d want to run the mhi_net driver on top of that for MBIM support.

But there might be Lenovo platform specific issues, as @Kerr.Yang-Q indicates.

After you have the 5.13+ kernel installed you will see the device in network-manager. The main problem is that there is still an FCC lock on it which prevents you from enabling it in modem-manager. Hopefully it gets added to the https://snapcraft.io/lenovo-wwan-dpr snap. Until then I was able to get it working on a Lenovo X1 Yoga (Gen 6), Ubuntu 20.10, 5.13 kernel, Google Fi Data-Only SIM, and the following…

# Download network-manager, modem-manager, etc.,...
sudo apt update
sudo apt install network-manager network-manager-gnome modemmanager libqmi-utils gcc
# Reference: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/402#note_1064882
mkdir ~/Downloads/lenovo/snap
cd ~/Downloads/lenovo
# Download the snap
snap download lenovo-wwan-dpr --edge
# Extract the snap files
sudo mount -t squashfs -o ro lenovo-wwan-dpr_5.snap /home/$whoami/Downloads/lenovo/snap
# Download script by Joar Wandborg
wget https://gist.githubusercontent.com/joar/416f37fe81558f5be0d5131018eb7f2a/raw/b6a2a83620b044efc2d13aee86910743969218de/fcc-unlock.c
# TODO: manually modify the define statements in fcc_unlock.c appropriately
#define MBIM_DEVICE_PATH "/dev/wwan0p2MBIM"
#define MBIM2SAR_SO_PATH "/home/jonfen/Downloads/lenovo/snap/usr/lib/mbim2sar.so"
# Compile the script
gcc -o fcc_unlock_v2 fcc_unlock.c
# Run the script
sudo env VERBOSE=1 ./fcc_unlock_v2 
# Enable the modem
mmcli -v --modem=0 -e
# Setup the connection, for Google Fi just pick the default T-Mobile profile, ignore their h2g2 APN  
nm-connection-editor &
modem-manager-gui &

That’s very interesting. I wonder if it would be possible to snoop those MBIM messages so that we could add proper open source support for them? This would allow automatic unlocking from ModemManager, similar to what we have for the Sierra Wireless FCC lock implementation.

Maybe add some debug buffer printk’s in drivers/net/wwan/wwan_core.c? If I read the code correctly, those messages go through wwan_port_fops_write() and wwan_port_fops_read(). Should be pretty simple fo add a couple of print_hex_dump() lines there.

EDIT: forget it. I see that Joar already included those dumps with the tool. Full discussion at https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/402

Hi,

I have adapted jonfens approach to work with the Thinkpad X1 Carbon Gen9:

# Download network-manager, modem-manager, etc.,...
sudo apt update
sudo apt install network-manager network-manager-gnome modemmanager libqmi-utils gcc
# Reference: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/402#note_1064882
mkdir ~/lenovo/snap
cd ~/lenovo
# Download the snap
snap download lenovo-wwan-dpr --edge
# Extract the snap files
sudo mount -t squashfs -o ro lenovo-wwan-dpr_13.snap /home/$whoami/lenovo/snap
# Download script by Joar Wandborg
wget https://gist.githubusercontent.com/joar/416f37fe81558f5be0d5131018eb7f2a/raw/b6a2a83620b044efc2d13aee86910743969218de/fcc-unlock.c
# TODO: manually modify the define statements in fcc_unlock.c appropriately
#define MBIM_DEVICE_PATH "/dev/wwan0mbim0"
#define MBIM2SAR_SO_PATH "/home/[username]/lenovo/snap/usr/lib/mbim2sar.so"
# Compile the script
gcc -o fcc_unlock_v2 fcc-unlock.c
# Run the script
sudo env VERBOSE=1 ./fcc_unlock_v2 
# Enable the modem (use mmcli --list-modems to get the modem index - in this case 0)
mmcli -v --modem=0 -e
# Setup the connection, for Google Fi just pick the default T-Mobile profile, ignore their h2g2 APN  
nm-connection-editor &
modem-manager-gui &```

Thanks @Christoph for your answer.

Here is an automated script which does what @Christoph 's script does but in a fully automated manner (the TODO section is automated!)

#! /bin/bash
# Download network-manager, modem-manager, etc.,...
sudo apt update
sudo apt install network-manager network-manager-gnome modemmanager libqmi-utils gcc
# Reference: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/402#note_1064882
mkdir -p ~/lenovo/snap
cd ~/lenovo
# Download the snap
snap download lenovo-wwan-dpr --edge
# Extract the snap files
sudo mount -t squashfs -o ro lenovo-wwan-dpr_13.snap /home/$(whoami)/lenovo/snap
# Download script by Joar Wandborg
wget https://gist.githubusercontent.com/joar/416f37fe81558f5be0d5131018eb7f2a/raw/b6a2a83620b044efc2d13aee86910743969218de/fcc-unlock.c
# automatically change the defines in fcc-unlock.c
sed 's@#define MBIM_DEVICE_PATH \(.*\)$@#define MBIM_DEVICE_PATH "/dev/wwan0mbim0"@g' -i fcc-unlock.c
sed "s@#define MBIM2SAR_SO_PATH \(.*\)\$@#define MBIM2SAR_SO_PATH \"/home/$(whoami)/lenovo/snap/usr/lib/mbim2sar.so\"@g" -i fcc-unlock.c
# Compile the script
gcc -o fcc_unlock_v2 fcc-unlock.c
# Run the script
sudo env VERBOSE=1 ./fcc_unlock_v2 
# Enable the modem (use mmcli --list-modems to get the modem index - in this case 0)
mmcli -v --modem=0 -e
# Setup the connection, for Google Fi just pick the default T-Mobile profile, ignore their h2g2 APN  
nm-connection-editor &
modem-manager-gui &

1 Like

hi :slight_smile:
got a error in the script
using ubuntu 22.04
any advice very apreciatded

HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 2019 (2.0K) [text/plain]
Wird in ‘fcc-unlock.c.1’ gespeichert.

fcc-unlock.c.1 100%[===================>] 1.97K --.-KB/s in 0s

2023-05-24 19:41:24 (11.0 MB/s) - ‘fcc-unlock.c.1’ gespeichert [2019/2019]

./script: Zeile 20: 3672 Speicherzugriffsfehler sudo env VERBOSE=1 ./fcc_unlock_v2
[24 Mai 2023, 19:41:24] [Debug] ModemManager process found at ‘:1.15’
[24 Mai 2023, 19:41:24] [Debug] Assuming ‘0’ is the modem index
[24 Mai 2023, 19:41:24] [Debug] Modem found at ‘/org/freedesktop/ModemManager1/Modem/0’

[24 Mai 2023, 19:41:24] [Debug] Synchronously enabling modem…
error: couldn’t enable the modem: ‘GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: modem in failed state’
claib@TP-T490sCL:~$ Connection manager: Network Manager >= 0.9.0
Modem manager: Modem Manager >= 0.7.0

this worked for me just fine after rebooting the module is working properly
Ubuntu 22.04
Thinkpad T15 gen 2
EM120R-GL LTE Modem
kernal : 6.2.0-26-generic
i had to install lenovo-wwan-dpr_24.snap instead

If anyone is still monitoring this I would appreciate any help. I am using Fedora on a Carbon X9 and my Linux knowledge is simply not enough to adequately follow the above.

I get this far:

nobara-pc:~/lenovo$ sudo mount -t squashfs -o ro lenovo-wwan-dpr_13.snap /home/$(whoami)/lenovo/snap
mount: /home/gb/lenovo/snap: special device lenovo-wwan-dpr_13.snap does not exist.
dmesg(1) may have more information after failed mount system call.

Any help would be appreciated
David

Sorry I don’t understand why you did it.
What is the problem and which Quectel modem you are using now?

Hi and thanks for the reply, i have fedora running on a Carbon X9 and would love to get the 4g Modem working. Its a EM120R-GL 4G LTE CAT12;

I have tried the commands for the terminal above (all i can do is copy and paste into the terminal, i don’t really understand what the commands all mean). I am not able to get the 4g modem to work. There is simcard in. When booting windows 10 it works.

Thanks

@David_de_Jong
Let’s just test wether it works on the Linux.
Please check:

**lsusb **
lsub -t
cat /sys/kernel/debug/usb/devices
uname -a

I am not familar with the Carbon X9. As I know fedora is similar with the CentOS, there is an default ModemManager it.

sorry, its a Lenovo Think Carbon X1, 9th Gen

here is the output

gb@nobara-pc:~$ sudo lsub -t
cat /sys/kernel/debug/usb/devices
uname -a
[sudo] Passwort fĂźr gb:
sudo: lsub: Befehl nicht gefunden
cat: /sys/kernel/debug/usb/devices: Keine Berechtigung
Linux nobara-pc 6.8.7-201.fsync.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC TKG Sun Apr 28 08:28:35 UTC 2024 x86_64 GNU/Linux

translated it says command not found and no authorisation

I wonder if Linux didn’t recognize the Quectel module.

“no authorisation” should have told you that you need to use sudo:
sudo cat /sys/kernel/debug/usb/devices