QUECTEL QMI driver for BBBw cannot setup as broadcast

Hi,
I have BBBw running with 4.19.50-ti-r20 kernel. I installed quectel qmi driver for cellular modem. The modem connected as WWAN0 network device. But it only runs as PPP mode:

wwan0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1460
inet 10.165.71.173 netmask 255.255.255.252 destination 10.165.71.173
inet6 fe80::c6eb:eaa0:60fa:5f22 prefixlen 64 scopeid 0x20
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 2 bytes 612 (612.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 6728 (6.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
//=======
While the same device, it is instantiated as network device in broadcast mode under debian (kernel 4.19.0-9-amd64).
wwp0s6u2i4: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST> mtu 1460
inet 10.165.77.108 netmask 255.255.255.248 broadcast 10.165.77.111
inet6 fe80::cc1a:8cff:fe9d:6386 prefixlen 64 scopeid 0x20
ether ce:1a:8c:9d:63:86 txqueuelen 1000 (Ethernet)
RX packets 2 bytes 612 (612.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 24 bytes 3758 (3.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Any suggestions to change PPP mode to BROADCAST mode ?

Thank you very much,

David

HI @dzhou, what’s the exact model of this chipset? lsusb?

Hi Robert,

idVendor=0x2c7c idProduct=0x296, bus=0x001, dev=0x003
Quectel BG96
Quectel_QConnectManager_Linux_V1.5.9

I am not sure this could be related to the signal and connectivity.

Thank you,
David

DO you have libqmi-utils’s installed?

This might help configure the device:

http://www.embeddedpi.com/documentation/3g-4g-modems/raspberry-pi-sierra-wireless-mc7304-modem-qmi-interface-setup

Regards,

Hi Robert,

I posted more messages:
//================= Good under VirtualBox Debian (4.19.0 kernel)
./quectel-CM -s ibasis.iot
[07-14_15:08:52:732] Quectel_QConnectManager_Linux_V1.5.9
[07-14_15:08:52:732] Find /sys/bus/usb/devices/1-2 idVendor=0x2c7c idProduct=0x296, bus=0x001, dev=0x003
[07-14_15:08:52:732] Auto find qmichannel = /dev/cdc-wdm0
[07-14_15:08:52:733] Auto find usbnet_adapter = wwp0s6u2i4
[07-14_15:08:52:733] netcard driver = qmi_wwan, driver version = 22-Aug-2005
[07-14_15:08:52:733] Modem works in QMI mode
[07-14_15:08:52:739] cdc_wdm_fd = 7
[07-14_15:08:52:782] Get clientWDS = 1
[07-14_15:08:52:790] Get clientDMS = 1
[07-14_15:08:52:798] Get clientNAS = 1
[07-14_15:08:52:806] Get clientUIM = 1
[07-14_15:08:52:814] Get clientWDA = 1
[07-14_15:08:52:822] requestBaseBandVersion BG96MAR02A10M1G
[07-14_15:08:52:854] requestGetSIMStatus SIMStatus: SIM_READY
[07-14_15:08:52:854] requestSetProfile[1] ibasis.iot///0
[07-14_15:08:52:880] requestGetProfile[1] ibasis.iot///0
[07-14_15:08:52:886] requestRegistrationState2 MCC: 310, MNC: 260, PS: Attached, DataCap: EDGE
[07-14_15:08:52:893] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[07-14_15:08:52:893] ifconfig wwp0s6u2i4 down
[07-14_15:08:52:919] ifconfig wwp0s6u2i4 0.0.0.0
[07-14_15:09:00:185] requestSetupDataCall WdsConnectionIPv4Handle: 0x83339490
[07-14_15:09:00:211] change mtu 1500 -> 1460
[07-14_15:09:00:211] ifconfig wwp0s6u2i4 up
[07-14_15:09:00:269] busybox udhcpc -f -n -q -t 5 -i wwp0s6u2i4
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending select for 10.165.77.108
udhcpc: lease of 10.165.77.108 obtained, lease time 7200

//========Device Instantiated
wwp0s6u2i4 : flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST> mtu 1460
inet 10.165.77.108 netmask 255.255.255.248 broadcast 10.165.77.111
inet6 fe80::cc1a:8cff:fe9d:6386 prefixlen 64 scopeid 0x20
ether ce:1a:8c:9d:63:86 txqueuelen 1000 (Ethernet)
RX packets 2 bytes 612 (612.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 24 bytes 3758 (3.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

//============================Failed on BBBw
[07-15_12:08:23:944] Quectel_QConnectManager_Linux_V1.5.9
[07-15_12:08:23:944] Find /sys/bus/usb/devices/1-2 idVendor=0x2c7c idProduct=0x296, bus=0x001, dev=0x003
[07-15_12:08:23:944] Auto find qmichannel = /dev/cdc-wdm0
[07-15_12:08:23:944] Auto find usbnet_adapter = wwp0s6u2i4
[07-15_12:08:23:944] netcard driver = qmi_wwan, driver version = 22-Aug-2005
[07-15_12:08:23:944] Modem works in QMI mode
[07-15_12:08:23:950] /proc/2287/fd/7 -> /dev/cdc-wdm0
[07-15_12:08:23:950] /proc/2287/exe -> /usr/lib/libqmi/qmi-proxy
[07-15_12:08:25:950] cdc_wdm_fd = 7
[07-15_12:08:26:037] QmiWwanThread read=-1 errno: 11 (Resource temporarily unavailable)
[07-15_12:08:26:979] QmiThreadSendQMITimeout pthread_cond_timeout_np timeout
[07-15_12:08:28:039] Get clientWDS = 1
[07-15_12:08:28:047] Get clientDMS = 5
[07-15_12:08:28:055] Get clientNAS = 1
[07-15_12:08:28:063] Get clientUIM = 1
[07-15_12:08:28:071] Get clientWDA = 1
[07-15_12:08:28:079] requestBaseBandVersion BG96MAR02A07M1G
[07-15_12:08:28:111] requestGetSIMStatus SIMStatus: SIM_READY
[07-15_12:08:28:111] requestSetProfile[1] ibasis.iot///0
[07-15_12:08:28:131] requestGetProfile[1] ibasis.iot///0
[07-15_12:08:28:139] requestRegistrationState2 MCC: 0, MNC: 0, PS: Detached, DataCap: UNKNOW
[07-15_12:08:28:147] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
[07-15_12:08:28:147] ifconfig wwp0s6u2i4 down
[07-15_12:08:28:268] ifconfig wwp0s6u2i4 0.0.0.0
[07-15_12:08:34:118] requestRegistrationState2 MCC: 310, MNC: 260, PS: Detached, DataCap: UNKNOW
[07-15_12:08:40:079] requestRegistrationState2 MCC: 310, MNC: 260, PS: Detached, DataCap: EDGE
[07-15_12:08:40:086] requestRegistrationState2 MCC: 310, MNC: 260, PS: Detached, DataCap: EDGE
[07-15_12:08:44:807] requestRegistrationState2 MCC: 310, MNC: 260, PS: Attached, DataCap: EDGE
[07-15_12:08:45:664] requestSetupDataCall WdsConnectionIPv4Handle: 0x833c9b80
[07-15_12:08:45:687] change mtu 1500 -> 1460
[07-15_12:08:45:688] ifconfig wwp0s6u2i4 up
[07-15_12:08:45:742] busybox udhcpc -f -n -q -t 5 -i wwp0s6u2i4
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: no lease, failing

//===============
ONLY as PPP:
wwan0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1460
inet 10.165.71.173 netmask 255.255.255.252 destination 10.165.71.173
inet6 fe80::c6eb:eaa0:60fa:5f22 prefixlen 64 scopeid 0x20
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC)
RX packets 2 bytes 612 (612.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 6728 (6.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

//===================

Yes, I have libqmi-utils installed.
I was also using qmicli commands, but no help.

//==============================
[07-16_06:30:29:841] change mtu 1500 -> 1460
[07-16_06:30:29:847] ifconfig wwan0 up
[07-16_06:30:29:887] busybox udhcpc -f -n -q -t 5 -i wwan0
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: no lease, failing
///=======MY NOTE: no lease for the first time. If got lease, it is in broadcast mode
//=======Then try and second time, it got PPP ip address.
[07-16_06:30:45:200] File:ql_raw_ip_mode_check Line:105 udhcpc fail to get ip address, try next:
[07-16_06:30:45:202] ifconfig wwan0 down
[07-16_06:30:45:255] echo Y > /sys/class/net/wwan0/qmi/raw_ip
[07-16_06:30:45:267] ifconfig wwan0 up
[07-16_06:30:45:317] busybox udhcpc -f -n -q -t 5 -i wwan0
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending select for 10.165.94.253
udhcpc: lease of 10.165.94.253 obtained, lease time 7200
ip: RTNETLINK answers: File exists
//======================

One thing I debugged:
in /sys/class/net/wwan0/qmi/raw_ip
Y
//====================
read(fd, mode, 2);
if (mode[0] == ‘0’ || mode[0] == ‘N’) { //////MY NOTE: raw_ip is Y, I don’t know why it runs this block of code:
dbg_time(“File:%s Line:%d udhcpc fail to get ip address, try next:”, func, LINE);
snprintf(shell_cmd, sizeof(shell_cmd), “ifconfig %s down”, ifname);
ql_system(shell_cmd);
dbg_time(“echo Y > /sys/class/net/%s/qmi/raw_ip”, ifname);
mode[0] = ‘Y’;
write(fd, mode, 2);
mode_change = 1;
snprintf(shell_cmd, sizeof(shell_cmd), “ifconfig %s up”, ifname);
ql_system(shell_cmd);
}
//===================

Thank you,
David

Hi Robert,

The BBBw has wwan0 network device created in the /sys/class/net/wwan0. I bet there is some flag or broadcast, etc. setting to set/fixed as PPP. That may be due to the settings//configuration of kernel (menu) when the kernel is built. Or maybe broadcast mode is a setting in the kernel menu that needs to be checked.

Comparing to Debian (amd64 4.19.0 kernel), there is no wwan0 under /sys/class/net, the net adaptor name is created as wwp0s6u2i4, which is dynamically created (when usb of modem is connected). So there is some where that flags the kernel how to instantiate the usb-net adaptor (as PPP or broadcast mode).

This is my thinking right now.

Have a nice weekend,

David

Hi Robert,

I got modem working under PPP mode. I am using the following commands to setup:
ifconfig wwan0 down
echo Y > /sys/class/net/wwan0/qmi/raw_ip
ifconfig wwan0 up
qmicli -p -d /dev/cdc-wdm0 --wds-start-network=the_apn --client-no-release-cid
qmicli --device=/dev/cdc-wdm0 --wds-get-current-settings
udhcpc -q -f -i wwan0 //assigns gateway

//as PPP Ethernet Adaptor
wwan0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1460
inet 10.165.165.40 netmask 255.255.255.240 destination 10.165.165.40
inet6 fe80::58de:a8fc:fdb7:b86c prefixlen 64 scopeid 0x20
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000
(UNSPEC)
RX packets 34 bytes 4993 (4.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 42 bytes 4643 (4.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Although it is not as broadcast mode, I think there is no essential difference. It has internet access through service provider’s domain name and gateway.

Best Regards,

David

I have not found any key difference when comparing our two kernel config’s. (Side note, we use Debian’s default config as our base…)

The wwan0 vs wwp0s6u2i4 can be easily fixed by removing “net.ifnames=0” from /boot/uEnv.txt

Regards,

Hi Robert,

Thank you for your investigation of WWAN driver. I am also in contacting with an FAE of Quectel. They might provide me with more information.
For now, I am good. I think PPP will also work. The only difference is to set gateway and DNS server with the service provider.

I have another question regarding flashing u-boot firmware. I will post as a new thread.

Thank you again.

David

I’m sorry we do not currently have Quectel on our line card.

Regards,