User Tools

Site Tools



en:bpi-r3:lte

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
en:bpi-r3:lte [2022/09/25 13:44] franken:bpi-r3:lte [2022/12/11 09:20] – [LTE] frank
Line 2: Line 2:
  
 to test the EM7455 Card (+ NGFF Key-B Adapter) on the BPI-R3 (mPCIe Slot) to test the EM7455 Card (+ NGFF Key-B Adapter) on the BPI-R3 (mPCIe Slot)
 +
 +https://www.bipom.com/documents/sierra/4117727%20AirPrime%20EM-MC74xx%20AT%20Command%20Reference%20r4.pdf
  
 Kernel-Options: Kernel-Options:
Line 12: Line 14:
 </code> </code>
  
-MBIM-Mode (over wwan0)+Needed tools:
  
-https://gist.github.com/Juul/e42c5b6ec71ce11923526b36d3f1cb2c#connecting-using-mbim+  root@bpi-r3:~apt install libqmi-utils libmbim-utils
  
 i'm using a Congstar-SIM i'm using a Congstar-SIM
Line 20: Line 22:
 APN-settings: https://forum.congstar.de/thread/46325-mobil-surfen-mit-congstar-manuelle-einstellungen-zum-mobilen-internet-apn/ APN-settings: https://forum.congstar.de/thread/46325-mobil-surfen-mit-congstar-manuelle-einstellungen-zum-mobilen-internet-apn/
  
-===== first Test =====+Some information of different interface modes and which modules are required on Openwrt: 
 +https://forum.banana-pi.org/t/bpi-r3-information/12897/83?u=frank-w 
 + 
 + 
 +Openwrt: 
 + 
 +luci-proto-qmi (recommended) or even luci-proto-modemmanager 
 +===== QMI-Mode ===== 
 + 
 +Step-by-step guide with qmicli: 
 + 
 +https://techship.com/faq/how-to-step-by-step-set-up-a-data-connection-over-qmi-interface-using-qmicli-and-in-kernel-driver-qmi-wwan-in-linux/ 
 + 
 +<code> 
 +root@bpi-r3:~# qmicli --device=/dev/cdc-wdm0 --get-expected-data-format 
 +802-3 
 +root@bpi-r3:~# qmicli --device=/dev/cdc-wdm0 --wda-get-data-format 
 +[/dev/cdc-wdm0] Successfully got data format 
 +                   QoS flow header: no 
 +               Link layer protocol: 'raw-ip' 
 +  Uplink data aggregation protocol: 'disabled' 
 +Downlink data aggregation protocol: 'disabled' 
 +                     NDP signature: '0' 
 +Downlink data aggregation max datagrams: '0' 
 +Downlink data aggregation max size: '0' 
 +root@bpi-r3:~# ip link set dev wwan0 down 
 +root@bpi-r3:~# echo Y > /sys/class/net/wwan0/qmi/raw_ip 
 +root@bpi-r3:~# ip link set dev wwan0 up 
 + 
 + 
 + 
 + 
 + 
 +root@bpi-r3:~# qmicli --device=/dev/cdc-wdm0 -p --uim-verify-pin=PIN1,1234 
 +[/dev/cdc-wdm0] PIN verified successfully 
 + 
 +root@bpi-r3:~# qmicli --device=/dev/cdc-wdm0 -p --uim-get-card-status 
 +[/dev/cdc-wdm0] Successfully got card status 
 +Provisioning applications: 
 +        Primary GW:   slot '1', application '1' 
 +        Primary 1X:   session doesn't exist 
 +        Secondary GW: session doesn't exist 
 +        Secondary 1X: session doesn't exist 
 +Slot [1]: 
 +        Card state: 'present' 
 +        UPIN state: 'not-initialized' 
 +                UPIN retries: '0' 
 +                UPUK retries: '0' 
 +        Application [1]: 
 +                Application type:  'usim (2)' 
 +                Application state: 'ready' 
 +                Application ID: 
 +                        A0:00:00:00:87:10:02:FF:49:94:20:89:03:10:00:00 
 +                Personalization state: 'ready' 
 +                UPIN replaces PIN1: 'no' 
 +                PIN1 state: 'enabled-verified' 
 +                        PIN1 retries: '3' 
 +                        PUK1 retries: '10' 
 +                PIN2 state: 'enabled-not-verified' 
 +                        PIN2 retries: '3' 
 +                        PUK2 retries: '10' 
 +root@bpi-r3:~#  
 + 
 +qmicli -p -v -d /dev/cdc-wdm0 --wds-stop-network=disable-autoconnect --client-cid=37 
 +qmicli -v -p --device=/dev/cdc-wdm0 --wds-set-ip-family=6 
 +qmicli -d /dev/cdc-wdm0 --wds-get-profile-list=3gpp 
 +qmicli -d /dev/cdc-wdm0 --wds-get-channel-rates 
 +qmicli -d /dev/cdc-wdm0 --dms-set-fcc-authentication 
 +qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode 
 +</code> 
 + 
 + 
 + 
 +===== MBIM-Mode ===== 
 + 
 +https://gist.github.com/Juul/e42c5b6ec71ce11923526b36d3f1cb2c#connecting-using-mbim 
 + 
 +<code> 
 +qmicli -d /dev/cdc-wdm0 --dms-set-fcc-authentication --device-open-mbim 
 +mbimcli --device=/dev/cdc-wdm0 -p --enter-pin=$PIN1 
 +mbim-network /dev/cdc-wdm0 start 
 +mbimcli -d /dev/cdc-wdm0 -p --query-ip-configuration 
 +ip addr add 10.22.186.x/30 dev wwan0 
 +ip link set wwan0 up 
 +ip route add default via 10.22.186.y 
 +ping 8.8.8.8 
 +mbim-network /dev/cdc-wdm0 stop 
 +</code> 
 +==== first Test ====
  
 <code> <code>
Line 109: Line 199:
 </code> </code>
  
 +got a connection in MBIM-Mode:
 +<code>
 +root@bpi-r3:~# qmicli -d /dev/cdc-wdm0 --dms-set-fcc-authentication --device-open-mbim
 +[/dev/cdc-wdm0] Successfully set FCC authentication
 +root@bpi-r3:~# mbimcli --device=/dev/cdc-wdm0 -p --enter-pin=1234
 +[/dev/cdc-wdm0] PIN operation successful
 +
 +[/dev/cdc-wdm0] PIN info:
 +                 PIN state: 'locked'
 +                  PIN type: 'pin2'
 +        Remaining attempts: '3'
 +root@bpi-r3:~# mbim-network /dev/cdc-wdm0 start
 +Loading profile at /etc/mbim-network.conf...
 +    APN: internet.telekom
 +    APN auth protocol: PAP
 +    APN user: congstar
 +    APN password: cs
 +    mbim-proxy: yes
 +Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close --device-open-proxy'...
 +[/dev/cdc-wdm0] Subscriber ready status retrieved: Ready state: 'initialized' Subscriber ID: '262017041684242' SIM ICCID: '89490200001355851497' Ready info: 'none' Telephone numbers: (1) '+4915120251510' [/dev/cdc-wdm0] Session not closed: TRID: '4'
 +Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 4)
 +Querying registration state 'mbimcli -d /dev/cdc-wdm0 --query-registration-state --no-open=4 --no-close --device-open-proxy'...
 +[/dev/cdc-wdm0] Registration status: Network error: 'unknown' Register state: 'home' Register mode: 'automatic' Available data classes: 'lte' Current cellular class: 'gsm' Provider ID: '26201' Provider name: 'congstar' Roaming text: 'unknown' Registration flags: 'packet-service-automatic-attach' [/dev/cdc-wdm0] Session not closed: TRID: '6'
 +Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 6)
 +Attaching to packet service with 'mbimcli -d /dev/cdc-wdm0 --attach-packet-service --no-open=6 --no-close --device-open-proxy'...
 +Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 8)
 +Starting network with 'mbimcli -d /dev/cdc-wdm0 --connect=apn='internet.telekom',auth='PAP',username='congstar',password='cs' --no-open=8 --no-close --device-open-proxy'...
 +Network started successfully
 +Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 11)
 +root@bpi-r3:~# ip a s wwan0
 +11: wwan0: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
 +    link/ether 3e:06:6b:05:0a:17 brd ff:ff:ff:ff:ff:ff
 +root@bpi-r3:~# mbimcli -d /dev/cdc-wdm0 -p --query-ip-configuration
 +
 +[/dev/cdc-wdm0] IPv4 configuration available: 'address, gateway, dns, mtu'
 +     IP [0]: '10.153.121.ip/29'
 +    Gateway: '10.153.121.gw'
 +    DNS [0]: '10.74.210.210'
 +    DNS [1]: '10.74.210.211'
 +        MTU: '1500'
 +
 +[/dev/cdc-wdm0] IPv6 configuration available: 'address, gateway, dns, mtu'
 +     IP [0]: '2a01:598:808c:ba9c:c4e4:7a88:29ea:xxxx/64'
 +    Gateway: '2a01:598:808c:ba9c:93d:409b:3ddb:ee7'
 +    DNS [0]: '2a01:598:7ff:0:10:74:210:210'
 +    DNS [1]: '2a01:598:7ff:0:10:74:210:211'
 +        MTU: '1500'
 +root@bpi-r3:~# ip a s wwan0
 +11: wwan0: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
 +    link/ether 3e:06:6b:05:0a:17 brd ff:ff:ff:ff:ff:ff
 +root@bpi-r3:~# ip addr add 10.153.121.ip/29 dev wwan0
 +root@bpi-r3:~# ip link set wwan0 up
 +[  357.976946] 8021q: adding VLAN 0 to HW filter on device wwan0
 +root@bpi-r3:~# ip route add default via 10.153.121.gw
 +root@bpi-r3:~# ip r
 +default via 10.153.121.gw dev wwan0
 +10.153.121.net/29 dev wwan0 proto kernel scope link src 10.153.121.ip
 +root@bpi-r3:~# ping 8.8.8.8
 +PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
 +64 bytes from 8.8.8.8: icmp_seq=1 ttl=113 time=210 ms
 +64 bytes from 8.8.8.8: icmp_seq=2 ttl=113 time=30.6 ms
 +64 bytes from 8.8.8.8: icmp_seq=3 ttl=113 time=83.7 ms
 +^C
 +--- 8.8.8.8 ping statistics ---
 +3 packets transmitted, 3 received, 0% packet loss, time 2002ms
 +rtt min/avg/max/mdev = 30.566/108.191/210.347/75.416 ms
 +root@bpi-r3:~#
 +</code>
 ===== change Mode ===== ===== change Mode =====
  
-Caution this breaks functionality and i'm currently trying to fix it!+Caution this may break functionality! 
 + 
 +Make sure all known modules are loaded: 
 +<code> 
 +root@bpi-r3:~# modprobe qmi_wwan 
 +root@bpi-r3:~# modprobe qcserial 
 +root@bpi-r3:~# modprobe cdc_mbim 
 +</code> 
 + 
 +Get and switch mode (device open param should match your current Mode): 
 <code> <code>
 root@bpi-r3:~# qmicli -d /dev/cdc-wdm0 --device-open-mbim --dms-swi-get-usb-composition root@bpi-r3:~# qmicli -d /dev/cdc-wdm0 --device-open-mbim --dms-swi-get-usb-composition
Line 117: Line 285:
             USB composition 6: DM, NMEA, AT, QMI             USB composition 6: DM, NMEA, AT, QMI
         [*] USB composition 8: DM, NMEA, AT, MBIM         [*] USB composition 8: DM, NMEA, AT, MBIM
 +            USB composition 9: MBIM
 +
 +root@bpi-r3:~# qmicli -d /dev/cdc-wdm0 --device-open-qmi --dms-swi-get-usb-composition
 +[/dev/cdc-wdm0] Successfully retrieved USB compositions:
 +        [*] USB composition 6: DM, NMEA, AT, QMI
 +            USB composition 8: DM, NMEA, AT, MBIM
             USB composition 9: MBIM             USB composition 9: MBIM
  
 root@bpi-r3:~# qmicli -d /dev/cdc-wdm0 --device-open-mbim --dms-swi-set-usb-composition 6 root@bpi-r3:~# qmicli -d /dev/cdc-wdm0 --device-open-mbim --dms-swi-set-usb-composition 6
 +root@bpi-r3:~# qmicli -d /dev/cdc-wdm0 --device-open-qmi --dms-swi-set-usb-composition 8
 </code> </code>
  
-now no device is recognized by driver (no serial ttyUSBx too) and i saw in dmesg only this (also after cold-reset):+After that you will be prompted to set device offline and do reset. 
 + 
 +  qmicli ... --dms-set-operating-mode=offline 
 +  qmicli ... --dms-set-operating-mode=reset 
 + 
 +and you should see unregister of current devices and register of new, here switch from QMI to MBIM: 
 + 
 +<code> 
 +[  435.846807] usb 1-1.1: USB disconnect, device number 4 
 +[  435.852478] qcserial ttyUSB0: Qualcomm USB modem converter now disconnected from ttyUSB0 
 +[  435.860767] qcserial 1-1.1:1.0: device disconnected 
 +[  435.866377] qcserial ttyUSB1: Qualcomm USB modem converter now disconnected from ttyUSB1 
 +[  435.874650] qcserial 1-1.1:1.2: device disconnected 
 +[  435.880265] qcserial ttyUSB2: Qualcomm USB modem converter now disconnected from ttyUSB2 
 +[  435.888540] qcserial 1-1.1:1.3: device disconnected 
 +[  435.893721] qmi_wwan 1-1.1:1.8 wwx269b6469dbbd: unregister 'qmi_wwan' usb-11200000.usb-1.1, WWAN/QMI device 
 +[  443.533425] usb 1-1.1: new high-speed USB device number 5 using xhci-mtk 
 +[  443.763963] usb 1-1.1: config 1 has an invalid interface number: 12 but max is 4 
 +[  443.771366] usb 1-1.1: config 1 has an invalid interface number: 13 but max is 4 
 +[  443.778764] usb 1-1.1: config 1 has an invalid interface number: 13 but max is 4 
 +[  443.786158] usb 1-1.1: config 1 has no interface number 1 
 +[  443.791544] usb 1-1.1: config 1 has no interface number 4 
 +[  443.799669] qcserial 1-1.1:1.0: Qualcomm USB modem converter detected 
 +[  443.806455] usb 1-1.1: Qualcomm USB modem converter now attached to ttyUSB0 
 +[  443.814219] qcserial 1-1.1:1.2: Qualcomm USB modem converter detected 
 +[  443.820906] usb 1-1.1: Qualcomm USB modem converter now attached to ttyUSB1 
 +[  443.828921] qcserial 1-1.1:1.3: Qualcomm USB modem converter detected 
 +[  443.835728] usb 1-1.1: Qualcomm USB modem converter now attached to ttyUSB2 
 +[  443.898553] usbcore: registered new interface driver cdc_ether  
 +[  443.964054] usbcore: registered new interface driver cdc_ncm 
 +[  444.034077] cdc_mbim 1-1.1:1.12: cdc-wdm0: USB WDM device 
 +[  444.040007] cdc_mbim 1-1.1:1.12 wwan0: register 'cdc_mbim' at usb-11200000.usb-1.1, CDC MBIM, 66:9b:64:69:db:bd 
 +[  444.050308] usbcore: registered new interface driver cdc_mbim 
 +</code> 
 +==== troubleshooting ==== 
 + 
 +In my case no device is recognized by driver (no serial ttyUSBx too). Fixed this by adding usb-id in qcserial and qmi_wwan driver. 
 + 
 +But before i tried these steps: 
 + 
 +i saw in dmesg only this (also after cold-reset):
 <code> <code>
 [    3.592655] usb 1-1.1: new high-speed USB device number 4 using xhci-mtk [    3.592655] usb 1-1.1: new high-speed USB device number 4 using xhci-mtk
Line 129: Line 344:
 </code> </code>
  
-i loaded all known modules: 
-<code> 
-root@bpi-r3:~# modprobe qmi_wwan 
-root@bpi-r3:~# modprobe qcserial 
-root@bpi-r3:~# modprobe cdc_mbim 
-<code> 
 with this i have got access to the AT-Interface: with this i have got access to the AT-Interface:
  
Line 243: Line 452:
 </code> </code>
  
-leider ließ sich der default-mode nicht setzen +can't set default-mode, but the following fixes it and go back to mbim-mode after a cold-boot (ttyUSB accessible via options-module too)
  
 +<code>
 +AT!USBCOMP=1,1,100D
 +OK
 +AT!RESET
 +OK
 +</code>
en/bpi-r3/lte.txt · Last modified: 2023/06/08 17:06 by 127.0.0.1