How to Install Sierra firmware within OpenWRT CLI?

I understand typically the firmware upgrades are done via having the module attached to a windows PC using a USB mini-pcie adapter, and sierra drivers are installed and then the firmware is flashed to the module via a simple executable install.

Are there procedures to do something similar while the module is installed in an openwrt router…so without having to take out the module and use a usb-minipcie adapter?

You can update via Linux, but may need to compile SW software, and then install into OpenWRT. There is also firmware update functionality (specifically for MC74XX I believe) built into QMI on Linux (dl can probably speak to the minimum kernel version required). But this then assumes you are using QMI and not MBIM on OpenWRT.

Also, depending on your device, there may be size issues as the firmware packages are quite large (relative to a router’s memory).

To quote SW: "For Linux use the Binaries download packages. This is a zip file containing a CWE and NVU files that should be used in conjunction with the ‘Firmware_Download’ application (or equivalent API’s in an application) contained in the Linux SDK SampleApps "

Much appreciated for the reply.

The updater in libqmi does not really depend on a specific kernel version, and it supports older modems as well (both MC73xx and MC77xx). It supports both QMI and MBIM mode, using the QMI-in-MBIM service.

Aleksander provides OpenWrt packages for libqmi and libmbim, as well as ModemManager:
bitbucket.org/aleksander0m/modemmanager-openwrt

I don’t know the exact hardware requirements, but as you said: You’ll probably need a some free flash and RAM to use it.

And the usual disclaimer: This is community software provided on a best effort basis. If you want official SWI support for your embedded platform, then you should use the GobiSerial and GobiNet drivers along with the SWI QMI SDK. It includes firmware update tools and should run just fine on many OpenWrt platforms.

1 Like

And a real example upgrading a EM7455 running in MBIM mode (with QMI over MBIM) in an OpenWRT based system:

# qmicli -d /dev/cdc-wdm0 -p --dms-set-firmware-preference="02.24.03.00,002.023_000,ATT"
# qmicli -d /dev/cdc-wdm0 -p --dms-set-operating-mode=offline
# qmicli -d /dev/cdc-wdm0 -p --dms-set-operating-mode=reset
    (wait for single ttyUSB0 to appear)
# qmi-firmware-update -t /dev/ttyUSB0 --update-qdl \
    /tmp/firmware-EM7455/SWI9X30C_02.24.03.00.cwe \
    /tmp/firmware-EM7455/SWI9X30C_02.24.03.00_ATT_002.023_000.nvu
  downloading cwe image: SWI9X30C_02.24.03.00.cwe (64.4 MB)...
  finalizing download... (may take more than one minute, be patient)
  successfully downloaded in 73.46s (877.1 kB/s)
  downloading cwe image: SWI9X30C_02.24.03.00_ATT_002.023_000.nvu (11.1 kB)...
  finalizing download... (may take more than one minute, be patient)
  successfully downloaded in 0.06s (200.2 kB/s)
  rebooting in normal mode...
  firmware update operation finished successfully

# qmicli -d /dev/cdc-wdm0 -p --dms-swi-get-current-firmware
[/dev/cdc-wdm0] Successfully retrieved current firmware:
  Model: EM7455
  Boot version: SWI9X30C_02.24.03.00
  AMSS version: SWI9X30C_02.24.03.00
  SKU ID: 1102527
  Package ID: unknown
  Carrier ID: 4
  Config version: 002.023_000

Alexsander…I don’t see these options on x86_64 on debian strech. I have libqmi-utils 1.16.2-1.

dms-set-firmware-preference
qmi-firmware-update

EDIT: Nevermind, I am getting 1.18 from testing repo (buster).

I am getting this error:

qmi-firmware-update -t /dev/ttyUSB0 --update-qdl /tmp/SWI9X30C_02.24.05.06_Generic_002.026_000_1/SWI9X30C_02.24.05.06.cwe /tmp/SWI9X30C_02.24.05.06_Generic_002.026_000_1/SWI9X30C_02.24.05.06_GENERIC_002.026_000.nvu 

error: error creating device: unexpected response received in dload sdp: 0x70

UPDATE: Nevermind, ran the steps a few times and the modem was at the right “window” to accept the update command:

Package from here: https://source.sierrawireless.com/resources/airprime/minicard/74xx/fw/swi9x30c_02,-d-,24,-d-,05,-d-,06_generic_002,-d-,026_000

qmicli -d /dev/cdc-wdm0 -p --dms-set-firmware-preference="02.24.05.06,002.026_000,GENERIC"
qmicli -d /dev/cdc-wdm0 -p  --dms-set-operating-mode=offline
qmicli -d /dev/cdc-wdm0 -p  --dms-set-operating-mode=reset

qmi-firmware-update -t /dev/ttyUSB0 --update-qdl /tmp/SWI9X30C_02.24.05.06_Generic_002.026_000_1/SWI9X30C_02.24.05.06.cwe /tmp/SWI9X30C_02.24.05.06_Generic_002.026_000_1/SWI9X30C_02.24.05.06_GENERIC_002.026_000.nvu 
downloading cwe image: SWI9X30C_02.24.05.06.cwe (64.4 MB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 73.73s (873.9 kB/s)
downloading cwe image: SWI9X30C_02.24.05.06_GENERIC_002.026_000.nvu (3.9 kB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 0.05s (74.1 kB/s)
rebooting in normal mode...
firmware update operation finished successfully


qmicli -d /dev/cdc-wdm0 -p --dms-swi-get-current-firmware
[/dev/cdc-wdm0] Successfully retrieved current firmware:
	Model: EM7455
	Boot version: SWI9X30C_02.24.05.06
	AMSS version: SWI9X30C_02.24.05.06
	SKU ID: 1102717
	Package ID: unknown
	Carrier ID: 1
	Config version: 002.026_000

at!image?
TYPE SLOT STATUS LRU FAILURES UNIQUE_ID   BUILD_ID
FW   1    GOOD   1   0 0      ?_?         02.05.07.00_?
FW   2    GOOD   2   0 0      ?_?         02.08.02.00_?
FW   3    GOOD   3   0 0      ?_?         02.24.05.06_?
FW   4    EMPTY  0   0 0                  
Max FW images: 4
Active FW image is at slot 3

TYPE SLOT STATUS LRU FAILURES UNIQUE_ID   BUILD_ID
PRI  FF   GOOD   0   0 0      002.026_000 02.24.05.06_GENERIC
Max PRI images: 50

ati
Manufacturer: Sierra Wireless, Incorporated
Model: EM7455
Revision: SWI9X30C_02.24.05.06 r7040 CARMD-EV-FRMWR2 2017/05/19 06:23:09
MEID: XXXXXXXXXXX
IMEI: XXXXXXXXXXXXX
IMEI SV: 12
FSN: XXXXXXXXXXXX
+GCAP: +CGSM

Also, I did change the USBPID and PRIID using some info from here: https://forum.pfsense.org/index.php?topic=123828.0. Mine was a Lenovo branded card with USBPID 9079 and PRIID 9905228 which was for a “Lenovo-Tablet”.

AT!ENTERCND="A710"
AT!USBPID=9071,9070
AT!USBVID=1199
AT!PRIID="9904609","002.026","GENERIC"

at!priid?
PRI Part Number: 9904609
Revision: 002.026
Customer: GENERIC

Carrier PRI: 9999999_9904609_SWI9X30C_02.24.05.06_00_GENERIC_002.026_000

Thank you very much Alexsander. I beat myself up with the Firmware_Download program in Sample_Apps as per Sierra Wireless instructions but even though it said it was successful, the image never went to the modem (none of the slots show it) as slot 3 now shows it with you update program

Hi,

I follow the same procedure as shown by the experts here, but after I finished the firmware upgrade, I could no longer access LTE or send qmicli command to MC7455.
Whenever I sent qmicli command to MC7455, I received this weild error: “couldn’t create client for the ‘dms’ service: CID allocation failed in the CTL client: Transaction timed out”.
Then I have to reload the firmware by windows exe method. And the module is back to normally working.
Only after I upgrade the firmware by qmi-firmware-update, the module stopped working.

Please anyone can give me a hint.
Thank you.
Tony.

Hi,

Thank you for all the information provided in this thread. I am configuring my MC7455 with a OpenWRT running on a Raspberry Pi and I am having difficulties installing modem manager on it. I went through Aleksander’s git for the modem manager but a bit confused with how feeds work.

I am pretty new with the Linux Environment so any help would be greatly appreciated.

Add his feed to feeds.conf.default in your openwrt build environment then just update and install. In make menuconfig select the modemmanager packages.

Hi,

Thanks for your response. I noticed that I would need the libqmi and libmbim installed on my OpenWRT. How can I get these packages? I have the uqmi package installed on my openwrt right now.

The modemmanager package has libmbim and libqmi as dependencies so it will auto check those in menuconfig. To find them and make sure just use the / key and search for them and it will show you where they are at in menuconfig.

Here’s a little script I cooked up to automate the process (used it successfully on a Turris Omnia with a MC7430 installed and the most recent firmware from Sierra):

#! /bin/sh
device=/dev/cdc-wdm0
fullmodeusb=/dev/ttyUSB2
bootmodeusb=/dev/ttyUSB0
unsafe=
# uncomment this to enable unsafe mode
#unsafe=--ignore-mm-runtime-check

echo Locating firmware files...
ncwe=$(ls *.cwe 2>/dev/null|wc -l)
nnvu=$(ls *.nvu 2>/dev/null|wc -l)
if [ \( $ncwe -ne 1 \) -o \( $nnvu -ne 1 \) ]; then
  echo Couldn\'t find the firmware update files
  echo make sure exactly one .cwe and one .nvu are present
  exit
fi
cwe=$(ls *.cwe|xargs)
nvu=$(ls *.nvu|xargs)
fwamssflavor=$(echo $cwe|sed -r 's,_.*,,')
fwamssvs=$(echo $cwe|sed -r 's,^[^_]+_(.+)\.cwe,\1,')
fwbootflavor=$(echo $nvu|sed -r 's,_.*,,')
fwbootvs=$(echo $nvu|sed -r 's,^[^_]+_([^_]+)_.*,\1,')
fwedition=$(echo $nvu|sed -r 's,^[^_]+_[^_]+_([^_]+).*,\1,')
fwconfigvs=$(echo $nvu|sed -r 's,^[^_]+_[^_]+_[^_]+_(.*)\.nvu,\1,')
echo "  Using CWE: ./$cwe"
echo "  Using NVU: ./$nvu"
echo "  versions: device=$fwamssflavor boot=$fwbootvs amss=$fwamssvs config=$fwconfigvs edition=$fwedition"
if [ "$fwamssflavor" != "$fwbootflavor" ]; then
  echo "ERROR! BOOT belongs to a different device ($fwbootflavor)."
  echo "This is *very* likely to brick the modem. Aborting..."
  exit
fi
if [ \( -z "$fwamssflavor" \) -o \( -z "$fwamssvs" \) -o \( -z "$fwbootvs" \) -o \( -z "$fwconfigvs" \) -o \( -z "$fwedition" \) ]; then
  echo "ERROR! Cannot detect the exact update versions."
  echo "Aborting..."
  exit
fi
echo ""

echo "Detecting modem firmware..."
tmp=$(mktemp)
if ! qmicli -d $device -p --dms-swi-get-current-firmware 2>/dev/null >$tmp; then
  echo Couldn\'t query the current firmware using $device
  exit
fi
model=$(cat $tmp|grep Model:|awk '{print $2}')
sku=$(cat $tmp|grep 'SKU ID:'|awk '{print $3}')
boot=$(cat $tmp|grep 'Boot version:'|awk '{print $3}')
amss=$(cat $tmp|grep 'AMSS version:'|awk '{print $3}')
configvs=$(cat $tmp|grep 'Config version:'|awk '{print $3}')
rm -f $tmp
amssflavor=$(echo $amss|sed -r 's,_.*,,')
amssvs=$(echo $amss|sed -r 's,^[^_]+_,,')
bootflavor=$(echo $boot|sed -r 's,_.*,,')
bootvs=$(echo $boot|sed -r 's,^[^_]+_,,')
echo "  Found $model (SKU $sku) on $device"
echo "  versions: device=$amssflavor boot=$bootvs amss=$amssvs config=$configvs"
if [ "$amssflavor" != "$bootflavor" ]; then
  echo "ERROR! BOOT belongs to a different ($bootflavor)."
  echo "This is *seriously* wrong. Aborting..."
  exit
fi
if [ \( -z "$amssflavor" \) -o \( -z "$amssvs" \) -o \( -z "$bootvs" \) -o \( -z "$configvs" \) ]; then
  echo "ERROR! Cannot detect the exact installed versions."
  echo "Aborting..."
  exit
fi
if [ "$amssflavor" != "$fwamssflavor" ]; then
  echo "ERROR! update files are for a different device."
  echo "This is *very* likely to brick the modem. Aborting..."
  exit
fi
if [ \( "$amssvs" = "$fwamssvs" \) -a \( "$bootvs" = "$fwbootvs" \) ]; then
  echo "NOTE. Update already installed."
  echo "Noting to do..."
  exit
fi
echo ""

echo Rebooting modem into bootloader mode...
echo "  # qmi-firmware-update -w $device $unsafe -b"
qmi-firmware-update -w $device $unsafe -b 2>&1 | sed 's,^,  ,'
echo -n "(waiting for the modem to disappear..."
t=0
while [ $t -le 30 ]; do
  if [ ! -e $fullmodeusb ]; then
    echo " OK)"
    break;
  fi
  t=$(( t + 1 ))
  echo -n "."
  sleep 1
done
if [ -e $fullmodeusb ]; then
  echo " FAILED! - timeout)"
  echo "  # qmicli -d $device -p --dms-get-operating-mode"
  qmicli -d $device -p --dms-get-operating-mode 2>&1 | sed 's,^,  ,'
  echo "Aborting..."
  exit
fi
echo -n "(waiting for the boot interface to appear..."
t=0
while [ $t -le 30 ]; do
  if [ -e $bootmodeusb ]; then
    echo " OK)"
    break;
  fi
  t=$(( t + 1 ))
  echo -n "."
  sleep 1
done
if [ ! -e $bootmodeusb ]; then
  echo " FAILED - timeout)"
  echo "Aborting..."
  exit
fi
if [ -e $fullmodeusb ]; then
  echo " FAILED - boot skipped, normal reboot happened)"
  echo "Aborting. Please retry..."
  exit
fi
echo ""

echo "Updating modem..."
echo "# qmi-firmware-update -t $bootmodeusb $unsafe --update-qdl \\"
echo "    ./$cwe \\"
echo "    ./$nvu"
qmi-firmware-update -t $bootmodeusb $unsafe --update-qdl $cwe $nvu
echo -n "(waiting for the modem to re-appear..."
t=0
while [ $t -le 30 ]; do
  if [ -e $device ]; then
    echo " OK)"
    break;
  fi
  t=$(( t + 1 ))
  echo -n "."
  sleep 1
done
if [ ! -e $device ]; then
  echo " FAILED! - timeout)"
  echo "Aborting..."
  exit
fi
echo ""

echo "Querying modem..."
echo -n "(waiting for the modem to finish boot..."
t=0
while [ $t -le 180 ]; do
  if qmicli -d $device -p --dms-swi-get-current-firmware 2>/dev/null > $tmp; then
    echo " OK)"
    break;
  fi
  t=$(( t + 1 ))
  echo -n "."
  sleep 1
done
if ! qmicli -d $device -p --dms-swi-get-current-firmware 2>/dev/null > $tmp; then
  echo " FAILED! - timeout)"
  echo "Run \"qmicli -d $device -p --dms-swi-get-current-firmware\" later..."
else
  echo "  # qmicli -d $device -p --dms-swi-get-current-firmware"
  cat $tmp | sed 's,^,  ,'
fi
echo ""

echo "All done."

Sample output log:

Locating firmware files...
  Using CWE: ./SWI9X30C_02.30.03.00.cwe
  Using NVU: ./SWI9X30C_02.30.03.00_GENERIC_002.046_001.nvu
  versions: device=SWI9X30C boot=02.30.03.00 amss=02.30.03.00 config=002.046_001 edition=GENERIC

Detecting modem firmware...
  Found MC7430 (SKU 1102477) on /dev/cdc-wdm0
  versions: device=SWI9X30C boot=02.14.03.00 amss=02.14.03.00 config=002.012_000

Rebooting modem into bootloader mode...
  # qmi-firmware-update -w /dev/cdc-wdm0 --ignore-mm-runtime-check -b
  reseter operation finished successfully
(waiting for the modem to disappear................ OK)
(waiting for the boot interface to appear.... OK)

Updating modem...
# qmi-firmware-update -t /dev/ttyUSB0 --ignore-mm-runtime-check --update-qdl \
    ./SWI9X30C_02.30.03.00.cwe \
    ./SWI9X30C_02.30.03.00_GENERIC_002.046_001.nvu
downloading cwe image: SWI9X30C_02.30.03.00.cwe (64.5 MB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 52.63s (1.2 MB/s)
downloading cwe image: SWI9X30C_02.30.03.00_GENERIC_002.046_001.nvu (3.2 kB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 0.05s (60.1 kB/s)
rebooting in normal mode...
firmware update operation finished successfully
(waiting for the modem to re-appear.............. OK)

Querying modem...
(waiting for the modem to finish boot..... OK)
  # qmicli -d /dev/cdc-wdm0 -p --dms-swi-get-current-firmware
  [/dev/cdc-wdm0] Successfully retrieved current firmware:
        Model: MC7430
        Boot version: SWI9X30C_02.30.03.00
        AMSS version: SWI9X30C_02.30.03.00
        SKU ID: 1102477
        Package ID: unknown
        Carrier ID: 1
        Config version: 002.012_000

All done.

I hope this helps others just like this page helped me :slight_smile:

Hi @wicadmin and all are having troubles while updating.

UPDATE: Nevermind, ran the steps a few times and the modem was at the right “window” to accept the update command:

There’s an easy way to ready the modem for firmware update which is: AT!BOOTHOLD

at_boothold

So with this flow you won’t have any problems:

  • Set preference as new version qmicli -p -d /dev/cdc-wdm0 --dms-set-firmware-preference="02.30.01.01,002.045_000,GENERIC"
  • Send /dev/ttyUSB2 'AT!BOOTHOLD'
  • Wait until only /dev/ttyUSB0 is left and /dev/ttyUSB1 and /dev/ttyUSB2 disappears
  • qmi-firmware-update -t /dev/ttyUSB0 --update-qdl swi9x30c_02.30.01.01_00_generic_002.045_000/SWI9X30C_02.30.01.01.cwe swi9x30c_02.30.01.01_00_generic_002.045_000/SWI9X30C_02.30.01.01_GENERIC_002.045_000.nvu
  • See
downloading cwe image: SWI9X30C_02.30.01.01.cwe (64.5 MB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 57.06s (1.1 MB/s)
downloading cwe image: SWI9X30C_02.30.01.01_GENERIC_002.045_000.nvu (4.0 kB)...
finalizing download... (may take more than one minute, be patient)
successfully downloaded in 0.05s (75.4 kB/s)
rebooting in normal mode...
firmware update operation finished successfully
1 Like

@dayburack - Thank you!. This will come in handy I’m sure for many. I’m making the move to another brand of modem but this one has been fun. A shame the generic firmware cannot hold a connection consistently to Sprint and therefore had to look at alternatives.

Good luck. This will surely help others.

1 Like

There is no need to manually send AT!BOOTHOLD on the TTY after setting the new firmware preference. Instead, just reboot the module also using qmicli just after setting the firmware preference:

qmicli -p -d /dev/cdc-wdm0 --dms-set-firmware-preference="02.30.01.01,002.045_000,GENERIC"
qmicli -p -d /dev/cdc-wdm0 --dms-set-operating-mode=offline
qmicli -p -d /dev/cdc-wdm0 --dms-set-operating-mode=reset

After that, the module will reboot in download mode and you can use --update-qdl

Hi @dayburack ,

Does it support to WP series ?