EM7455B connection issues

Hi all,

I've got a question. Maybe someone has an idea what's going on.

I'm running OpenWrt on a Banana Pi BPI-R3 with a snapshot release:

user@OpenWrt:~$ cat /etc/openwrt_version
r25557-8fb23465ca

I installed a LTE modem and I'm using ModemManager:

user@OpenWrt:~$ sudo mmcli --modem=0
  --------------------------------
  General  |                 path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: ************************************
  --------------------------------
  Hardware |         manufacturer: Sierra Wireless, Incorporated
           |                model: DW5811e Snapdragon™ X7 LTE
           |    firmware revision: SWI9X30C_02.24.03.00
           |       carrier config: default
           |         h/w revision: EM7455B
           |            supported: gsm-umts, lte
           |              current: gsm-umts, lte
           |         equipment id: **************
  --------------------------------
  System   |               device: /sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1
           |              physdev: /sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1
           |              drivers: cdc_mbim
           |               plugin: dell
           |         primary port: cdc-wdm0
           |                ports: cdc-wdm0 (mbim), wwan0 (net)
  --------------------------------
  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin2 (3)
           |                state: disabled
           |          power state: low
  --------------------------------
  Modes    |            supported: allowed: 3g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 3g, 4g; preferred: 4g
           |                       allowed: 3g, 4g; preferred: 3g
           |              current: allowed: 3g, 4g; preferred: 4g
  --------------------------------
  Bands    |            supported: utran-1, utran-3, utran-4, utran-5, utran-8, utran-2,
           |                       eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8,
           |                       eutran-12, eutran-13, eutran-20, eutran-25, eutran-26, eutran-29,
           |                       eutran-41
           |              current: utran-1, utran-3, utran-4, utran-5, utran-8, utran-2,
           |                       eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7, eutran-8,
           |                       eutran-12, eutran-13, eutran-20, eutran-25, eutran-26, eutran-29,
           |                       eutran-41
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: ****************
           |        enabled locks: sim, fixed-dialing
           | packet service state: detached
  --------------------------------
  SIM      |     primary sim path: /org/freedesktop/ModemManager1/SIM/0
           |       sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM/0 (active)
           |                       slot 2: none

But I was unable to connect. Always running in timeout.

Today I put my SIM card in laptop that's running Windows. And it connected instantly. No Problem.
Then I put the SIM card back in my router, boot up OpenWrt and the damn thing works. Without any changes in my config. I get connection.

So.... any idea what has happened there? Some kind of black magic?
I would love to know the reason behind this.
Since I don't want to rely on Windows to get my wwan interface working.
I was actually planing on deleting Windows and install Linux on that laptop I used for testing the SIM card.

You need to fix this.
See EM7455, can't get it to work on 21.02.3 - #12 by AndrewZ

Thank you for your reply!

But isn't the power state handled by ModemManager?
I mean (today), when connected, I get this:

  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-pin2 (3)
           |                state: connected
           |          power state: on
           |          access tech: lte
           |       signal quality: 51% (recent)

And after disconnect I see this:

  Status   |                 lock: sim-pin2
           |       unlock retries: sim-pin (3), sim-pin2 (3)
           |                state: disabled
           |          power state: low

Also I can connect today. The question is why didn't it work before? When I didn't change anything considering my config.
Is it possible that temporary plugging my SIM card into an other machine had some effect?

I guess you have FCC Auth Enabled and MM temporary brings the modem out of this state.

Thank you for the hint!

I guess I might have found the reason. Apparently FCC locking is a thing. I found this in the MM docu: FCC-unlock
Sounds like that could be a solution.
The unlock scripts are installed in OpenWrt. But there are no scripts for my specific device:

~$ lsusb
Bus 001 Device 003: ID 413c:81b6 Sierra Wireless, Incorporated DW5811e Snapdragon™ X7 LTE
~$ ls /usr/share/ModemManager/fcc-unlock.available.d/
03f0:4e1d  105b       105b:e0ab  105b:e0c3  1199       1199:9079  1eac       1eac:1001  2c7c       2c7c:030a  413c:81a3  413c:81a8

There are scripts for a EM7455. They are for a Lenovo device:
For the Lenovo-shipped EM7455: /usr/share/ModemManager/fcc-unlock.available.d/1199:9079

I tried to use that script following the documentation, but adjusting the link fitting my device id. Unfortunately it doesn't work, yet.
Maybe I have to put the scripts into an other folder in order to work in OpenWrt?
I created a folder '/etc/ModemManager/fcc-unlock.d' where I put the links as described in the MM docu.

~$ ls -alh /etc/ModemManager/fcc-unlock.d/
drwxr-xr-x    2 root     root        3.4K Apr  1 09:54 .
drwxr-xr-x    3 root     root        3.4K Apr  1 09:48 ..
lrwxrwxrwx    1 root     root          56 Apr  1 09:53 03f0:4e1d -> /usr/share/ModemManager/fcc-unlock.available.d/03f0:4e1d
lrwxrwxrwx    1 root     root          51 Apr  1 09:53 105b -> /usr/share/ModemManager/fcc-unlock.available.d/105b
lrwxrwxrwx    1 root     root          56 Apr  1 09:53 105b:e0ab -> /usr/share/ModemManager/fcc-unlock.available.d/105b:e0ab
lrwxrwxrwx    1 root     root          51 Apr  1 09:53 1199 -> /usr/share/ModemManager/fcc-unlock.available.d/1199
lrwxrwxrwx    1 root     root          56 Apr  1 09:53 1199:9079 -> /usr/share/ModemManager/fcc-unlock.available.d/1199:9079
lrwxrwxrwx    1 root     root          51 Apr  1 09:53 1eac -> /usr/share/ModemManager/fcc-unlock.available.d/1eac
lrwxrwxrwx    1 root     root          56 Apr  1 09:53 1eac:1001 -> /usr/share/ModemManager/fcc-unlock.available.d/1eac:1001
lrwxrwxrwx    1 root     root          51 Apr  1 09:53 2c7c -> /usr/share/ModemManager/fcc-unlock.available.d/2c7c
lrwxrwxrwx    1 root     root          56 Apr  1 09:53 2c7c:030a -> /usr/share/ModemManager/fcc-unlock.available.d/2c7c:030a
lrwxrwxrwx    1 root     root          51 Apr  1 09:54 413c -> /usr/share/ModemManager/fcc-unlock.available.d/1199
lrwxrwxrwx    1 root     root          56 Apr  1 09:53 413c:81a3 -> /usr/share/ModemManager/fcc-unlock.available.d/413c:81a3
lrwxrwxrwx    1 root     root          56 Apr  1 09:53 413c:81a8 -> /usr/share/ModemManager/fcc-unlock.available.d/413c:81a8
lrwxrwxrwx    1 root     root          56 Apr  1 09:54 413c:81b6 -> /usr/share/ModemManager/fcc-unlock.available.d/1199:9079

Any suggestions on how to get my SIM unlocked?

Your SIM has nothing to do with this. The FCC unlock solution is described at the end of the topic that I linked earlier.

Thank you very much for the support!

I'm sorry I guess I didn't pay as much attention to the topic you linked as should have. Shame on me. :frowning:

It seems the unlock script is working now; I had to install uqmi.
At least power state is now on:

~$ sudo mmcli --modem 0
...
  Status   |             state: locked
           |       power state: on
...
~$ sudo mbimcli -d /dev/cdc-wdm0 --query-radio-state
[/dev/cdc-wdm0] Radio state retrieved:
             Hardware radio state: 'on'
             Software radio state: 'on'

But state is locked. I don't know if it matters.
The SIM itself is not locked:

~$ sudo mmcli -i 0 --pin=****
error: couldn't send PIN code to the SIM: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: Cannot send PIN: device is not SIM-PIN locked'

But I still can not connect, right now.
However MM does give me a few warnings and stops the connection attempt on a time out:

daemon.notice netifd: Interface 'broadband' is setting up now
daemon.notice netifd: broadband (5038): modem available at /org/freedesktop/ModemManager1/Modem/0
daemon.notice netifd: broadband (5038): starting connection with apn 'web.vodafone.de'...
daemon.info [2901]: <info>  [modem0] simple connect started...
daemon.info [2901]: <info>  [modem0] simple connect state (1/10): unlock check
daemon.info [2901]: <info>  [modem0] simple connect state (2/10): wait to get fully initialized
daemon.info [2901]: <info>  [modem0] state changed (locked -> initializing)
daemon.warn [2901]: <warn>  [modem0/sim0] couldn't load list of emergency numbers: No AT port available to run command
daemon.warn [2901]: <warn>  [modem0/sim0] couldn't load GID2: Couldn't read data from UIM: QMI protocol error (16): 'NotProvisioned'
daemon.warn [2901]: <warn>  [modem0] couldn't load UE mode of operation for EPS: No AT port available to run command
daemon.warn [2901]: <warn>  [modem0] couldn't load initial EPS bearer settings: LTE attach status info is unsupported
daemon.warn [2901]: <warn>  [modem0] couldn't load 5GNR registration settings: 5GNR registration settings are unsupported
daemon.info [2901]: <info>  [modem0] state changed (initializing -> disabled)
daemon.info [2901]: <info>  [modem0] simple connect state (3/10): enable
daemon.info [2901]: <info>  [modem0] state changed (disabled -> enabling)
daemon.info [2901]: <info>  [modem0] power state updated: on
daemon.info [2901]: <info>  [modem0] simple connect state (4/10): wait to get fully enabled
daemon.info [2901]: <info>  [modem0] state changed (enabling -> enabled)
daemon.info [2901]: <info>  [modem0] 3GPP registration state changed (unknown -> idle)
daemon.warn [2901]: <warn>  [modem0] couldn't load operator code: Current operator MCC/MNC is still unknown
daemon.info [2901]: <info>  [modem0] simple connect state (5/10): wait after enabled
daemon.warn [2901]: <warn>  [modem0] couldn't load operator name: Current operator name is still unknown
daemon.info [2901]: <info>  [modem0] simple connect state (6/10): register
daemon.info [2901]: <info>  [modem0] 3GPP registration state changed (idle -> registering)
daemon.info [2901]: <info>  [modem0] 3GPP registration state changed (registering -> home)
daemon.info [2901]: <info>  [modem0] state changed (enabled -> registered)
daemon.info [2901]: <info>  [modem0] simple connect state (7/10): wait to get packet service state attached
daemon.info [2901]: <info>  [modem0] simple connect state (8/10): bearer
daemon.info [2901]: <info>  [modem0] simple connect state (9/10): connect
daemon.info [2901]: <info>  [modem0] state changed (registered -> connecting)
daemon.notice netifd: broadband (5038): error: couldn't connect the modem: 'Timeout was reached'
daemon.notice netifd: broadband (5079): stopping network
daemon.notice netifd: broadband (5079): running disconnection (common)
daemon.notice netifd: broadband (5079): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "broadband" } (Permission denied)
daemon.info [2901]: <info>  [modem0] state changed (connecting -> disconnecting)
daemon.warn [2901]: <warn>  [modem0/bearer0] connection attempt #1 failed: Operation was cancelled
daemon.info [2901]: <info>  [modem0] state changed (disconnecting -> registered)
daemon.info [2901]: <info>  [modem0/bearer0] connection #1 finished: duration 0s
daemon.notice netifd: broadband (5079): successfully disconnected all bearers in the modem
daemon.info [2901]: <info>  [modem0] state changed (registered -> disabling)
daemon.info [2901]: <info>  [modem0] 3GPP registration state changed (home -> unknown)
daemon.info [2901]: <info>  [modem0] state changed (disabling -> disabled)
daemon.notice netifd: broadband (5079): successfully disabled the modem
daemon.notice netifd: broadband (5079): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "broadband" } (Permission denied)
daemon.notice netifd: Interface 'broadband' is now down

Part 1 (unrelated to OpenWrt):

  • make the modem GENERIC (not Dell)
  • upgrade its firmware to the latest
  • switch it to MBIM + comm ports composition
  • disable FCC Auth

Part 2:

1 Like

Yes these can work directly as MBIM or QMI with the kernel driver and included UCI configuration scripts. ModemManager is not needed and it will only cause conflicts.

You may need a M2 to USB adapter and a Windows PC to use manufacturer tools to flash and configure the modem.

I found this script: autoflash-7455.sh
I'll take a look at it and see if i can use it set the modem to generic and flash the firmware. Or at least use it as a tutorial.

I tried to run MBIM at first but it didn't work. Even if the device is present. I'm going to play around with it some more. See what I find out. And hopefully get this thing working. I'll keep you updated.

Thanks again for the support!

Do not use these scripts, do everything manually, step by step. Almost everything could be done while the modem is connected to any Linux machine including a router running OpenWrt.

Yeah. I'm also suspicious then it comes to random scripts. But they can be useful to one, like me, who has no clue about modems and how to operate them.
I'll use it as a tutorial. But I do the task manually.

Or maybe you can point me to a better source? I mean beside WWAN, LTE guide.

About FW upgrade:

Thank you! :+1:

I don't know why I didn't notice this before. But there's no /dev/ttyUSB.
From what I read this is because the firmware on my modem is configured to not expose the serial port, correct?
Is it possible to change that setting via usb-modeswitch? If so how do I do that? I installed usb-modeswitch but there's no /etc/usb-mode.json file. So I have to create one. Unfortunately I couldn't find what to put there. I know how the json should look like in general. But I don't know the correct parameters:

{
        "messages" : [ ],
        "devices" : {
                "413c:81b6": {
                        "*": {
                                "mode": "???",
                                "msg": [ ]
                        }
                }
        }
}

"switch it to MBIM + comm ports composition" belongs to the part that is not related to OpenWrt.
usb_modeswitch will not help.

I found these links while trying to activate the serial device:
https://forum.sierrawireless.com/t/my-mc7710-cant-work-on-linux-after-plug-in-it-to-windows8/7986/8
https://forum.sierrawireless.com/t/em7455-error-with-usbcomp-over-cdc-wdm0/15571/3
Following that threads I send the posted hex commands to my modem. Which seemed to work, or at least I didn't get any error messages (as far as I can tell; reading hex values in an output stream is a little tiresome).

But still. No /dev/ttyUSB after rebooting.

They also mention a perl script that should handle all of this: swi_setusbcomp.pl
But OpenWrt does not contain the required perl packages. And my perl unfortunately isn't good enough to make heads and tails out of that script.

Please show the output of cat /sys/kernel/debug/usb/devices

~# cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 2
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.150 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=11200000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1a40 ProdID=0101 Rev= 1.11
S:  Product=USB 2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=413c ProdID=81b6 Rev= 0.06
S:  Manufacturer=Sierra Wireless, Incorporated
S:  Product=DW5811e Snapdragon™ X7 LTE
S:  SerialNumber=LF83828682011024
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=500mA
A:  FirstIf#=12 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:* If#=12 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
I:  If#=13 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:* If#=13 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=10000 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 3.10 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev= 5.15
S:  Manufacturer=Linux 5.15.150 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=11200000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

The modem still doesn't have serial interfaces, so it's not a driver issue yet.