📜 ⬆️ ⬇️

Configure D-Link DIR-320 / NRU + 3G Rostelecom R41 (Sense R41)

The article describes the configuration of the D-Link DIR-320 / NRU router and the 3G + Rostelecom R41 modem.

The router support page lists the compatible models of modems, and “3G + Rostelecom R41”, also known as “Sense R41”, is not included in their number. When connected to the router, the modem is not defined in the configuration interface, it is displayed in the logs as a SCSI device, and no / dev / ttyUSB * devices are created. That is, without options, an alternative router firmware is required.

An Internet search revealed that this router can be flashed with some versions of ZyXEL Keenetic and OpenWRT firmware. The choice fell on OpenWRT. Along with the custom builds of OpenWRT, which include everything needed to connect a 3G modem, support for the DIR-320 / NRU router has been added to the main OpenWRT branch, starting with revision 38040. Therefore, the latest stable version of OpenWRT, Barrier Breaker 14.07, is selected for the firmware.
')

1. Description of devices


D-Link DIR-320 / NRU router
Off. site:www.dlink.ru/ru/products/5/1466_b.html
OpenWRT site:wiki.openwrt.org/toh/d-link/dir-320_revb1
H / W Ver .:
(iron version)
B1
F / W Ver .:
(firmware version)
1.2.94
SoC:
(chipset)
RaLink RT5350
All subsequent actions concern routers with hardware version B *.

Modem 3G + Rostelecom R41

He is "Sense R41", he is "Network Connect R41"
SoC:MediaTek MT6225

2. Preparation


You will need the curl and ssh utilities. On Windows it is convenient to install MSYS2 and install the curl and ssh packages.

Download side OpenWRT for DIR-320 / NRU. At the moment it is the latest stable build. Or you can search for other releases / builds with the ramips / rt305x / openwrt-ramips-rt305x-dir-320-b1- prefix . Copy the firmware in the folder Dir320 .

Comment:
To configure the router, you need additional OpenWRT packages. The easiest way is to set up a WAN on the router (Internet through an ISP cable) and install packages via the Internet. It is possible to download packages in advance, as well as build packages into an assembly or build firmware from source codes with added packages. But I did not study this question. Details on the OpenWRT howto page.

Create a script in the Dir320 folder:

update_flash.cmd
@echo off set firmware=openwrt-ramips-rt305x-dir-320-b1-squashfs-sysupgrade.bin set router=192.168.0.1 echo =========================================================================== echo This batch file will upload %firmware% in the current directory to echo %router% during the router's bootup. echo. echo * Set your ethernet card's settings to: echo IP: 192.168.0.10 echo Mask: 255.255.255.0 echo Gateway: 192.168.0.1. echo * Unplug the router's power cable. echo * Press and hold reset button. echo * Re-plug the router's power cable. echo * Wait 10-15 seconds, then release reset button. echo. echo =============================================================================== echo Waiting for the router... Press Ctrl+C to abort. echo. :ping ping -n 1 -w 50 %router% | find "TTL=" if errorlevel 1 goto ping echo curl -v -0 --retry 100 --form firmware=@%firmware% -o %temp%\curl_out.tmp --progress-bar http://%router% curl -v -0 --retry 100 --form firmware=@%firmware% -o %temp%\curl_out.tmp --progress-bar http://%router% if errorlevel 1 goto ping echo. echo =============================================================================== echo * WAIT for about 2 minutes while the firmware is being flashed. echo * The default router address will be at 192.168.1.1. echo. pause exit /b 

Comment:
Change the line set firmware = ... - set the name of the firmware file, if you called it differently.

We configure the network interface on the computer:

 IP: 192.168.0.10
 Mask: 255.255.255.0
 Gateway: 192.168.0.1

Turn off the power of the router. We connect the network port 1 (or 2, 3, 4, but not the INTERNET) of the router with an Ethernet cable to the configured network card (192.168.0.10).

3. Firmware


Run the script Dir320 / update_flash.cmd and execute the instructions it displays . Namely:

  1. Clamp the Reset button on the router with a match / paperclip / pencil.
  2. We connect power to the router.
  3. We are waiting for 10-15 seconds.
  4. Release the reset button.
  5. We are waiting for 2-3 minutes.

4. Configure the router



If not earned


1. Watch logs - Kernel Log

Via web-interface: Status menu → Kernel Log
Via console (ssh):

 dmesg | grep usb 

There should be entries like this:
Kernel log
 [0.680000] rt3xxx-usbphy usbphy.3: loaded
 [6.690000] usbcore: registered new interface driver usbfs
 [6.700000] usbcore: registered new interface driver hub
 [6.710000] usbcore: registered new device driver usb
 [18.000000] rt3xxx-usbphy usbphy.3: remote usb device wakeup disabled
 [18.020000] rt3xxx-usbphy usbphy.3: UTMI 16bit 30MHz
 [18.120000] usb usb1: no of_node;  not parsing pinctrl DT
 [18.430000] usb usb2: no of_node;  not parsing pinctrl DT
 [18.460000] usbcore: cdc_acm registered new interface driver
 [18.480000] usb 1-1: new high-speed USB device number 2 using ehci-platform
 [18.710000] usb 1-1: no of_node;  not parsing pinctrl DT
 [18.730000] usbcore: registered new interface driver usbserial
 [18.770000] usbcore: registered new interface driver usbserial_generic
 [18.810000] usbserial: USB Serial support registered for generic
 [19.400000] usbcore: registered new interface driver ipw
 [19.440000] usbserial: USB Serial support registered for IPWireless converter
 [19.510000] usbcore: registered new interface driver option
 [19.570000] usbserial: USB Serial support registered for GSM modem (1-port)
 [20.380000] usb 1-1: USB disconnect, device number 2
 [21.620000] usb 1-1: new high-speed USB device number 3 using ehci-platform
 [01.220000] usb 1-1: no of_node;  not parsing pinctrl DT
 [23.410000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
 [23.490000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
 [23.590000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
 [23.670000] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3

Keywords - usbserial , ttyUSB * .
If they are not there, then make sure that all packages are delivered: System → Software menu or a command in the console.

 opkg list-installed 

Make sure that in /etc/hotplug.d/usb/22-3g_dongle the idvendor , idproduct , bcddevice parameters match the USB device. This can be viewed in the console with the command

 lsusb -v | grep -e idVendor -e idProduct -e bcdDevice. 

Something should be displayed.
   idVendor 0x2020
   idProduct 0x4000
   bcdDevice 3.00
   idVendor 0x1d6b Linux Foundation
   idProduct 0x0002 2.0 root hub
   bcdDevice 3.10
   idVendor 0x1d6b Linux Foundation
   idProduct 0x0001 1.1 root hub
   bcdDevice 3.10

The first three lines correspond to the modem.

2. Next - System Log

Via web-interface: Status menu → System Log.
Via console (ssh):

 logread 

There should be entries like this:
System log
 Tue Aug 18 00:36:25 2015 daemon.notice netifd: Interface 'WAN3G' is setting up now
 Tue Aug 18 00:36:27 2015 kern.err kernel: [10387.270000] option1 ttyUSB0: option_instat_callback: error -2
 Tue Aug 18 00:36:27 2015 daemon.notice pppd [22188]: pppd 2.4.7 started by root, uid 0
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (BUSY)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (VOICE)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (NO CARRIER)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (NO DIALTONE)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (NO DIAL TONE)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (NO ANSWER)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (DELAYED)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (ERROR)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: abort on (+ CGATT: 0)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: send (AT ^ M)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: timeout set to 30 seconds
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: expect (OK)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: AT ^ M ^ M
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: OK
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: - got it
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: send (ATH ^ M)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: expect (OK)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: ^ M
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: ATH ^ M ^ M
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: OK
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: - got it
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: send (ATE1 ^ M)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: expect (OK)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: ^ M
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: ATE1 ^ M ^ M
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: OK
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: - got it
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: send (AT + CFUN = 1 ^ M)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: expect (OK)
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: ^ M
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: AT + CFUN = 1 ^ M ^ M
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: OK
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: - got it
 Tue Aug 18 00:36:28 2015 local2.info chat [22191]: send (AT + CGATT? ^ M)
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: expect (OK)
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: ^ M
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: AT + CGATT? ^ M ^ M
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: + CGATT: 1 ^ M
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: ^ M
 Tue Aug 18 00:36:29 2015 local2.info chat: [22191]: OK
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: - got it
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: send (AT + CGDCONT = 1, "IP", "\ T" ^ M)
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: expect (OK)
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: ^ M
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: AT + CGDCONT = 1, "IP", "T" ^ M ^ M
 Tue Aug 18 00:36:29 2015 local2.info chat: [22191]: OK
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: - got it
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: send (ATD * 99 # ^ M)
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: timeout set to 22 seconds
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: expect (CONNECT)
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: ^ M
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: ATD * 99 # ^ M ^ M
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: CONNECT
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: - got it
 Tue Aug 18 00:36:29 2015 local2.info chat [22191]: send (^ M)
 Tue Aug 18 00:36:29 2015 daemon.info pppd [22188]: Serial connection established.
 Tue Aug 18 00:36:29 2015 daemon.info pppd [22188]: Using interface 3g-WAN3G
 Tue Aug 18 00:36:29 2015 daemon.notice pppd [22188]: Connect: 3g-WAN3G <-> / dev / ttyUSB0
 Tue Aug 18 00:36:30 2015 daemon.notice pppd [22188]: PAP authentication succeeded
 Tue Aug 18 00:36:32 2015 daemon.warn pppd [22188]: Could not determine the remote IP address: defaulting to 10.64.64.64
 Tue Aug 18 00:36:32 2015 daemon.notice pppd [22188]: local IP address 10.175.68.213
 Tue Aug 18 00:36:32 2015 daemon.notice pppd [22188]: remote IP address 10.64.64.64
 Tue Aug 18 00:36:32 2015 daemon.notice pppd [22188]: primary DNS address 176.59.127.150
 Tue Aug 18 00:36:32 2015 daemon.notice pppd [22188]: secondary DNS address 176.59.127.146
 Tue Aug 18 00:36:32 2015 daemon.notice netifd: Network device '3g-WAN3G' link is up
 Tue Aug 18 00:36:32 2015 daemon.notice netifd: Interface 'WAN3G' is now up
 Tue Aug 18 00:36:32 2015 user.notice firewall: Reloading firewall due to ifup of WAN3G (3g-WAN3G)

If the connection fails, you need to look at the error code. Without this, more specifically, nothing can be said.

Links


Product page DIR-320 / NRU on D-Link
OpenWRT DIR-320 / NRU device page
OpenWRT Basic Setup
Setting up a 3G modem in OpenWRT
We put OpenWRT on DIR320 / NRU
Using the Sense R41 modem in Linux

Source: https://habr.com/ru/post/265023/


All Articles