root@OpenWrt:~# qmicli -d /dev/cdc-wdm0 -p --dms-set-firmware-reference="01.09.04.00,002.019_000,GENERIC"
[/dev/cdc-wdm0] Firmware preference successfully selected
You may want to power-cycle the modem now, or just set it offline and reset it:
$> sudo qmicli ... --dms-set-operating-mode=offline
$> sudo qmicli ... --dms-set-operating-mode=reset
After reset, the modem will wait in QDL mode for new firmware.
Images to download: 'modem, pri'
root@OpenWrt:~# qmicli -d /dev/cdc-wdm0 -p --dms-set-operating-mode=offline
[/dev/cdc-wdm0] Operating mode set successfully
root@OpenWrt:~# qmicli -d /dev/cdc-wdm0 -p --dms-set-operating-mode=reset
[/dev/cdc-wdm0] Operating mode set successfully
root@OpenWrt:~# /etc/init.d/modemmanager stop
root@OpenWrt:~# qmicli -d /dev/cdc-wdm0 -p --dms-get-operating-mode
error: couldn't create QmiDevice: Couldn't query file info: Error when getting information for file “/dev/cdc-wdm0”: No such file or directory
root@OpenWrt:~# qmi-firmware-update -t /dev/ttyUSB0 -U /tmp/fw/SWI9X50C_01.09.04.00.cwe /tmp/fw/SWI9X50C_01.09.04.00_GENERIC_002.019_000.nvu
error: unsupported download protocol
root@OpenWrt:~# qmi-firmware-update -t /dev/ttyUSB0 -U /tmp/fw/SWI9X50C_01.09.04.00.cwe /tmp/fw/SWI9X50C_01.09.04.00_GENERIC_002.019_000.nvu -v
[27 Jun 2019, 13:23:21] [Debug] [qfu-utils] couldn't ping ModemManager: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.ModemManager1" does not exist
[27 Jun 2019, 13:23:21] [Debug] [qfu-image] loading file info...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image] opening file for reading...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] reading image headers...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [0,79664946]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [400,7360]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 400 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [7360,407216]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [7760,14640]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 7760 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [14640,407216]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 14640 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 7360 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [407216,39478680]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [407616,414576]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 407616 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [414576,871292]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 414576 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [871292,1038880]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 871292 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [1038880,39478680]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 1038880 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 407216 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [39478680,79664946]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [39479080,39486040]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 39479080 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [39486040,39937028]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 39486040 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [39937028,72274126]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 39937028 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [72274126,79664946]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 72274126 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 39478680 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] validating data size...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] preloading firmware/config/carrier...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] firmware version: 01.09.04.00
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] config version: unknown
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] carrier: unknown
[27 Jun 2019, 13:23:21] [Debug] [qfu-image] loading file info...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image] opening file for reading...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] reading image headers...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [0,10081]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [400,7680]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [800,7680]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 800 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 400 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [7680,10081]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image offset range: [8080,10081]
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 8080 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] image at offset 7680 is valid
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] validating data size...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] preloading firmware/config/carrier...
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] firmware version: 01.09.04.00
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] config version: 002.019_000
[27 Jun 2019, 13:23:21] [Debug] [qfu-image-cwe] carrier: GENERIC
[27 Jun 2019, 13:23:21] [Debug] [qfu-sahara-device] opening TTY: /dev/ttyUSB0
[27 Jun 2019, 13:23:21] [Debug] [qfu-sahara-device] setting terminal in raw mode...
[27 Jun 2019, 13:23:21] [Debug] [qfu-sahara-device] waiting time for device to boot properly...
[27 Jun 2019, 13:23:23] [Debug] [qfu-sahara-device] initializing sahara protocol...
[27 Jun 2019, 13:23:26] [Debug] [qfu-updater] sahara device creation failed: no sahara response received
[27 Jun 2019, 13:23:26] [Debug] [qfu-qdl-device] opening TTY: /dev/ttyUSB0
[27 Jun 2019, 13:23:26] [Debug] [qfu-qdl-device] setting terminal in raw mode...
[27 Jun 2019, 13:23:26] [Debug] [qfu,dload-message] sent sdp:
[27 Jun 2019, 13:23:26] [Debug] [qfu-qdl-device] >> 70:00:00 [3, unframed]
[27 Jun 2019, 13:23:26] [Debug] [qfu-qdl-device] >> 7E:70:00:00:14:46:7E [7]
[27 Jun 2019, 13:23:26] [Debug] [qfu-qdl-device] << 01:00:00:00:30:00:00:00:02:00:00:00:01:00:00:00:00:04:00:00:02:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 [48]
[27 Jun 2019, 13:23:26] [Debug] [qfu-updater] qdl device creation failed: HDLC trailing control character not found
error: unsupported download protocol
I actually did try resetting the firmware preference then resetting the modem the first time I tried after updating libqmi, saw your reply before work and hastily printed it again. Setting the firmware preference to the installed version and resetting the modem was the very first thing I tried after I realized power-cycling wasn’t going to fix the issue. -set-firmware-preference still wanted to update the pri.
As of now I’ve flashed it via a usb to m.2 adapter on a windows machine and it’s working again. I very much appreciate your help, as I would have preferred not to remove the modem from the router and I wonder whether it was me or libqmi’s issue.
I’d eventually like to solve the problem as this functionality(along with many things available only in Goldenorb and other forks) needs to be accessible via luci in the main openwrt releases. I’m intending on getting in touch with Nick and seeing what his plans were and where I can start.
This is key to understand, because you may be trying to run qmi-firmware-update on the wrong place.
This is what I am expecting to be the problem, 9/10 times computer issues are a lack of understanding. Is there a good place I can read up on how these modems work and the ways to communicate with them?