Qmicli unable to communicate from raspberry pi to em7565 dev board via usb

Hello!
I am able to use screen to communicate and run AT commands. I even have an ip address as verified by at+cgpaddr. When using qmicli to communicate any and all commands involving the modem fail (shown below). My goal is to be able to use the wwan0 interface to ping (currently not working).
I’m not sure how to debug this or figure out what is being sent from the qmicli utility. Any insight would be very helpful.

sudo qmicli --device=/dev/cdc-wdm0 --get-expected-data-format
802-3

qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wda-get-data-format
[04 Nov 2022, 21:57:09] -Warning ** Cannot read from istream: connection broken
error: couldn't open the QmiDevice: Cannot write message: Error sending data: Broken pipe

sudo qmicli -d /dev/cdc-wdm0 --wda-get-data-format
error: couldn't create client for the 'wda' service: CID allocation failed in the CTL client: Transaction timed out
at!usbcomp?
Config Index: 1
Config Type:  3 (Generic)
Interface bitmask: 0000010D (diag,nmea,modem,rmnet0)

at+cgpaddr
+CGPADDR: 1,10.104.161.9

OK

Best,
Avi

Does it work with mbpl driver?

Hi jyijyi,
Unfortunately it was not successful. the result of the last step is an infinite loop of udhcpc: sending discover.

Here is the output from step2, 6, and 7 from fresh raspbian-64 image (the other steps were okay):

2

root@raspberrypi/root/usb# ln -s /dev/null /etc/systemd/network/99-default.link
ln: failed to create symbolic link '/etc/systemd/network/99-default.link': File exists

6

root@raspberrypi:/root/usb# echo Y > /sys/class/net/wwan0/qmi/raw_ip
bash: echo: write error: Device or resource busy

7

root@raspberrypi:/root/usb# sudo qmicli --device=/dev/cdc-wdm0 --wds-noop --client-no-release-cid
[/dev/cdc-wdm0] Client ID not released:
        Service: 'wds'
            CID: '18'

root@raspberrypi:/root/usb# udhcpc -i wwan0
udhcpc: started, v1.30.1
No resolv.conf for interface wwan0.udhcpc
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover

Thanks again.

no problem is found with Ubuntu PC, please see below


[  659.939617] usb 4-1: New USB device found, idVendor=1199, idProduct=9091
[  659.939618] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  659.939620] usb 4-1: Product: Sierra Wireless EM7511 Qualcomm® Snapdragon™ X16 LTE-A
[  659.939621] usb 4-1: Manufacturer: Sierra Wireless, Incorporated
[  659.939622] usb 4-1: SerialNumber: YT2217433xx1234
[  659.944979] qcserial 4-1:1.0: Qualcomm USB modem converter detected
[  659.945036] usb 4-1: Qualcomm USB modem converter now attached to ttyUSB0
[  659.945902] qcserial 4-1:1.2: Qualcomm USB modem converter detected
[  659.945991] usb 4-1: Qualcomm USB modem converter now attached to ttyUSB1
[  659.948071] qcserial 4-1:1.3: Qualcomm USB modem converter detected
[  659.948153] usb 4-1: Qualcomm USB modem converter now attached to ttyUSB2
[  659.949690] qmi_wwan 4-1:1.8: cdc-wdm0: USB WDM device
[  659.950795] qmi_wwan 4-1:1.8 wwan0: register 'qmi_wwan' at usb-0000:03:00.0-1, WWAN/QMI device, ea:65:ee:88:bd:e8
owner@ubuntu:~$ sudo chmod 777 /sys/class/net/wwan0/qmi/raw_ip
owner@ubuntu:~$ sudo echo Y > /sys/class/net/wwan0/qmi/raw_ip
owner@ubuntu:~$ sudo qmicli --device=/dev/cdc-wdm0 --wds-noop --client-no-release-cid
[/dev/cdc-wdm0] Client ID not released:
	Service: 'wds'
	    CID: '18'


***************
ati3                                                                            
Manufacturer: Sierra Wireless, Incorporated                                     
Model: EM7511                                                                   
Revision: SWI9X50C_01.14.02.00 2e210b jenkins 2020/08/19 14:18:39               
IMEI: 353587102161234                                                         
IMEI SV: 12                                                                     
FSN: YT221743351234                                                            
+GCAP: +CGSM                                                                    
                                                                                
                                                                                
OK                                                                              
                                                 
at+cgpaddr=1                                                                    
+CGPADDR: 1,10.154.235.197                                                      
                                                                                
OK                                                                              
at+cgdcont?                                                                     
+CGDCONT: 1,"IP","smartone","0.0.0.0",0,0,0,0                                   
                                                                                
OK                                                                              at!gstatus?                                                                     
!GSTATUS:                                                                       
Current Time:  234              Temperature: 26                                 
Reset Counter: 2                Mode:        ONLINE                             
System mode:   LTE              PS state:    Attached                           
LTE band:      B1               LTE bw:      15 MHz                             
LTE Rx chan:   374              LTE Tx chan: 18374                              
LTE SCC1 state:NOT ASSIGNED                                                     
LTE SCC2 state:NOT ASSIGNED                                                     
LTE SCC3 state:NOT ASSIGNED                                                     
LTE SCC4 state:NOT ASSIGNED                                                     
EMM state:     Registered       Normal Service                                  
RRC state:     RRC Idle                                                         
IMS reg state: No Srv                                                           
                                                                                
PCC RxM RSSI:  -57              PCC RxM RSRP:  -88                              
PCC RxD RSSI:  -93              PCC RxD RSRP:  -130                             
Tx Power:      --               TAC:         2775 (10101)                       
RSRQ (dB):     -11.6            Cell ID:     016e8a21 (24021537)                
SINR (dB):     12.4                                                             
                                                                                
                                                                                
OK                                                                              
at!scact=1,1                                                                    
OK    

***************

   
owner@ubuntu:~$ sudo udhcpc -i wwan0
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending select for 10.154.235.197
udhcpc: lease of 10.154.235.197 obtained, lease time 7200
owner@ubuntu:~$ ping 8.8.8.8 -I wwan0
PING 8.8.8.8 (8.8.8.8) from 10.154.235.197 wwan0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=56.8 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=21.6 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=116 time=36.6 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 21.642/38.371/56.805/14.407 ms

Thanks Jyijyi,
I decided to use openWRT, so this became a little easier. I installed kmod-usb-serial-qualcomm and things seem to be okay on the linux side of things.On the modem however, even though the modem is attached to the network (at+cgpaddr gives an ip address for pdp context: 1), I get the following:

at!scact=1,1
+CME ERROR: no network service

any insight here?

So you don’t install the MBPL driver?
Did you try with Ubuntu PC first?

Yes, On Ubuntu everything worked well. I was able to ping google.com after following your very useful guide. On openWRT I did not install MBPL drivers, but it looks like the qmi utility (uqmi) can talk to the modem.

Maybe you need to use the same MBPL driver in openWRT and see if it works first

At this point I’m more concerned about not being able to get an OK from AT!SCACT=1,1 even though I’ve been assigned an IP from my provider (AT&T for now).

Can you see anything wrong?

at
OK
ati3
Manufacturer: Sierra Wireless, Incorporated
Model: EM7565
Revision: SWI9X50C_01.14.13.00 883709 jenkins 2022/01/05 07:08:35
IMEI: 359260080929398
IMEI SV: 14
FSN: UF203303520410
+GCAP: +CGSM


OK
at+ccid?
+CCID: 89010303300092183574


OK
at+cimi
310030009218357

OK
at!entercnd="A710"
OK
at!sku?
SKU: 1103520

OK
AT!HWID?
Revision: 1.0

OK
AT!IMPREF?
!IMPREF:
 preferred fw version:    01.14.13.00
 preferred carrier name:  GENERIC
 preferred config name:   GENERIC_002.048_000
 preferred subpri index:  000
 current fw version:      01.14.13.00
 current carrier name:    GENERIC
 current config name:     GENERIC_002.048_000
 current subpri index:    000

OK
AT!PRIID?
PRI Part Number: 9907344
Revision: 002.006
Customer: Generic-M2M

Carrier PRI: 9999999_9907259_SWI9X50C_01.14.13.00_00_GENERIC_002.048_000
Carrier PRI: 9999999_9907258_SWI9X50C_01.07.02.00_00_ATT_002.008_012
Carrier PRI: 9999999_9908609_SWI9X50C_01.09.04.00_00_DOCOMO_002.015_002
Carrier PRI: 9999999_9908608_SWI9X50C_01.09.04.00_00_KDDI_002.018_002
Carrier PRI: 9999999_9908789_SWI9X50C_01.08.04.00_00_SIERRA_002.001_002
Carrier PRI: 9999999_9908607_SWI9X50C_01.09.04.00_00_SOFTBANK_002.017_002
Carrier PRI: 9999999_9909446_SWI9X50C_01.08.04.00_00_SPRINT_000.001_003
Carrier PRI: 9999999_9908610_SWI9X50C_01.11.00.00_00_TELSTRA_002.007_002
Carrier PRI: 9999999_9909335_SWI9X50C_01.07.02.00_00_TELUS_001.000_002
Carrier PRI: 9999999_9907257_SWI9X50C_01.08.04.00_00_VERIZON_002.015_006

OK
AT!USBCOMP?
Config Index: 1
Config Type:  3 (Generic)
Interface bitmask: 0000010D (diag,nmea,modem,rmnet0)

OK
AT!GSTATUS?
!GSTATUS:
Current Time:  2895             Temperature: 24
Reset Counter: 18               Mode:        ONLINE
System mode:   LTE              PS state:    Attached
LTE band:      B2               LTE bw:      20 MHz
LTE Rx chan:   700              LTE Tx chan: 18700
LTE SCC1 state:NOT ASSIGNED
LTE SCC2 state:NOT ASSIGNED
LTE SCC3 state:NOT ASSIGNED
LTE SCC4 state:NOT ASSIGNED
EMM state:     Registered       Normal Service
RRC state:     RRC Idle
IMS reg state: No Srv

PCC RxM RSSI:  -47              PCC RxM RSRP:  -80
PCC RxD RSSI:  -47              PCC RxD RSRP:  -80
Tx Power:      --               TAC:         0407 (1031)
RSRQ (dB):     -12.4            Cell ID:     01028108 (16941320)
SINR (dB):     21.6


OK
AT+COPS?
+COPS: 0,0,"AT&T",7

OK
AT+CGDCONT?
+CGDCONT: 1,"IPV4V6","","0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0",0,0,0,0

OK
AT!UIMS?
!UIMS: 0

OK
AT!BAND?
Index, Name,                        GW Band Mask     L Band Mask 1    TDS Band M                                                                                                                                                             ask    L Band Mask 2    L Band Mask 3    L Band Mask 4
00, All bands                     100600000EC00000 00002100BA0E19DF 000000000000                                                                                                                                                             0000 0000000000000002 0000000000000000 0000000000000000

OK
AT+CGDCONT=1,"IPV4V6","broadband"
OK
at
OK
at+cfun = 1
OK
at+cfun=0
OK
at+cfun=1
OK
at+creg?
+CREG: 0,1

OK
at+cgatt?
+CGATT: 1

OK
at+cgpaddr
+CGPADDR: 1,10.179.10.193

OK

It works on ubuntu pc, so only difference is driver

ok, MBPL was unnecessary here as those drivers are included in the openWRT kernel under the opkg names
kmod-usb-serial-qualcomm, kmod-usb-net-qmi-wwan, qmi-utils. I went over your guide again and I can ping through the wwan0 interface. Thanks for your help.