EM7565 on Raspberry Pi with OpenWRT - USB device listed but not usable

I am trying to build a Rasbperry Pi-based LTE router using an EM7565 on a Waveshare dual-Ethernet 4G/5G Base board, using OpenWRT.

I have tried building OpenWRT with kmod-usb-net-sierrawireless, kmod-usb-serial-option, usb-modeswitch, kmod-usb-wdm, kmod-usb-net-qmi-wwan, uqmi, luci-proto-qmi, kmod-usb-serial-option, kmod-usb-serial-qualcomm, and kmod-usb-serial-sierrawireless

When I boot the device, the USB modem is identified:

root@OpenWrt:~# dmesg | grep usb
[    0.086024] usbcore: registered new interface driver usbfs
[    0.086070] usbcore: registered new interface driver hub
[    0.086110] usbcore: registered new device driver usb
[    0.086233] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    0.086344] usb_phy_generic phy: dummy supplies not allowed for exclusive requests
[    0.359673] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[    0.359698] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.359716] usb usb1: Product: xHCI Host Controller
[    0.359730] usb usb1: Manufacturer: Linux 5.15.60 xhci-hcd
[    0.359744] usb usb1: SerialNumber: 0000:01:00.0
[    0.360504] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
[    0.360530] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.360548] usb usb2: Product: xHCI Host Controller
[    0.360561] usb usb2: Manufacturer: Linux 5.15.60 xhci-hcd
[    0.360575] usb usb2: SerialNumber: 0000:01:00.0
[    0.361978] usbcore: registered new interface driver uas
[    0.362053] usbcore: registered new interface driver usb-storage
[    0.667391] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    0.923624] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.20
[    0.939086] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    0.952639] usb 1-1: Product: USB2.0 Hub
[    1.502342] usb 2-4: new SuperSpeed USB device number 2 using xhci_hcd
[    1.538359] usb 2-4: New USB device found, idVendor=0bda, idProduct=8153, bcdDevice=31.00
[    1.546546] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[    1.553691] usb 2-4: Product: USB 10/100/1000 LAN
[    1.558398] usb 2-4: Manufacturer: Realtek
[    1.562490] usb 2-4: SerialNumber: 001000001
[    1.827403] usb 1-1.3: new high-speed USB device number 3 using xhci_hcd
[    1.962738] usb 1-1.3: New USB device found, idVendor=1199, idProduct=90c2, bcdDevice= 0.00
[    1.971119] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.978447] usb 1-1.3: Product: QUSB_Fast_Enum.
[    1.982980] usb 1-1.3: Manufacturer: Sierra Wireless, Incorporated
[    1.989168] usb 1-1.3: SerialNumber: XK73468776020606
[    2.241111] usb 1-1.3: USB disconnect, device number 3
[    7.474072] usbcore: registered new interface driver cdc_wdm
[    7.495790] usbcore: registered new interface driver lan78xx
[    7.505008] usbcore: registered new interface driver r8152
[    7.512122] usbcore: registered new interface driver usbhid
[    7.517724] usbhid: USB HID core driver
[    7.523626] usbcore: registered new interface driver usbserial_generic
[    7.530252] usbserial: USB Serial support registered for generic
[    7.536785] usbcore: registered new interface driver cdc_ether
[    7.543539] usbcore: registered new interface driver cdc_ncm
[    7.589020] usbcore: registered new interface driver qmi_wwan
[    7.595384] usbcore: registered new interface driver sierra
[    7.601056] usbserial: USB Serial support registered for Sierra USB modem
[    7.608623] usbcore: registered new interface driver sierra_net
[    7.624049] usbcore: registered new interface driver brcmfmac
[    7.631876] usbcore: registered new interface driver option
[    7.637525] usbserial: USB Serial support registered for GSM modem (1-port)
[    7.646110] usbcore: registered new interface driver qcserial
[    7.651975] usbserial: USB Serial support registered for Qualcomm USB modem
[    7.687900] usb 2-4: reset SuperSpeed USB device number 2 using xhci_hcd
[   14.087426] usb 1-1.3: new high-speed USB device number 4 using xhci_hcd
[   14.218631] usb 1-1.3: New USB device found, idVendor=1199, idProduct=90c3, bcdDevice= 0.06
[   14.227000] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   14.234339] usb 1-1.3: Product: Sierra Wireless EM7565 with Qualcomm Snapdragon X16 LTE
[   14.242365] usb 1-1.3: Manufacturer: Sierra Wireless, Incorporated
[   14.248560] usb 1-1.3: SerialNumber: [redacted]

But it seems that the driver is not loaded:

root@OpenWrt:~# cat /sys/kernel/debug/usb/devices
...
T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#=  4 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1199 ProdID=90c3 Rev= 0.06
S:  Manufacturer=Sierra Wireless, Incorporated
S:  Product=Sierra Wireless EM7565 with Qualcomm Snapdragon X16 LTE
S:  SerialNumber=2af40a0a
C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=82(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

And further, I see no USB TTY device, nor a qmi device to manage:

root@OpenWrt:~# ls /dev/cdc-*
ls: /dev/cdc-*: No such file or directory

root@OpenWrt:~# ls /dev/ttyUSB*
ls: /dev/ttyUSB*: No such file or directory

Is there something I may be missing in trying to get this modem working on OpenWRT?

not sure if your module is on MBIM only mode.
Have you tested in Windows?

That’s a real possibility; I’ve only tested on this Waveshare board with the Pi so far. I’ve played around with cards through my Mac via a USB 3.0 to M.2 adapter before, but haven’t tried doing anything in Windows with LTE, ever. Is it possible to check/switch from a Mac?

Otherwise is there a good guide I could check somewhere to get me started trying on Windows? (I have access to a Windows PC, but not readily right now.)

I tried this before:

  1. download the USB driver for EM7565 ( GenericDriverSetup_5087.exe) from Sierra SOURCE website

  2. open a folder and put GenericDriverSetup_5087.exe and Configuration.ini together

  3. open Configuration.ini and add the following:
    [Default Values]
    CHECKFORDEVICE=0
    LOCATIONDRIVER=1
    WIN8LOCATION=1
    USBCOMP=99

  4. connect the USB cable of EM7565 to Windows

I will try that when I’m back near my Windows PC.

Hi @geerlingguy,

your EM7565 has been set to a different USB id 1199:90c3 which is not known by the mainline Linux kernel drivers
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/serial/qcserial.c?id=92a18a657fb2e2ffbfa0659af32cc18fd2346516
kernel/git/torvalds/linux.git - Linux kernel source tree .

Similar to How to interact with MC7710 after ppp configured - #6 by mlw you would have to use AT!UDPID=9091 to make the EM7565 usable with OpenWRT.
To be able to send AT commands to the EM7565 with minicom, screen etc. on USB id 1199:90c3
you can use

modprobe option
echo 1199 90c3 > /sys/bus/usb-serial/drivers/option1/new_id

. One of the newly created /dev/ttyUSB devices should (hopefully) respond to AT commands.

Regards,
Reinhard

1 Like

Thanks! I am able to interact with the modem on /dev/ttyUSB0 now, but when I try sending the command AT!UDPID=9091 it returns ERROR (the command AT returns OK, so it seems I’m definitely connecting to the modem now…).

Even running AT!UDPID? to grab the current setting results in ERROR. I tried on ttyUSB0, 1, and 2 (all three of them) and only 0 would respond to any commands.

I’m also posting some more details (in case they’re relevant) in this thread on GitHub.

how about
AT!ENTERCND=“A710”
AT!USBPID?

ati3
Manufacturer: Sierra Wireless, Incorporated
Model: EM7411
Revision: SWI9X50C_01.14.03.00 b06bd3 jenkins 2020/09/23 10:53:35
IMEI: 356280111491234
IMEI SV: 13
FSN: 8F224126871234
+GCAP: +CGSM

OK
at!usbpid?
ERROR
at!entercnd=“A710”
OK
at!usbpid?
!USBPID:
APP : 9091
BOOT: 9090

OK

1 Like

Hmm…

root@OpenWrt:~# echo -ne 'AT!ENTERCND="A710"?\r\n' > /dev/ttyUSB2
OK

root@OpenWrt:~# echo -ne 'AT!USBPID?\r\n' > /dev/ttyUSB2
!USBPID: 
APP : 90B1
BOOT: 90B0

root@OpenWrt:~# echo -ne 'AT!UDPID=9091\r\n' > /dev/ttyUSB2
ERROR

didn’t you should use USBPID instead of UDPID according to AT command guide?

1 Like

Ah, correct! Now that worked, so I’ll try rebooting and see if it comes up and is recognized right away.

AT!USBPID=9091
OK
AT!USBPID?
!USBPID: 
APP : 9091
BOOT: 9090

That worked! After a hard reset, I am seeing:

root@OpenWrt:~# ls /dev/ttyUSB*
/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2

And dmesg output:

[    7.557902] usb 2-3: new SuperSpeed USB device number 3 using xhci_hcd
[    7.588647] usb 2-3: config 1 has an invalid interface number: 12 but max is 4
[    7.595894] usb 2-3: config 1 has an invalid interface number: 13 but max is 4
[    7.603198] usb 2-3: config 1 has an invalid interface number: 13 but max is 4
[    7.610435] usb 2-3: config 1 has no interface number 1
[    7.615668] usb 2-3: config 1 has no interface number 4
[    7.621586] usb 2-3: New USB device found, idVendor=1199, idProduct=9091, bcdDevice= 0.06
[    7.629801] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    7.636939] usb 2-3: Product: EM7565-9
[    7.640704] usb 2-3: Manufacturer: Sierra Wireless, Incorporated
[    7.646708] usb 2-3: SerialNumber: 2af40a0a
[    7.655521] usb 2-3: Enable of device-initiated U1 failed.
[    7.661706] usb 2-3: Enable of device-initiated U2 failed.
[    7.668709] usb 2-3: Enable of device-initiated U1 failed.
[    7.674911] usb 2-3: Enable of device-initiated U2 failed.
[    7.680579] qcserial 2-3:1.0: Qualcomm USB modem converter detected
[    7.687028] usb 2-3: Qualcomm USB modem converter now attached to ttyUSB0
[    7.695408] usb 2-3: Enable of device-initiated U1 failed.
[    7.701568] usb 2-3: Enable of device-initiated U2 failed.
[    7.707229] qcserial 2-3:1.2: Qualcomm USB modem converter detected
[    7.713697] usb 2-3: Qualcomm USB modem converter now attached to ttyUSB1
[    7.721972] usb 2-3: Enable of device-initiated U1 failed.
[    7.728207] usb 2-3: Enable of device-initiated U2 failed.
[    7.733903] qcserial 2-3:1.3: Qualcomm USB modem converter detected
[    7.740353] usb 2-3: Qualcomm USB modem converter now attached to ttyUSB2

And the device itself:

# cat /sys/kernel/debug/usb/devices
...
T:  Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  3 Spd=5000 MxCh= 0
D:  Ver= 3.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=1199 ProdID=9091 Rev= 0.06
S:  Manufacturer=Sierra Wireless, Incorporated
S:  Product=EM7565-9
S:  SerialNumber=2af40a0a
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
A:  FirstIf#=12 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=qcserial
E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=qcserial
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=qcserial
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
I:* If#=12 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=(none)
E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
I:* If#=13 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=(none)
I:  If#=13 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=(none)
E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms

And now I’m trying to get the modem in to QMI or GobiNet mode, but seems like it’s not able to do it with AT+QCFG. Querying AT!USBCOMP=? gives:

root@OpenWrt:~# echo -ne 'AT!USBCOMP=?\r\n' > /dev/ttyUSB2
!USBCOMP: 
AT!USBCOMP=<Config Index>,<Config Type>,<Interface bitmask>
  <Config Index>      - configuration index to which the composition applies, should be 1

  <Config Type>       - 1:MBIM USBIF, 2:PCIE USBIF, 3:Legacy-Generic, 4:RNDIS

  <Interface bitmask> - DIAG     - 0x00000001,
                        NMEA     - 0x00000004,
                        MODEM    - 0x00000008,
                        RMNET0   - 0x00000100,
                        RMNET1   - 0x00000400,
                        MBIM     - 0x00001000,
  e.g.
  10D  - diag, nmea, modem, rmnet interfaces enabled
  1009 - diag, modem, mbim interfaces enabled

  The default configuration is:
  at!usbcomp=1,3,10F

OK

root@OpenWrt:~# echo -ne 'AT!USBCOMP?\r\n' > /dev/ttyUSB2
Config Index: 1
Config Type:  3 (Generic)
Interface bitmask: 0000100D (diag,nmea,modem,mbim) 

Ah, I can see it in ModemManager, so I think I’m good on this initial issue. I’ll keep on digging away at my project and open a new issue if one arises. Thank you SO much for your help!

root@OpenWrt:~# mmcli -m 0
  -----------------------------
  General  |              path: /org/freedesktop/ModemManager1/Modem/0
           |         device id: [redacted]
  -----------------------------
  Hardware |      manufacturer: Sierra Wireless, Incorporated
           |             model: EM7565-9
           | firmware revision: SWI9X50C_00.06.02.00 f50f0a jenkins 2017/08/25 05:33:58
           |         supported: gsm-umts, lte
           |           current: gsm-umts, lte
  -----------------------------
  System   |            device: /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-3
           |           drivers: qcserial
           |            plugin: generic
           |      primary port: ttyUSB2
           |             ports: ttyUSB0 (qcdm), ttyUSB1 (gps), ttyUSB2 (at)
  -----------------------------
  Status   |             state: disabled
           |       power state: on
           |    signal quality: 0% (cached)
  -----------------------------
  Modes    |         supported: allowed: 2g, 3g, 4g; preferred: none
           |           current: allowed: 2g, 3g, 4g; preferred: none
  -----------------------------
  IP       |         supported: ipv4, ipv6, ipv4v6
  -----------------------------
  SIM      |  primary sim path: /org/freedesktop/ModemManager1/SIM/0

Yes, but you really want to use the faster network function. Either MBIM or QMI. Doesn’t matter much IMHO. Why not just install kmod-usb-net-cdc-mbim?

You can change the modem to QMI mode using the password protected

at!usbcomp=1,3,10D

as documented in the AT command manual. But I don’t see much point unless you know you want to play with QMAP etc. All QMI requests are available in MBIM mode as well. ModemManager knows how to use this, and it is supported by both uqmi and qmicli.

Thanks! I installed kmod-usb-net-cdc-mbim and now it’s showing up in both LuCI and shows the kernel driver as loaded for the USB device.

It seems to have picked up an IP and I’ll continue testing with it, posting my results over in this issue on GitHub.