| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
| docs:guide-user:network:wan:wwan:ltedongle [2024/11/02 11:10] – [Table] andrewz | docs:guide-user:network:wan:wwan:ltedongle [2024/11/27 18:05] – [LTE or 5G Modem Preparation] andrewz |
|---|
| |
| Replace ''IP'' with ''IPV4V6'' or ''IPV6'' if necessary and use your APN instead of ''internet''. | 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. |
| |
| \\ | \\ |
| 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 [[: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]] | 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: | * if the modem is in QMI mode: |
| <code> | <code> |
| root@OpenWrt:~# opkg install kmod-usb-net-cdc-mbim umbim luci-proto-mbim kmod-usb-serial-option picocom | root@OpenWrt:~# opkg install kmod-usb-net-cdc-mbim umbim luci-proto-mbim kmod-usb-serial-option picocom |
| </code> | </code> |
| | |
| | You can also add the necessary packages when building a new image with [[https://firmware-selector.openwrt.org/|Firmware Selector]]. |
| |
| :!: 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. | :!: 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. |
| |
| 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. | 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. |
| | |
| | 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). |
| |
| Assign the firewall zone (wan) on 'Firewall Settings' tab. | Assign the firewall zone (wan) on 'Firewall Settings' tab. |
| | **modes** | string | no | (modem default) | Allowed network modes, comma separated list of: **all**, **lte**, **umts**, **gsm**, **cdma**, **td-scdma** | | | **modes** | string | no | (modem default) | Allowed network modes, comma separated list of: **all**, **lte**, **umts**, **gsm**, **cdma**, **td-scdma** | |
| | **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. | | | **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. | |
| | **profile** | number | no | 1 | Connection profile to use | | | **profile** | number | no | 1 | PDP Context Identifier | |
| | **v6profile** | number | no | (none) | Connection profile for IPv6 if different from IPv4 profile | | | **v6profile** | number | no | (none) | PDP Context Identifier for IPv6 if different from IPv4 profile | |
| | **dhcp** | boolean | no | 1 | Whether to use DHCP (**default**) or uqmi (**0**) to get IPv4 interface configuration | | | **dhcp** | boolean | no | 1 | Whether to use DHCP (**default**) or uqmi (**0**) to get IPv4 interface configuration | |
| | **dhcpv6** | boolean | no | 0 | Whether to use DHCP (**1**) or uqmi (**default**) to get IPv6 interface configuration | | | **dhcpv6** | boolean | no | 0 | Whether to use DHCP (**1**) or uqmi (**default**) to get IPv6 interface configuration | |
| --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 |
| --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 |
| --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 |
| --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 |
| --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> | </hidden> |
| | **pincode** | number | no | (none) | PIN code to unlock SIM card | | | **pincode** | number | no | (none) | PIN code to unlock SIM card | |
| | **delay** | number | no | 0 | Seconds to wait before trying to interact with the modem | | | **delay** | number | no | 0 | Seconds to wait before trying to interact with the modem | |
| | **pdptype** | string | no | IP | Used IP-stack mode, IP (for IPv4), IPV6 (for IPv6) or IPV4V6 (for dual-stack) | | | **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 | | | **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 | | | **dhcp** | boolean | no | 0 | Whether to use DHCP (**1**) or "umbim" tool (**default**) to get IPv4 interface configuration | |
| | **allow_partner** | boolean | no | 0 | Allow connection if the modem is registered to a partner network | | | **allow_partner** | boolean | no | 0 | Allow connection if the modem is registered to a partner network | |
| | **mtu** | number | no | (none) | Interface MTU size | | | **mtu** | number | no | (none) | Interface MTU size | |
| |
| Note: in IPv6-only mode it is recommended setting ''dhcpv6'' option on in order to automatically start the 464XLAT interface. | |
| |
| Here is a brief help about ''umbim'' command line: | Here is a brief help about ''umbim'' command line: |
| ''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 |
| } | } |
| </code> | </code> |
| | |
| | Check the connection status: |
| | <code> |
| | root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-data-status |
| | "disconnected" |
| | </code> |
| | |
| To manually start the Internet connection issue a command: | To manually start the Internet connection issue a command: |
| <code> | <code> |
| root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect | root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect |
| </code> | </code> |
| Where "internet" is the APN of your provider. | where "internet" is the APN of your provider |
| |
| :!: Some providers will accept almost any APN, in this case using "internet" is fine. | :!: Some providers will accept almost any APN, in this case using "internet" is fine. |