Getting the Sierra Wireless EM7455 LTE modem working in a ThinkPad with Debian 12 Linux (with GPS)

tl;dr

I wonder if just running

sudo ln -sft /etc/ModemManager/fcc-unlock.d /usr/share/ModemManager/fcc-unlock.available.d/*

would have done the trick?

Anyway…

Background

I have a Lenovo ThinkPad X1 Yoga (Gen 2). I set it up with Debian and it works really well.

But I’ve regretted not having the WWAN modem module (and wiring in the screen) for it so, when a very similar machine came up on eBay for £100, I decided it was worth a try. I’d buy the machine and, assuming that the screen was in a reasonable state, swap out its motherboard for my machine’s motherboard, and then have a machine which had my motherboard and “donor” machine’s chassis, screen, and - after switching it across - WWAN modem.

Swapping motherboards

Replacing the motherboard in the donor machine with the motherboard from my machine was simple. It took about an hour to get both machines apart, swapped, and reassembled.

Getting the EM7455 modem to work

Getting the modem to work was a bit of a chore learning exercise, and, in hindsight, I might have gone about it the wrong way.

But it does work, and works well based on initial testing.

(Warning: I’m writing this blog post based on the (not quite good enough) notes that I took, and my shell history. So while I hope it is correct and complete, it might not be.)

To discover the device, I ran lsusb:

Bus 001 Device 002: ID 1199:9079 Sierra Wireless, Inc. EM7455

In GNOME, the modem showed up straight away, but had no signal.

Here’s what I did.

Changing the modem’s composition

I changed the modem’s USB composition to enable AT command ports.

First, I installed some utilities:

sudo apt install libqmi-utils libmbim-utils -y

Then I changed the modem’s composition:

sudo qmicli -d /dev/cdc-wdm0 --dms-swi-set-usb-composition=6

(If this fails, you might need to stop ModemManager: sudo systemctl stop ModemManager. I can’t recall if I had to do this or not.)

I then followed the instructions to power-cycle the modem:

sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=offline
sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=reset

After that, I checked the modem’s composition:

sudo qmicli -d /dev/cdc-wdm0 --dms-swi-get-usb-composition

The output was:

[/dev/cdc-wdm0] Successfully retrieved USB compositions:
	[*] USB composition 6: DM, NMEA, AT, QMI
	    USB composition 8: DM, NMEA, AT, MBIM
	    USB composition 9: MBIM

Updating the EM7455’s firmware update

I downloaded the latest generic firmware from Sierra Wireless.

I unzipped it, resulting it two files (a .cwe and .nvu).

To do the update, I ran:

sudo qmi-firmware-update -d 1199 -u *.cwe *.nvu

This was quite slow - a few minutes - and gave me a lengthy output:

loading device information before the update...
setting firmware preference:
  firmware version: '02.33.03.00'
  config version:   '002.072_001'
  carrier:          'GENERIC'
rebooting in download mode...
download mode detected
downloading cwe image: SWI9X30C_02.33.03.00.cwe (64.3 MB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 73.79s (871.6 kB/s)
downloading cwe image: SWI9X30C_02.33.03.00_GENERIC_002.072_001.nvu (3.3 kB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 0.05s (61.3 kB/s)
rebooting in normal mode...
normal mode detected

------------------------------------------------------------------------
    NOTE: in order to validate which is the firmware running in the
    module, the program will wait for a complete boot; this process
    may take some time and several retries.
------------------------------------------------------------------------

waiting some time for the device to boot...
loading device information after the update (1/12)...

------------------------------------------------------------------------

   original firmware revision was:
      SWI9X30C_02.24.03.00 r6978 CARMD-EV-FRMWR2 2017/03/02 13:36:45
   original running firmware details:
      Model: EM7455
      Boot version: SWI9X30C_02.24.03.00
      AMSS version: SWI9X30C_02.24.03.00
      SKU ID: 1103158
      Carrier ID: 202
      Config version: 001.001_000
   original firmware preference details:
      image 'modem': unique id '001.001_000', build id '02.24.03.00_VODAFONE'
      image 'pri': unique id '001.001_000', build id '02.24.03.00_VODAFONE'

   new firmware revision is:
      SWI9X30C_02.33.03.00 r8209 CARMD-EV-FRMWR2 2019/08/28 20:59:30
   new running firmware details:
      Model: EM7455
      Boot version: SWI9X30C_02.33.03.00
      AMSS version: SWI9X30C_02.33.03.00
      SKU ID: 1103158
      Carrier ID: 1
      Config version: 002.072_001
   new firmware preference details:
      image 'modem': unique id '002.072_001', build id '02.33.03.00_GENERIC'
      image 'pri': unique id '002.072_001', build id '02.33.03.00_GENERIC'

   NOTE: this device supports stored image management
   with qmicli operations:
      --dms-list-stored-images
      --dms-select-stored-image
      --dms-delete-stored-image

   NOTE: this device supports firmware preference management
   with qmicli operations:
      --dms-get-firmware-preference
      --dms-set-firmware-preference

------------------------------------------------------------------------

firmware update operation finished successfully

(I tried it before I changed the modem’s composition. That failed, with:


loading device information before the update...
error: couldn't open QMI device: Failure

)

But it still did not work.

The problem appears to be that the modem starts in lower power mode.

I discovered this by poking around using minicom (below).

Disabling low power mode

To change the modem’s power mode, I ran:

sudo qmicli -d /dev/cdc-wdm0 --dms-set-fcc-authentication

This returned:

[/dev/cdc-wdm0] Successfully set FCC authentication

After that, I restarted ModemManager:

sudo systemctl enable --now ModemManager

After a few moments, it appeared within Network Manager / GNOME, showing that it was connected to the cellular network.

Success!

But it did not survive rebooting.

Making it work on reboot

After a reboot, the WWAN module starts in low power mode.

To kick it into a working mode, I need to stop ModemManager, set FCC authentication, and then restart ModemManager.

So easy - and easy enough to script - as a workaround, I wanted to find out why it does that, and fix it.

sudo systemctl stop ModemManager
sudo qmicli -d /dev/cdc-wdm0 --dms-set-fcc-authentication
sudo systemctl enable --now ModemManager

Digging around in the ModemManager documentation, I found the FCC unlock page.

This suggested using:

sudo ln -sft /etc/ModemManager/fcc-unlock.d /usr/share/ModemManager/fcc-unlock.available.d/*

I did this, and now it works after reboot.

I wonder whether, if I’d done this as the beginning, it would have saved me all the faffing and tinkering with AT commands and a firmware update. But oh well - it is working now.

AT commands via minicom

To send AT commands to the modem, I used minicom:

sudo apt install minicom -y

I had to stop ModemManager, and run minicom as root:

sudo systemctl stop ModemManager

sudo minicom -o -D /dev/ttyUSB2 -b 9600

(I needed to have already run sudo qmicli -d /dev/cdc-wdm0 --dms-swi-set-usb-composition=6 to get minicom to work; see above.)

Use ATE1 to echo commands back at you.

The most helpful command for me was At!gstatus?, which produced:

!GSTATUS: 
Current Time:  2115             Temperature: 36
Reset Counter: 1                Mode:        LOW POWER MODE 

This showed me the problem, which I could then fix.

The EM7455’s GPS receiver

The EM7455 has a GPS receiver.

I don’t have a use for it, but I was curious to see if I could make it work.

This guide was incredibly helpful.

Using minicom, I did:

AT!ENTERCND="A710"

AT!CUSTOM="GPSENABLE",1

I then ran:

AT!GPSFIX=1,30,10

Which returned “Error”.

Lastly:

AT!GPSLOC?

Which returned my location:

Lat: 51 Deg 24 Min 49.64 Sec N  (0x00923E61)
Lon: 1 Deg 19 Min 1.98 Sec W  (0xFFFC40D5)
AT!GP 2024 01 25 3 22:17:54 (GPS) 
Current time: 2024 01 25 3 22:17:47

2024 01 25 3 22:17:47 Last Fix Status    = SUCCESS
2024 01 25 3 22:17:47 Fix Session 

I haven’t looked into gpsd, or how I might make use of this (a clever person suggested ntp), but nice to know that it works.

NFC

The donor chassis also has an NFC reader. I don’t have high hopes for making this work, as I haven’t seen anyone saying that they’ve managed it.

I tried with:

sudo apt install libnfc-bin -y

And then:

nfc-list

But it returned:

nfc-list uses libnfc 1.8.0
No NFC device found.

I’ve checked that it is plugged in correctly, so perhaps it is a drivers issue. Either way, no luck yet.