Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:network:wan:wwan:ethernetoverusb_ncm [2018/07/22 18:36] – Note regarding modem mode setting. pilot6 | docs:guide-user:network:wan:wwan:ethernetoverusb_ncm [2024/11/17 11:17] – [Network configuration] andrewz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Use NCM USB Dongle for WAN connection ====== | ====== Use NCM USB Dongle for WAN connection ====== | ||
| - | [[http:// | + | [[http:// |
| - | For more information about different | + | The same applies to external modems connected to USB ports (" |
| - | * **ppp**, see [[docs: | + | |
| - | * **qmi** and **mbim**, see [[docs: | + | For more information about other protocols |
| - | * **rndis**, see [[docs: | + | * **PPP**, see [[docs: |
| + | * **QMI** and **MBIM**, see [[docs: | ||
| + | * **ECM**, see [[docs: | ||
| + | * **RNDIS**, see [[docs: | ||
| ===== Modem Preparation ===== | ===== Modem Preparation ===== | ||
| - | You need to switch modem to provide native **NCM** interface instead of **Modem** interface. | + | You may need to switch |
| :!: Please read about [[docs: | :!: Please read about [[docs: | ||
| Line 16: | Line 19: | ||
| ===== Router Preparation ===== | ===== Router Preparation ===== | ||
| - | 1. Install | + | 1. Install |
| 2. Complete steps [[docs: | 2. Complete steps [[docs: | ||
| Line 23: | Line 26: | ||
| ==== Required Packages ==== | ==== Required Packages ==== | ||
| - | To make use of NCM protocol, | + | To make use of NCM protocol, |
| - | ***'' | + | To access the PC UI Interface (AT Command port) package |
| - | + | ||
| - | < | + | |
| - | opkg update | + | |
| - | opkg install comgt-ncm | + | |
| - | </ | + | |
| ==== Optional Packages ==== | ==== Optional Packages ==== | ||
| - | 1. Add support for PC Interface (ttyUSB0) | + | 1. Install |
| - | ***'' | + | |
| - | ***'' | + | 2. A terminal program like '' |
| - | ***'' | + | |
| - | < | + | |
| - | opkg update | + | |
| - | opkg install kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan | + | |
| - | </ | + | |
| 3. Add support for FlashCard of your dongle - refer to: [[docs: | 3. Add support for FlashCard of your dongle - refer to: [[docs: | ||
| ===== Installation ===== | ===== Installation ===== | ||
| - | 1. Install all the needed packages | + | 1. Install all the needed packages |
| + | |||
| + | * For Huawei modems: | ||
| < | < | ||
| - | opkg update | + | root@OpenWrt: |
| - | opkg install | + | root@OpenWrt: |
| </ | </ | ||
| - | :!: If your have not enough space on your device - think of installing [[docs: | + | * other modems may require different packages, this is an example for Mikrotik modems: |
| - | :!: Another option is Hardware memory upgrade. Refer to your router Forum thread for possibility and instructions. | ||
| - | |||
| - | 2. Reboot the router | ||
| < | < | ||
| - | reboot | + | root@OpenWrt: |
| + | root@OpenWrt: | ||
| </ | </ | ||
| - | 3. Check that everything is OK and you got new device: | + | Additional packages will be automatically installed as // |
| + | |||
| + | You can also add the necessary packages when building a new image with [[https:// | ||
| + | |||
| + | :!: If your have not enough space on your device - think about upgrading your hardware or installing [[docs: | ||
| + | |||
| + | 2. Reboot the router by executing '' | ||
| + | |||
| + | 3. Check if you got a new //device//: | ||
| < | < | ||
| - | ls -l /dev/cdc-wdm0 | + | root@OpenWrt: |
| crw-r--r-- | crw-r--r-- | ||
| </ | </ | ||
| - | If you have no such device | + | If there is no such device |
| - | + | * Open System Log from Luci web interface and see what it shows regarding newly discovered USB device(s) | |
| - | try **dmesg** to read kernel | + | * execute '' |
| + | | ||
| < | < | ||
| - | dmesg | + | [...] |
| - | </code> | + | T: Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 |
| - | or look info about USB devices and interfaces present in the system: | + | D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 # |
| - | < | + | P: |
| - | cat / | + | S: Manufacturer=HUAWEI_MOBILE |
| - | + | S: Product=HUAWEI_MOBILE | |
| - | FIXME | + | C:* #Ifs= 5 Cfg#= 1 Atr=80 MxPwr= |
| + | I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=03 Prot=10 Driver=(none) | ||
| + | E: Ad=82(I) Atr=03(Int.) MxPS= 10 Ivl=32ms | ||
| + | E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
| + | E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
| + | I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=03 Prot=12 Driver=option | ||
| + | E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
| + | E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
| + | I: If#= 2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=03 Prot=16 Driver=huawei_cdc_ncm | ||
| + | E: Ad=85(I) Atr=03(Int.) MxPS= 16 Ivl=2ms | ||
| + | I:* If#= 2 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=03 Prot=16 Driver=huawei_cdc_ncm | ||
| + | E: Ad=85(I) Atr=03(Int.) MxPS= 16 Ivl=2ms | ||
| + | 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= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage | ||
| + | E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
| + | E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=125us | ||
| + | I:* If#= 4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage | ||
| + | E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms | ||
| + | E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=125us | ||
| </ | </ | ||
| Line 86: | Line 108: | ||
| [[docs: | [[docs: | ||
| - | :!: The package comgt-ncm + modem specific driver must be installed to use NCM. | + | ^ Name ^ Type |
| - | ^Name ^Type ^Required | + | | device |
| - | |device | + | | apn |
| - | |apn |string | + | | pincode |
| - | |pincode | + | | username |
| - | |username | + | | password |
| - | |password | + | | auth | string |
| - | |auth |string | + | | mode | string |
| - | |mode |string | + | | pdptype |
| - | |pdptype | + | | profile |
| - | |delay | + | | delay |
| - | You can configure | + | You can configure |
| - | :!: If you are using option mode, an AT command | + | :!: If option |
| | | ||
| ==== Network configuration ===== | ==== Network configuration ===== | ||
| - | Now you should | + | |
| + | Using Luci web interface: navigate to Network → Interfaces → Add new interface… → Protocol : NCM, Interface: " | ||
| + | |||
| + | The interface selected above is the "AT Command Port" or " | ||
| + | |||
| + | Enter your APN and select the 'IP Protocol' | ||
| + | |||
| + | Assign the firewall zone (wan) on ' | ||
| + | \\ | ||
| + | Alternatively | ||
| + | |||
| + | * add a new **Interface** | ||
| < | < | ||
| config interface ' | config interface ' | ||
| option proto ' | option proto ' | ||
| - | option | + | option |
| - | option | + | option |
| option apn ' | option apn ' | ||
| - | option mode ' | ||
| - | option pincode ' | ||
| - | option delay ' | ||
| </ | </ | ||
| - | You can do this using the vi text editor, but if you're not comfortable with that, point your browser to 192.168.1.1 again, choose Network -> Interfaces and click Add new interface. | + | * add the same interface name to the " |
| - | + | <code> | |
| - | Write **wwan** as the name of the interface and make it cover the **wwan0** interface. Choose **ncm** as the protocol. | + | config zone |
| - | + | | |
| - | FIXME Insert a screenshot of LUCI add Interface. | + | [...] |
| - | + | list network 'wwan' | |
| - | ==== Firewall configuration ===== | + | </code> |
| - | The only thing that is left - Add **wwan** interface 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** | + | |
| - | FIXME Insert a Screen Shot from LUCI. | ||
| ==== Additional Info ===== | ==== Additional Info ===== | ||
| Line 145: | Line 169: | ||
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| - | __**My router is not detecting the dongle. What should I do?**__ | + | ==== My router is not detecting the modem. What should I do? ==== |
| - | Try the following commands: | + | Get the information about USB devices with '' |
| - | < | + | |
| - | usbmode -l | + | Find a section for your device, look for " |
| - | </ | + | |
| - | It should respond with a message about your USB device | + | |
| - | < | + | |
| - | usbmode -s | + | |
| - | </code> | + | See if necessary drivers are loaded for your device: |
| - | Then wait for the dongle to get issued an IP from your ISP. | + | |
| + | I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=03 Prot=12 Driver=option | ||
| + | [...] | ||
| + | I: | ||
| + | |||
| + | If the drivers are missing, install the missing packages and/or change the operating mode of the modem to expose the necessary interfaces. | ||
| + | |||
| + | Finally, ask in the forum. | ||
| + | ==== My modem doesn' | ||
| + | |||
| + | This script [[https:// | ||
| - | __**I have to issue //usbmode -l// and //usbmode -s// every time I reboot my router to detect my USB device. How can I automate | + | To achieve continuous monitoring of the connection, |
| - | Include the following codes into /// | ||
| < | < | ||
| - | /sbin/usbmode -l | + | #/etc/crontabs/ |
| - | /bin/sleep 2 | + | #min h |
| - | /sbin/usbmode | + | */20 * * * * |
| </ | </ | ||
| - | __**I am using ' | + | ==== I am using ' |
| This is probably related to ticket #18673 ([[https:// | This is probably related to ticket #18673 ([[https:// | ||
| Line 173: | Line 206: | ||
| AT^NDISDUP=1, | AT^NDISDUP=1, | ||
| </ | </ | ||
| - | It is possible to automate this task using [[docs: | + | It is possible to automate this task using [[docs: |
| /// | /// | ||
| Line 246: | Line 279: | ||
| </ | </ | ||
| - | Some modems does not reconnect after loosing | + | Some modems does not reconnect after losing |
| Here is a connection check sh script which checks if it can ping remote servers with time intervals. If all pings fail, it tries to start the network by executing /// | Here is a connection check sh script which checks if it can ping remote servers with time intervals. If all pings fail, it tries to start the network by executing /// | ||
| < | < | ||
| Line 285: | Line 318: | ||
| done | done | ||
| + | </ | ||
| + | |||
| + | If your SIM receives a voice call. It will downgrade to CS network which means you will downgrade into 3G mode. | ||
| + | To avoid this, set the stick to use only PS network by creating `/ | ||
| + | Make sure to modify it to use correct serial interface and correct AT command for your device. | ||
| + | < | ||
| + | [ " | ||
| + | logger "iface wwan up detected..." | ||
| + | # We need to set this to stop the card from receiving phone calls | ||
| + | # This is for EC-25 | ||
| + | #echo -ne " | ||
| + | # This is for Huawei | ||
| + | echo -ne " | ||
| + | } | ||
| </ | </ | ||