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 |
![]() | |
SoC: | MediaTek MT6225 |
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.
@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
Change the line set firmware = ... - set the name of the firmware file, if you called it differently.
IP: 192.168.0.10 Mask: 255.255.255.0 Gateway: 192.168.0.1
ssh root@192.168.1.1
opkg update opkg install comgt kmod-usb2 kmod-usb-ohci kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-ipw kmod-usb-serial-wwan kmod-usb-acm luci-proto-3g usb-modeswitch usb-modeswitch-data usbutils
1. The opkg update command must be re-executed in each SSH session (and possibly before each opkg install). In any case, if the opkg install command does not find a package, you need to run opkg update.
2. It is possible that only one of the kmod-usb-serial-wwan, kmod-usb-acm packages is available (this is indicated on the wiki.openwrt.org/doc/recipes/3gdongle page), but I didn’t really understand both.
3. Usb-modeswitch, usb-modeswitch-data, usbutils packages are kind of not needed - usb-modeswitch * are needed if the modem is defined as a disk (I did not have one), usbutils is needed only to recognize VendorID and ProductID.
echo '#!/bin/sh idvendor="2020" idproduct="4000" bcddevice="300" if [ "${PRODUCT}" = "${idvendor}/${idproduct}/${bcddevice}" ]; then if [ "${ACTION}" = "add" ]; then echo '${idvendor} ${idproduct} ff' > /sys/bus/usb-serial/drivers/option1/new_id fi fi ' > /etc/hotplug.d/usb/22-3g_dongle
1. You can copy the command, starting with echo
2. The end of the EOL line should be a UNIX format (LF, not CRLF), that is, copy the command into a text editor (for example, Notepad ++) and replace the line ends, and then copy it to the console.
3. idvendor, idproduct, bcddevice can be viewed with the lsusb -v command (usbutils package), if these values ​​suddenly fail.
echo 'ABORT BUSY ABORT VOICE ABORT "NO CARRIER" ABORT "NO DIALTONE" ABORT "NO DIAL TONE" ABORT "NO ANSWER" ABORT "DELAYED" ABORT "ERROR" ABORT "+CGATT: 0" "" AT TIMEOUT 30 OK ATH OK ATE1 OK AT+CFUN=1 OK AT+CGATT? OK AT+CGDCONT=1,"IP","\T" OK ATD*99# TIMEOUT 22 CONNECT "" ' > /etc/chatscripts/3g.chat
1. The end of the EOL line must be UNIX format.
2. The file name /etc/chatscripts/3g.chat can be different: run the command ls -n / etc / chatscripts / and see which files are created after setting up the 3G connection (via the web interface or console)
dmesg | grep usb
[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
opkg list-installed
lsusb -v | grep -e idVendor -e idProduct -e bcdDevice.
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
logread
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)
Source: https://habr.com/ru/post/265023/
All Articles