Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:network:wan:wwan:ltedongle [2024/02/01 14:22] – [About] andrewzdocs:guide-user:network:wan:wwan:ltedongle [2024/11/27 18:05] – [LTE or 5G Modem Preparation] andrewz
Line 2: Line 2:
  
 Many of currently available 3G/4G/5G modems use **QMI** and/or **MBIM** protocol to interact with the //host system//, e.g. with a router. Many of currently available 3G/4G/5G modems use **QMI** and/or **MBIM** protocol to interact with the //host system//, e.g. with a router.
-For your information, [[https://blogs.gnome.org/dcbw/2010/04/15/mobile-broadband-and-qualcomm-proprietary-protocols/|QMI]] is a proprietary protocol by Qualcomm. In contrast to QMI, [[http://compliance.usb.org/mbim/|MBIM]] is more standardized protocol for such modems.+For your information, [[https://blogs.gnome.org/dcbw/2010/04/15/mobile-broadband-and-qualcomm-proprietary-protocols/|QMI]] is a proprietary protocol by Qualcomm. In contrast to QMI, [[https://modemmanager.org/docs/libmbim/mbim-protocol/|MBIM]] is more standardized protocol for such modems.
  
-This recipe explains how to setup and configure OpenWrt for using 3G/4G/5G USB modems for WAN connection, using QMI interface.+This recipe explains how to setup and configure OpenWrt for using 3G/4G/5G USB modems for WAN connection, using QMI or MBIM protocol.
  
 The same applies to external modems connected to USB ports and internal models installed into M.2(NGFF) or mPCIe slots. The same applies to external modems connected to USB ports and internal models installed into M.2(NGFF) or mPCIe slots.
  
-You may want to checkout the [[docs/guide-user/network/wan/multiwan/mwan3]] (Multi WAN load balancing/failover) package to use this simultaneously with other connections to the internet.+You may want to checkout the [[docs/guide-user/network/wan/multiwan/mwan3]] (Multi WAN load balancing/failover) package to use this simultaneously with other connections to the Internet.
  
 ===== About ===== ===== About =====
Line 17: Line 17:
   * **RNDIS**, see [[docs:guide-user:network:wan:wwan:ethernetoverusb_rndis|How To use LTE modem in RNDIS mode for WAN connection]]   * **RNDIS**, see [[docs:guide-user:network:wan:wwan:ethernetoverusb_rndis|How To use LTE modem in RNDIS mode for WAN connection]]
  
-If it is possible to switch your modem to provide QMI interface - then this article if for **YOU**.+If it is possible to switch your modem to provide QMI or MBIM interface - then this article is for you.
  
 ==== Legacy Modem Preparation ==== ==== Legacy Modem Preparation ====
-If **QMI** interface is not exposed by the modem initially you may need to switch it to another mode or //composition// by using [[docs:guide-user:network:wan:wwan:usb-modeswitching|USB mode switch]] tool or a vendor-specific AT command.+If QMI or MBIM interface is not exposed by the modem initially you may need to switch it to another mode or //composition// by using [[docs:guide-user:network:wan:wwan:usb-modeswitching|USB mode switch]] tool or a vendor-specific AT command.
  
 :!: Please read about [[docs:guide-user:network:wan:wwan:at_commands|AT commands]] for your modem. :!: Please read about [[docs:guide-user:network:wan:wwan:at_commands|AT commands]] for your modem.
Line 27: Line 27:
 More recent modems are set by default to MBIM or QMI mode. More recent modems are set by default to MBIM or QMI mode.
  
-This is an example for popular Quectel modems:+This is an example of switching modes for popular Quectel modems (don't expect these proprietary commands to work on devices from other manufacturers):
 <code> <code>
 AT+QCFG="usbnet" # check the current mode AT+QCFG="usbnet" # check the current mode
Line 34: Line 34:
 AT+QCFG="usbnet",2 # set MBIM mode AT+QCFG="usbnet",2 # set MBIM mode
 </code> </code>
-Reset the power to apply changes.+Reset the modem to apply changes - power toggle it or send ''AT+CFUN=1,1'' command. 
 + 
 +\\ 
 +It is worth checking the list of //PDP Contexts// (and APNs) configured on the modem. Use a //terminal// program to query the modem with ''AT+CGDCONT?'' and observe the output. Example: 
 +<code> 
 +AT+CGDCONT? 
 ++CGDCONT: 1,"IPV4V6","internet",... 
 ++CGDCONT: 2,"IPV4V6","ims",... 
 ++CGDCONT: 3,"IPV4V6","sos",... 
 +</code> 
 + 
 +Typically, but not always, context #1 is used for Internet connection. If it is not configured with the correct information (IP type and APN), it is recommended to set the desired parameters. Example: 
 + 
 +<code> 
 +AT+CGDCONT=1,"IP","internet" 
 +</code> 
 + 
 +Replace ''IP'' with ''IPV4V6'' or ''IPV6'' if necessary and use your APN instead of ''internet''
 + 
 +For an alternative method, see [[:docs:guide-user:network:wan:wwan:ltedongle]] section below. 
 + 
 +\\ 
 +While in the //terminal//, check the modem firmware version with ''ATI'' and see if there is an upgrade available. 
 + 
 + 
 + 
 ==== Router Preparation ==== ==== Router Preparation ====
 1. Install OpenWrt 1. Install OpenWrt
Line 43: Line 69:
  
 ==== Required Packages ==== ==== Required Packages ====
-To make use of QMI protocol, packages ''kmod-usb-net-qmi-wwan'' (driver) and ''uqmi'' (control utility) are needed.+To make use of QMI protocol, packages ''kmod-usb-net-qmi-wwan'' (driver) and ''uqmi'' (control utility) are needed. For MBIM protocol the packages are ''kmod-usb-net-cdc-mbim'' and ''umbim''
  
 ==== Optional Packages ==== ==== Optional Packages ====
-1. Add QMI protocol support to Luci - install ''luci-proto-qmi''+1. Add protocol support to Luci - install ''luci-proto-qmi'' for QMI or ''luci-proto-mbim'' for MBIM.
  
 2. Add support for //serial// interfaces (ttyUSBx) - install ''kmod-usb-serial-option'' or  ''kmod-usb-serial-qualcomm'' depending on the modem. 2. Add support for //serial// interfaces (ttyUSBx) - install ''kmod-usb-serial-option'' or  ''kmod-usb-serial-qualcomm'' depending on the modem.
Line 53: Line 79:
 A //terminal// program like ''picocom'' will be needed to actually send AT commands. A //terminal// program like ''picocom'' will be needed to actually send AT commands.
  
-3. Install ''usb-modeswitch'' __if__ that is needed for switching the modem into a "working" state. More about: [[docs:guide-user:network:wan:wwan:usb-modeswitching|USB mode switch]]+3. Install [[:packages:pkgdata:usb-modeswitch]] package __only if__ that is needed for switching the modem into a "working" state. More about: [[docs:guide-user:network:wan:wwan:usb-modeswitching|USB mode switch]]
  
 4. Add support for the //storage// of your modem - refer to: [[docs:guide-user:storage:usb-drives|USB Storage]] 4. Add support for the //storage// of your modem - refer to: [[docs:guide-user:storage:usb-drives|USB Storage]]
  
 ===== Sample installation ===== ===== Sample installation =====
-1. Install all the needed packages+1. Install all the needed packages either in Luci → System → Software or via command line: 
 +  * if the modem is in QMI mode:
 <code> <code>
-opkg update +root@OpenWrt:~# opkg update 
-opkg install kmod-usb-net-qmi-wwan uqmi luci-proto-qmi kmod-usb-serial-option picocom+root@OpenWrt:~# opkg install kmod-usb-net-qmi-wwan uqmi luci-proto-qmi kmod-usb-serial-option picocom 
 +</code> 
 +  * if the modem is in MBIM mode: 
 +<code> 
 +root@OpenWrt:~# opkg update 
 +root@OpenWrt:~# opkg install kmod-usb-net-cdc-mbim umbim luci-proto-mbim kmod-usb-serial-option picocom
 </code> </code>
  
-:!: If your have not enough space on your device - think of installing [[docs:guide-user:additional-software:extroot_configuration|Rootfs on External Storage (extroot)]]+You can also add the necessary packages when building a new image with [[https://firmware-selector.openwrt.org/|Firmware Selector]].
  
-:!: Another option is Hardware memory upgrade. Refer to your router Forum thread for possibility and instructions.+:!: If your have not enough space on your device - think about upgrading your hardware or installing [[docs:guide-user:additional-software:extroot_configuration|Rootfs on External Storage (extroot)]]. Refer to your router wiki page or forum thread for possibility and instructions.
  
-2. Reboot the router +2. Reboot the router by executing ''reboot'' on the console.
-<code> +
-reboot +
-</code>+
  
-3. Check that everything is OK and You got new device:+3. Check if you got new //device//:
 <code> <code>
-ls -l /dev/cdc-wdm0+root@OpenWrt:~# ls -l /dev/cdc*
  
 crw-r--r--    1 root     root      180, 176 Oct  1 12:03 /dev/cdc-wdm0 crw-r--r--    1 root     root      180, 176 Oct  1 12:03 /dev/cdc-wdm0
 </code> </code>
  
-If you have no such device - try to find out what went wrong:+If there is no such device found - try to get more details:
  
-try **dmesg** to read kernel logs on USB init +  Open System Log from Luci web interface and see what it shows regarding newly discovered USB device(s) 
-<code> +  execute ''dmesg'' on the console and see if any relevant information is present in the kernel log 
-dmesg +  * check the details about USB devices detected by the system by running ''cat /sys/kernel/debug/usb/devices'' on the console:
-</code> +
-or look info about USB devices and interfaces present in the system+
-<code> +
-cat /sys/kernel/debug/usb/devices+
  
-T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  Spd=480  MxCh= 0 +<code> 
-D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= +[...] 
-P:  Vendor=12d1 ProdID=1506 Rev= 0.00 +T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  Spd=480  MxCh= 0 
-S:  Manufacturer=Huawei Technologies +D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 
-S:  Product=HUAWEI Mobile +P:  Vendor=2c7c ProdID=0306 Rev= 3.10 
-C:* #Ifs= Cfg#= 1 Atr=c0 MxPwr=500mA +S:  Manufacturer=Quectel 
-I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=02 Driver=option+S:  Product=EP06-E 
 +S:  SerialNumber=0123456789ABCDEF 
 +C:* #Ifs= Cfg#= 1 Atr=a0 MxPwr=500mA 
 +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
 E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
-E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms +E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms 
-I:* If#= 1 Alt= 0 #EPs= Cls=ff(vend.) Sub=01 Prot=09 Driver=qmi_wwan +I:* If#= 1 Alt= 0 #EPs= Cls=ff(vend.) Sub=00 Prot=00 Driver=option 
-E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=2ms +E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms 
-I:* If#= 2 Alt= 0 #EPs= Cls=ff(vend.) Sub=01 Prot=08 Driver=qmi_wwan +E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms 
-E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms 
-E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms+I:* If#= 2 Alt= 0 #EPs= Cls=ff(vend.) Sub=00 Prot=00 Driver=option 
 +E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms 
 +E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms 
 +E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms 
 +I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option 
 +E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms 
 +E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms 
 +E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms 
 +I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan 
 +E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms 
 +E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms 
 +E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
 </code> </code>
  
Line 110: Line 149:
 ===== Configuration ===== ===== Configuration =====
 ==== With LuCi web interface ==== ==== With LuCi web interface ====
-If the package ''luci-proto-qmi'' is installed, navigate to Network → Interfaces, then Add new interface… → Protocol : QMI, Interface: cdc-wdm0+[QMI]: Assuming ''luci-proto-qmi'' package is installed, navigate to Network → Interfaces, then Add new interface… → Protocol: QMI Cellular 
 +  
 +[MBIM]: Assuming ''luci-proto-mbim'' package is installednavigate to Network → Interfaces, then Add new interface… → ProtocolMBIM Cellular 
 + 
 +[Common]: 
 + 
 +Select Interface "cdc-wdm0" in the drop-down. If it is not available there, check if the corresponding driver (''kmod-usb-net-*'') is loaded, reset the modem if its mode has recently been changed.
  
-Enter your ''APN'' and select the ''IP type'' as instructed by the carrier.+Enter your ''APN'' and select the ''IP type'' as instructed by the carrier, __don't set ''IP type'' to ''IPV4V6'' until you're 100% sure that provider supports IPv6__, that is critical in QMI mode.
  
-Assign the firewall zone (typically - "wan").+Note: in IPv6-only mode it is recommended to enable ''dhcpv6'' option on in order to automatically start the 464XLAT interface (that requires [[:packages:pkgdata:464xlat]] package).
  
-==== Editing text configuration file =====+Assign the firewall zone (wan) on 'Firewall Settings' tab. 
 +==== Editing text configuration files =====
 Add new interface to ''/etc/config/network'' using a //text editor// like ''vi'' or ''nano'': Add new interface to ''/etc/config/network'' using a //text editor// like ''vi'' or ''nano'':
  
Line 126: Line 172:
         option pdptype 'ip'         option pdptype 'ip'
 </code> </code>
 +Make sure the APN name is one provided by your carrier.
 +
 +Add the same interface name to the existing “wan” firewall zone in ''/etc/config/firewall'':
 +<code>
 +config zone
 +    option name 'wan'
 +    [...]
 +    list network 'wwan'
 +</code>
 +
  
 ==== QMI Protocol Configuration Parameters ==== ==== QMI Protocol Configuration Parameters ====
-You can configure UCI manually using [[docs:techref:uci|uci command line]] or [[docs:guide-user:base-system:user.beginner.cli#editing.files| text editor]].\\ +QMI (and MBIM) interfaces could be manually configured in [[docs:guide-user:base-system:uci|UCI]] using [[docs:techref:uci|uci command line]] or [[docs:guide-user:base-system:user.beginner.cli#editing.files| text editor]].\\
-[[docs:guide-user:base-system:uci|UCI]] is supporting **qmi** network protocol configuration.+
  
-:!: The package uqmi must be installed to use QMI protocol. 
  
-^Name            ^Type        ^Required  ^Default         ^Description ^ +^ Name             ^ Type        Required  Default          ^ Description                                                                                                                                                                                 
-|**device**   |file path      |yes    |(none)          |QMI device node, typically **/dev/cdc-wdm0** | +| **device**       | file path   yes        (none)           | QMI device node, typically **/dev/cdc-wdm0**                                                                                                                                                
-|**apn**   |string         |yes    |(none)          |Used APN | +| **apn**          | string      yes        (none)           | Used APN                                                                                                                                                                                    
-|**auth**        |string         |no     |(none)          |Authentication type: **pap**, **chap**, **both**, **none** | +| **v6apn**        | string      no         (none)           | APN for IPv6, if different from IPv4 APN                                                                                                                                                    | 
-|**username**   |string         |no     |(none)          |Username for PAP/CHAP authentication | +| **auth**         | string     |  no        |  (none)           | Authentication type: **pap**, **chap**, **both**, **none**                                                                                                                                  
-|**password**   |string         |no     |(none)          |Password for PAP/CHAP authentication | +| **username**     | string      no         (none)           | Username for PAP/CHAP authentication                                                                                                                                                        
-|**pincode**     |number         |no     |(none)          |PIN code to unlock SIM card | +| **password**     | string      no         (none)           | Password for PAP/CHAP authentication                                                                                                                                                        
-|**delay**       |number         |no     |0               |Seconds to wait before trying to interact with the modem (some ZTE modems require up to 30 s.) | +| **pincode**      | number      no         (none)           | PIN code to unlock SIM card                                                                                                                                                                 
-|**modes**       |string         |no     |(modem default) |Allowed network modes, comma separated list of: **all**, **lte**, **umts**, **gsm**, **cdma**, **td-scdma** | +| **delay**        | number      no                        | Seconds to wait before trying to interact with the modem (some ZTE modems require up to 30 s.)                                                                                              
-|**pdptype**     |string         |no     |IP              |Used IP-stack mode, IP (for IPv4), IPV6 (for IPv6) or IPV4V6 (for dual-stack). Some carriers require specific stack or it won't connect. | +| **modes**        | string      no         (modem default)  | Allowed network modes, comma separated list of: **all**, **lte**, **umts**, **gsm**, **cdma**, **td-scdma**                                                                                 
-|**profile**     |number         |no     |(none)          |Connection profile to use +| **pdptype**      | string      no         IP               PDP Context Type, IP (for IPv4), IPV6 (for IPv6) or IPV4V6 (for dual-stack). Connection will fail if selected type is unsupported by the carrier                                          
-|**dhcp**        |boolean        |no     |1               |Whether to use dhcp (**default**) or uqmi (**0**) to get IPv4 interface configuration | +| **profile**      | number      no         1                | PDP Context Identifier                                                                                                                                                                      | 
-|**dhcpv6**      |boolean        |no     |0               |Whether to use dhcp (**1**) or uqmi (**default**) to get IPv6 interface configuration | +| **v6profile**    | number     |  no        |  (none)           PDP Context Identifier for IPv6 if different from IPv4 profile                                                                                                                              
-|**autoconnect** |boolean        |no     |1               |Enable automatic connect/reconnect +| **dhcp**         | boolean     no                        | Whether to use DHCP (**default**) or uqmi (**0**) to get IPv4 interface configuration                                                                                                       
-|**plmn**        |number         |no     |(none)          |First three digits are the **mcc** (mobile country code) and the last three digits are the **mnc** (mobile network code)for example if plmn=338020, then the mcc is 338 and the mnc is 020 | +| **dhcpv6**       | boolean     no                        | Whether to use DHCP (**1**) or uqmi (**default**) to get IPv6 interface configuration                                                                                                       
-|**timeout**     |number         |no     |10              |Timeout (in seconds) to wait for SIM operations |+| **autoconnect**  | boolean     no                                                                                                                                                                                                                    
 +| **plmn**         | number      no         (none)           | First three digits is the **MCC** (Mobile Country Code) and the last three digits is the **MNC** (Mobile Network Code)for example if plmn=338020, then the MCC is 338 and the MNC is 020  
 +| **timeout**      | number      no         10               | Timeout (in seconds) to wait for SIM operations                                                                                                                                             | 
 +| **mtu**          | number      no        |  (none)           | Interface MTU size                                                                                                                                                                          |
  
-Here is a brief help about **uqmi** command line usage.+Here is a brief help about ''uqmi'' command line usage
 +<hidden>
 <code sh> <code sh>
-No device given 
 Usage: uqmi <options|actions> Usage: uqmi <options|actions>
 Options: Options:
Line 184: Line 241:
   --set-ip-family <val>:            Set ip-family (ipv4, ipv6, unspecified)   --set-ip-family <val>:            Set ip-family (ipv4, ipv6, unspecified)
   --set-autoconnect <val>:          Set automatic connect/reconnect (disabled, enabled, paused)   --set-autoconnect <val>:          Set automatic connect/reconnect (disabled, enabled, paused)
 +  --get-profile-settings <val,#>:   Get APN profile settings (3gpp, 3gpp2),#
 +  --get-default-profile <val>:      Get default profile number (3gpp, 3gpp2)
 +  --create-profile <val>            Create profile (3gpp, 3gpp2)
 +    --apn <apn>:                    Use APN
 +    --pdp-type ipv4|ipv6|ipv4v6>:   Use pdp-type for the connection
 +    --username <name>:              Use network username
 +    --password <password>:          Use network password
 +    --auth-type pap|chap|both|none: Use network authentication type
 +    --no-roaming false|true         To allow roaming, set to false
 +  --modify-profile <val>,#          Modify profile number (3gpp, 3gpp2)
 +    --apn <apn>:                    Use APN
 +    --pdp-type ipv4|ipv6|ipv4v6>:   Use pdp-type for the connection
 +    --username <name>:              Use network username
 +    --password <password>:          Use network password
 +    --auth-type pap|chap|both|none: Use network authentication type
 +    --no-roaming false|true         To allow roaming, set to false
   --get-current-settings:           Get current connection settings   --get-current-settings:           Get current connection settings
   --get-capabilities:               List device capabilities   --get-capabilities:               List device capabilities
Line 210: Line 283:
   --get-msisdn:                     Get the MSISDN (telephone number)   --get-msisdn:                     Get the MSISDN (telephone number)
   --reset-dms:                      Reset the DMS service   --reset-dms:                      Reset the DMS service
 +  --get-device-operating-mode       Get the device operating mode
   --set-device-operating-mode <m>   Set the device operating mode   --set-device-operating-mode <m>   Set the device operating mode
                                     (modes: online, low_power, factory_test, offline                                     (modes: online, low_power, factory_test, offline
Line 217: Line 291:
   --uim-verify-pin1 <pin>:          Verify PIN1 (new devices)   --uim-verify-pin1 <pin>:          Verify PIN1 (new devices)
   --uim-verify-pin2 <pin>:          Verify PIN2 (new devices)   --uim-verify-pin2 <pin>:          Verify PIN2 (new devices)
 +  --uim-get-sim-state:              Get current SIM state
 +  --uim-power-off:                  Power off SIM card
 +    --uim-slot:                     SIM slot [1-2]
 +  --uim-power-on:                   Power on SIM card
 +    --uim-slot:                     SIM slot [1-2]
   --set-network-modes <modes>:      Set usable network modes (Syntax: <mode1>[,<mode2>,...])   --set-network-modes <modes>:      Set usable network modes (Syntax: <mode1>[,<mode2>,...])
                                     Available modes: all, lte, umts, gsm, cdma, td-scdma                                     Available modes: all, lte, umts, gsm, cdma, td-scdma
Line 231: Line 310:
   --get-signal-info:                Get signal strength info   --get-signal-info:                Get signal strength info
   --get-serving-system:             Get serving system info   --get-serving-system:             Get serving system info
 +  --get-system-info:                Get system info
 +  --get-lte-cphy-ca-info:           Get LTE Cphy CA Info
 +  --get-cell-location-info:         Get Cell Location Info
 +  --get-tx-rx-info <radio>:         Get TX/RX Info (gsm, umts, lte)
   --list-messages:                  List SMS messages   --list-messages:                  List SMS messages
 +    --storage <mem>:                Messages storage (sim (default), me)
   --delete-message <id>:            Delete SMS message at index <id>   --delete-message <id>:            Delete SMS message at index <id>
 +    --storage <mem>:                Messages storage (sim (default), me)
   --get-message <id>:               Get SMS message at index <id>   --get-message <id>:               Get SMS message at index <id>
 +    --storage <mem>:                Messages storage (sim (default), me)
   --get-raw-message <id>:           Get SMS raw message contents at index <id>   --get-raw-message <id>:           Get SMS raw message contents at index <id>
 +    --storage <mem>:                Messages storage (sim (default), me)
   --send-message <data>:            Send SMS message (use options below)   --send-message <data>:            Send SMS message (use options below)
     --send-message-smsc <nr>:       SMSC number     --send-message-smsc <nr>:       SMSC number
Line 241: Line 328:
   --wda-set-data-format <type>:     Set data format (type: 802.3|raw-ip)   --wda-set-data-format <type>:     Set data format (type: 802.3|raw-ip)
   --wda-get-data-format:            Get data format   --wda-get-data-format:            Get data format
 +
 </code> </code>
 +</hidden>
 +\\
  
 ==== MBIM Protocol support ==== ==== MBIM Protocol support ====
-MBIM configuration is very similar to QMI, the following packages are required for MBIM support: ''kmod-usb-net-cdc-mbim umbim luci-proto-mbim'' +MBIM configuration is very similar to QMISupported interface configuration options: 
- +^ **Name**            ^ **Type**    **Required**  |  **Default**  | **Description**                                                                                  | 
-Supported interface configuration options: +| **device**          | file path  |  yes            (none)       | MBIM device node, typically **/dev/cdc-wdm0**                                                    | 
-<code>device apn pincode delay auth username password allow_roaming allow_partner dhcp dhcpv6 pdptype ip4table ip6table mtu</code> +| **apn**             | string      yes            (none)       | Used APN                                                                                         | 
-See [[:docs:guide-user:network:wan:wwan:ltedongle#qmi_protocol_configuration_parameters|QMI Protocol Configuration Parameters]] above for details.+| **auth**            | string      no            |  (none)       | Authentication type: **pap**, **chap**, **both**, **none**                                       | 
 +| **username**        | string      no            |  (none)       | Username for PAP/CHAP authentication                                                             | 
 +| **password**        | string      no            |  (none)       | Password for PAP/CHAP authentication                                                             | 
 +| **pincode**         | number      no            |  (none)       | PIN code to unlock SIM card                                                                      | 
 +| **delay**           | number      no            |  0            | Seconds to wait before trying to interact with the modem                                         | 
 +| **pdptype**         | string      no            |  IP           | PDP Context Type, IP (for IPv4), IPV6 (for IPv6) or IPV4V6 (for dual-stack)                      | 
 +| **ipv6**            | boolean    |  no            |  1            | Set it to 0 to disable IPv6 operation                                                            | 
 +| **dhcp**            | boolean    |  no            |  0            | Whether to use DHCP (**1**) or "umbim" tool (**default**) to get IPv4 interface configuration    | 
 +| **dhcpv6**          | boolean    |  no            |  0            | Whether to use DHCPv6 (**1**) or "umbim" tool (**default**) to get IPv6 interface configuration 
 +| **allow_roaming **  | boolean    |  no            |  0            | Allow connection if the modem is registered to the network in roaming                            | 
 +| **allow_partner**   | boolean    |  no            |  0            | Allow connection if the modem is registered to a partner network                                 | 
 +| **mtu**             | number      no            |  (none)       | Interface MTU size                                                                               |
  
 Here is a brief help about ''umbim'' command line: Here is a brief help about ''umbim'' command line:
 <code sh> <code sh>
-umbim help+root@OpenWrt:~# umbim help
 Usage: mbim <caps|pinstate|unlock|connect|disconnect> [options] Usage: mbim <caps|pinstate|unlock|connect|disconnect> [options]
 Options: Options:
Line 263: Line 364:
 ''uqmi'' tool can talk to MBIM modems using ''--mbim'' or ''-m'' option on the command line. ''uqmi'' tool can talk to MBIM modems using ''--mbim'' or ''-m'' option on the command line.
 ==== Manual validation ===== ==== Manual validation =====
-First check that everything works correctly:+Check the currently configured APN:
 <code> <code>
-root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-data-status +root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-profile-settings 3gpp,1 
-"disconnected"+
 +        "apn": "internet", 
 +        "pdp-type": "ipv4v6", 
 +        "username": "", 
 +        "password": "", 
 +        "auth": "none", 
 +        "no-roaming": false, 
 +        "apn-disabled": false 
 +
 +</code> 
 + 
 +Change the APN and/or IP type (an alternative method to using AT commands mentioned above): 
 +<code> 
 +root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --set-device-operating-mode low_power 
 +root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --modify-profile 3gpp,1 --apn internet --pdp-type=ipv4 --username="" --password="" --auth=none 
 +root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --set-device-operating-mode online 
 +</code> 
 +where "internet" is the APN of your provider 
 + 
 +Check network registration and signal strength: 
 +<code> 
 +root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-serving-system 
 +
 +        "registration": "registered", 
 +        "plmn_mcc": 123, 
 +        "plmn_mnc": 45, 
 +        "plmn_description": "OperatorName", 
 +        "roaming": false 
 +}
 </code> </code>
 and and
Line 279: Line 408:
 } }
 </code> </code>
-To manually start the internet connection - issue a command:+ 
 +Check the connection status:
 <code> <code>
-uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect+root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-data-status 
 +"disconnected"
 </code> </code>
-Where "internet" is the APN of your provider. 
  
-:!: Many providers allow to use "anyAPN, so-called "no-settings" connection. So, in many cases "internet" would be just fine+To manually start the Internet connection issue a command: 
 +<code> 
 +root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect 
 +</code> 
 +where "internet" is the APN of your provider 
 + 
 +:!: Some providers will accept almost any APN, in this case using "internet" is fine.
  
 Check the status: Check the status:
 <code> <code>
-uqmi -d /dev/cdc-wdm0 --get-data-status+root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-data-status
 "connected" "connected"
 </code> </code>
  
-**--autoconnect** key says that you want always be connected, once dongle is inserted to the router and Cellular Network is in range.+''--autoconnect'' key says that you want always be connected, once the modem is physically connected to the router and cellular network is in range.
 :!: It will be kept after reboot. :!: It will be kept after reboot.
  
-In case you need additional authentication, please look at the possible arguments for the uqmi utility:+In case you need additional authentication, please look at the possible arguments for ''uqmi'' utility:
 <code> <code>
   --start-network <apn>:            Start network connection (use with options below)   --start-network <apn>:            Start network connection (use with options below)
Line 306: Line 442:
     --autoconnect:                  Disable automatic connect/reconnect     --autoconnect:                  Disable automatic connect/reconnect
 </code> </code>
- 
- 
-==== Firewall configuration ===== 
-The new interface needs to be added to **WAN zone** 
- 
-Using Luci: 
-  * go to Network -> Firewall, scroll down to wan and click the Edit button 
-  * add a checkmark to the **wwan** box under Covered networks heading, click **Save & Apply** 
- 
-Using CLI: 
-  * Edit **/etc/config/firewall**, and add wwan interface to **WAN zone** 
- 
-<code> 
-config zone 
-        option name             wan 
-        list   network          'wan' 
-        list   network          'wan6' 
-        list   network          'wwan' 
-        option input            REJECT 
-        option output           ACCEPT 
-        option forward          REJECT 
-        option masq             1 
-        option mtu_fix          1 
-</code> 
- 
-:-D That's It! 8-) 
  
  
Line 341: Line 451:
 cat /dev/ttyUSB0 cat /dev/ttyUSB0
 </code> </code>
-and in the second (*101# is my ussd code):+and in the second (*101# is my USSD code):
 <code> <code>
 echo -ne 'AT+CUSD=1,"*101#",15\r\n' > /dev/ttyUSB0 echo -ne 'AT+CUSD=1,"*101#",15\r\n' > /dev/ttyUSB0
  • Last modified: 2024/12/19 20:23
  • by andrewz