| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision |
| docs:guide-user:network:wan:wwan:ethernetoverusb_ncm [2024/09/22 15:50] – [Installation] andrewz | docs:guide-user:network:wan:wwan:ethernetoverusb_ncm [2024/11/17 11:17] – [Network configuration] andrewz |
|---|
| |
| ===== Installation ===== | ===== Installation ===== |
| 1. Install all the needed packages | 1. Install all the needed packages either in Luci → System → Software or via command line: |
| |
| * For Huawei modems: | * For Huawei modems: |
| |
| <code> | <code> |
| opkg update | root@OpenWrt:~# opkg update |
| opkg install kmod-usb-net-huawei-cdc-ncm luci-proto-ncm picocom | root@OpenWrt:~# opkg install kmod-usb-net-huawei-cdc-ncm luci-proto-ncm picocom |
| </code> | </code> |
| |
| |
| <code> | <code> |
| opkg update | root@OpenWrt:~# opkg update |
| opkg install kmod-usb-net-rndis kmod-usb-acm luci-proto-ncm picocom | root@OpenWrt:~# opkg install kmod-usb-net-rndis kmod-usb-acm luci-proto-ncm picocom |
| </code> | </code> |
| |
| Additional modules will be automatically installed as //dependencies//. | Additional packages will be automatically installed as //dependencies//. |
| | |
| | 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. |
| 3. Check if you got a new //device//: | 3. Check if you got a new //device//: |
| <code> | <code> |
| ls -l /dev/cdc* | 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: execute ''dmesg'' to see what is shown in the kernel log regarding new USB device(s) and check the details about USB devices detected by the system by running ''cat /sys/kernel/debug/usb/devices'': | If there is no such device found, there is a possibility that completely different name is in use by the device driver, like ''usb0'' or ''eth1''. Try to get more details: |
| | * Open System Log from Luci web interface and see what it shows regarding newly discovered USB device(s) |
| | * execute ''dmesg'' on the console and see if any relevant information is present in the kernel log |
| | * check the details about USB devices detected by the system by running ''cat /sys/kernel/debug/usb/devices'' on the console: |
| <code> | <code> |
| [...] | [...] |
| |
| ^ Name ^ Type ^ Required ^ Default ^ Description ^ | ^ Name ^ Type ^ Required ^ Default ^ Description ^ |
| | device | file path | yes | (none) | NCM device node, typically **/dev/ttyUSB#** or **/dev/ttyACM#** | | | device | file path | yes | (none) | NCM device node, usually ''/dev/ttyUSBx'' or ''/dev/ttyACMx'' | |
| | apn | string | yes | (none) | Used APN | | | apn | string | yes | (none) | APN to use | |
| | pincode | number | no | (none) | PIN code to unlock SIM card | | | pincode | number | no | (none) | PIN code to unlock SIM card | |
| | username | string | no | (none) | Username for PAP/CHAP authentication | | | username | string | no | (none) | Username for PAP/CHAP authentication | |
| | auth | string | no | (none) | Authentication type: **pap**, **chap**, **both**, **none** | | | auth | string | no | (none) | Authentication type: **pap**, **chap**, **both**, **none** | |
| | mode | string | no | (modem default) | Used network mode, not every device support every mode: **preferlte**, **preferumts**, **lte**, **umts**, **gsm**, **auto** | | | mode | string | no | (modem default) | Used network mode, not every device support every mode: **preferlte**, **preferumts**, **lte**, **umts**, **gsm**, **auto** | |
| | 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) | |
| | | profile | number | no | 1 | PDP Context Identifier | |
| | delay | number | no | 0 | Seconds to wait before trying to interact with the modem (some modems require up to 30 s.) | | | delay | number | no | 0 | Seconds to wait before trying to interact with the modem (some modems require up to 30 s.) | |
| | profile | number | no | 1 | Index of a PDP context | | |
| |
| 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]] or with [[docs:techref:luci| Luci]] package **luci-proto-ncm**. | You can configure the interface manually using [[docs:techref:uci|uci command line]] or [[docs:guide-user:base-system:user.beginner.cli#editing.files| text editor]] or with [[docs:techref:luci| Luci]] package **luci-proto-ncm**. |
| |
| :!: If option "mode" is set, the corresponding AT command is sent to the modem on every connection attempt. Most of modems (at least all Huawei models) store this setting in internal flash. So on each connection OpenWrt writes to modem flash. It is recommended to not use this option after the required mode is set once. | :!: If option "mode" is set, the corresponding AT command is sent to the modem on every connection attempt. Most of modems (at least all Huawei models) store this setting in internal flash. So on each connection OpenWrt writes to modem flash. It is recommended to not use this option after the required mode is set once. |
| Using Luci web interface: navigate to Network → Interfaces → Add new interface… → Protocol : NCM, Interface: "ttyUSB1" | Using Luci web interface: navigate to Network → Interfaces → Add new interface… → Protocol : NCM, Interface: "ttyUSB1" |
| |
| The interface selected above is the "AT Command Port" or "PCUI" in Huawei terms, ''ttyUSB1'' is shown as an example only, different modems have different port assignments. The //data// interface like ''/dev/cdc-wdm0'' will be discovered by the connection script automatically. | The interface selected above is the "AT Command Port" or "PCUI" in Huawei terms, ''ttyUSB1'' is shown here as an example only, different modems have different port assignments like ''/dev/ttyUSBx'' or ''/dev/ttyACMx''. The //data// interface like ''wwan0'' and corresponding device like ''/dev/cdc-wdm0'' will be discovered by the connection script automatically. |
| |
| Enter your APN and select the 'IP Protocol' as instructed by the carrier. | Enter your APN and select the 'IP Protocol' as instructed by the carrier. |