mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 22:23:27 +00:00
fe6f298b07
The VAR11N-300 is a tiny wireless-N device with a hardwired Ethernet cable, one extra Ethernet port, and an internal antenna, based on the MediaTek MT7620n chipset. Specs: - MT7620n WiSoC @ 600MHz - 32 MB SDRAM - 4 MB SPI flash - 2T2R 2.4GHz WiFi-N - 1 attached 10/100 Ethernet cable (LAN) - 1 10/100 Ethernet port (WAN) - 1 attached USB / barrel 5vdc power cable - 5 LEDs (see notes below) - 1 reset button - 1 UART (3 pads on board) Installation: The stock firmware does not support uploading new firmware directly, only checking the manufacturer's site for updates. This process may be possible to spoof, but the update check uses some kind of homebrew encryption that I didn't investigate. Instead, you can install via a backdoor: 1. Set up a TFTP server to serve the firmware binary (lede-ramips-mt7620-var11n-300-squashfs-sysupgrade.bin) 2. Factory reset the device by holding the reset button for a few seconds. 3. Open the web interface (default IP: 192.168.253.254) 4. Log in with the "super admin" credentials: username `vonets`, password `vonets26642519`. 5. On the "Operative Status" page, click the text "System Uptime", then quickly click the uptime value. 6. If successful, an alert dialog will appear reading "Ated start", and the device will now accept telnet connections. If the alert does not appear, repeat step 5 until it works (the timing is a bit tricky). 7. Telnet to the device using credentials "admin / admin" 8. Retrieve the firmware binary from the tftp server: `tftp -l lede.bin -r lede-ramips-mt7620-var11n-300-squashfs-sysupgrade.bin -g <tftp-server-ip>` 9. Write the firmware to flash: `mtd_write write lede.bin /dev/mtd4` 10. Reboot Tested: - LAN / WAN ethernet - WiFi - LAN / WAN / status LED GPIOs (see notes below) - Reset button - Sysupgrade Notes: LEDs: The board has 5 LEDs - two green LEDs for LAN / WAN activity, one blue LED for WiFi, and a pair of "status" LEDs connected to the same GPIO (the blue LED lights when the GPIO is low, and the green when it's high). I was unable to determine how to operate the WiFi LED, as it does not appear to be controlled by a GPIO directly. Recovery: The default U-boot installation will only boot from flash due to a missing environment block. I generated a valid 4KB env block using U-boot's `fw_setenv` tool and wrote it to flash at 0x30000 using an external programmer. After this, it was possible to enter the U-boot commandline interface and download a new image via TFTP (`tftpboot 81b00000 <image-filename>`), but while I could boot this image sucessfully (`bootm`), writing it to flash (`cp.linux`) just corrupted the flash chip. The sysupgrade file can be written to flash at 0x50000 using an external programmer. Signed-off-by: Andrew Crawley <acrawley@gmail.com>
338 lines
5.0 KiB
Bash
338 lines
5.0 KiB
Bash
#!/bin/sh
|
|
# Copyright (C) 2010-2013 OpenWrt.org
|
|
|
|
. /lib/functions.sh
|
|
. /lib/functions/leds.sh
|
|
|
|
get_status_led() {
|
|
board=$(board_name)
|
|
boardname="${board##*,}"
|
|
|
|
case $board in
|
|
3g150b|\
|
|
3g300m|\
|
|
w150m)
|
|
status_led="$boardname:blue:ap"
|
|
;;
|
|
3g-6200n|\
|
|
ar670w|\
|
|
ar725w|\
|
|
br-6475nd|\
|
|
c50|\
|
|
dch-m225|\
|
|
dir-860l-b1|\
|
|
e1700|\
|
|
ex2700|\
|
|
ex3700|\
|
|
fonera20n|\
|
|
hg255d|\
|
|
kn|\
|
|
kn_rc|\
|
|
kn_rf|\
|
|
kng_rc|\
|
|
mzk-750dhp|\
|
|
mzk-dp150n|\
|
|
mzk-w300nh2|\
|
|
nbg-419n|\
|
|
nbg-419n2|\
|
|
pwh2004|\
|
|
r6220|\
|
|
tl-wr840n-v4|\
|
|
tl-wr840n-v5|\
|
|
tl-wr841n-v13|\
|
|
vr500|\
|
|
wnce2001|\
|
|
wndr3700v5|\
|
|
x5|\
|
|
x8|\
|
|
xdxrn502j|\
|
|
wn3000rpv3)
|
|
status_led="$boardname:green:power"
|
|
;;
|
|
3g-6200nl)
|
|
status_led="$boardname:green:internet"
|
|
;;
|
|
a5-v11|\
|
|
cs-qr10|\
|
|
d105|\
|
|
dcs-930l-b1|\
|
|
hlk-rm04|\
|
|
jhr-n825r|\
|
|
mpr-a1|\
|
|
mpr-a2|\
|
|
mzk-ex750np)
|
|
status_led="$boardname:red:power"
|
|
;;
|
|
ai-br100|\
|
|
ht-tm02)
|
|
status_led="$boardname:blue:wlan"
|
|
;;
|
|
all0239-3g|\
|
|
dcs-930|\
|
|
dir-300-b1|\
|
|
dir-300-b7|\
|
|
dir-320-b1|\
|
|
dir-600-b1|\
|
|
dir-610-a1|\
|
|
dir-615-d|\
|
|
dir-615-h1|\
|
|
dir-620-a1|\
|
|
dir-620-d1|\
|
|
dwr-512-b|\
|
|
gb-pc1|\
|
|
hpm|\
|
|
hw550-3g|\
|
|
mac1200rv2|\
|
|
miniembwifi|\
|
|
mofi3500-3gn|\
|
|
rut5xx|\
|
|
v11st-fe|\
|
|
wmr-300|\
|
|
zbt-wg2626)
|
|
status_led="$boardname:green:status"
|
|
;;
|
|
asl26555-8M|\
|
|
asl26555-16M)
|
|
status_led="asl26555:green:power"
|
|
;;
|
|
atp-52b|\
|
|
ew1200|\
|
|
ip2202)
|
|
status_led="$boardname:green:run"
|
|
;;
|
|
awapn2403|\
|
|
dir-645|\
|
|
sk-wb8|\
|
|
wrh-300cr)
|
|
status_led="$boardname:green:wps"
|
|
;;
|
|
c108)
|
|
status_led="$boardname:green:lan"
|
|
;;
|
|
cf-wr800n|\
|
|
psg1208)
|
|
status_led="$boardname:white:wps"
|
|
;;
|
|
psg1218a|\
|
|
psg1218b)
|
|
status_led="$boardname:yellow:status"
|
|
;;
|
|
cy-swr1100|\
|
|
w502u)
|
|
status_led="$boardname:blue:wps"
|
|
;;
|
|
c20|\
|
|
d240|\
|
|
dap-1350|\
|
|
na930|\
|
|
pbr-m1|\
|
|
re350-v1|\
|
|
rt-ac51u|\
|
|
rt-n13u|\
|
|
rt-n14u|\
|
|
rt-n15|\
|
|
rt-n56u|\
|
|
wl-330n|\
|
|
wl-330n3g|\
|
|
wli-tx4-ag300n|\
|
|
y1|\
|
|
y1s|\
|
|
youku-yk1)
|
|
status_led="$boardname:blue:power"
|
|
;;
|
|
db-wrt01|\
|
|
esr-9753|\
|
|
pbr-d1)
|
|
status_led="$boardname:orange:power"
|
|
;;
|
|
f5d8235-v1)
|
|
status_led="$boardname:blue:wired"
|
|
;;
|
|
f5d8235-v2)
|
|
status_led="$boardname:blue:router"
|
|
;;
|
|
f7c027|\
|
|
timecloud)
|
|
status_led="$boardname:orange:status"
|
|
;;
|
|
hc5*61|\
|
|
hc5661a|\
|
|
jhr-n805r|\
|
|
jhr-n926r|\
|
|
mlw221|\
|
|
mlwg2|\
|
|
vonets,var11n-300)
|
|
status_led="$boardname:blue:system"
|
|
;;
|
|
hc5962)
|
|
status_led="$boardname:white:status"
|
|
;;
|
|
k2p|\
|
|
m3|\
|
|
miwifi-nano)
|
|
status_led="$boardname:blue:status"
|
|
;;
|
|
linkits7688)
|
|
[ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi"
|
|
;;
|
|
m2m)
|
|
status_led="$boardname:blue:wifi"
|
|
;;
|
|
gl-mt300n-v2)
|
|
status_led="$boardname:red:wlan"
|
|
;;
|
|
m4-4M|\
|
|
m4-8M)
|
|
status_led="m4:blue:status"
|
|
;;
|
|
mir3g)
|
|
status_led="$boardname:yellow:status"
|
|
;;
|
|
miwifi-mini|\
|
|
zte-q7)
|
|
status_led="$boardname:red:status"
|
|
;;
|
|
mr-102n)
|
|
status_led="$boardname:amber:status"
|
|
;;
|
|
mr200)
|
|
status_led="$boardname:white:power"
|
|
;;
|
|
nw718)
|
|
status_led="$boardname:amber:cpu"
|
|
;;
|
|
newifi-d1)
|
|
status_led="$boardname:blue:status"
|
|
;;
|
|
omega2| \
|
|
omega2p)
|
|
status_led="$boardname:amber:system"
|
|
;;
|
|
oy-0001|\
|
|
sl-r7205)
|
|
status_led="$boardname:green:wifi"
|
|
;;
|
|
psr-680w)
|
|
status_led="$boardname:red:wan"
|
|
;;
|
|
px-4885-4M|\
|
|
px-4885-8M)
|
|
status_led="px-4885:orange:wifi"
|
|
;;
|
|
re6500|\
|
|
whr-1166d|\
|
|
whr-600d|\
|
|
widora-neo)
|
|
status_led="$boardname:orange:wifi"
|
|
;;
|
|
mzk-ex300np|\
|
|
rt-n10-plus|\
|
|
tew-638apb-v2|\
|
|
tew-691gr|\
|
|
tew-692gr|\
|
|
ur-326n4g|\
|
|
ur-336un|\
|
|
wf-2881)
|
|
status_led="$boardname:green:wps"
|
|
;;
|
|
rb750gr3)
|
|
status_led="$boardname:blue:pwr"
|
|
;;
|
|
sap-g3200u3)
|
|
status_led="$boardname:green:usb"
|
|
;;
|
|
u25awf-h1)
|
|
status_led="u25awf:red:wifi"
|
|
;;
|
|
u7621-06-256M-16M)
|
|
status_led="u7621-06:green:status"
|
|
;;
|
|
u7628-01-128M-16M)
|
|
status_led="u7628-01:green:power"
|
|
;;
|
|
v22rw-2x2)
|
|
status_led="$boardname:green:security"
|
|
;;
|
|
vocore-8M|\
|
|
vocore-16M)
|
|
status_led="vocore:green:status"
|
|
;;
|
|
vocore2)
|
|
status_led="$boardname:fuchsia:status"
|
|
;;
|
|
vocore2lite)
|
|
status_led="$boardname:green:status"
|
|
;;
|
|
w306r-v20|\
|
|
witi|\
|
|
zbt-wr8305rt)
|
|
status_led="$boardname:green:sys"
|
|
;;
|
|
wcr-1166ds|\
|
|
whr-300hp2|\
|
|
wsr-1166|\
|
|
wsr-600)
|
|
status_led="$boardname:green:power"
|
|
;;
|
|
wcr-150gn|\
|
|
wl-351)
|
|
status_led="$boardname:amber:power"
|
|
;;
|
|
whr-g300n|\
|
|
wlr-6000|\
|
|
zbt-we2026)
|
|
status_led="$boardname:red:power"
|
|
;;
|
|
wzr-agl300nh)
|
|
status_led="$boardname:green:router"
|
|
;;
|
|
wizfi630a)
|
|
status_led="$boardname::run"
|
|
;;
|
|
wr512-3gn-4M|\
|
|
wr512-3gn-8M)
|
|
status_led="wr512-3gn:green:wps"
|
|
;;
|
|
wrtnode2r | \
|
|
wrtnode2p | \
|
|
wrtnode)
|
|
status_led="wrtnode:blue:indicator"
|
|
;;
|
|
wt3020-4M|\
|
|
wt3020-8M)
|
|
status_led="wt3020:blue:power"
|
|
;;
|
|
zbt-cpe102)
|
|
status_led="$boardname:green:4g-0"
|
|
;;
|
|
zbt-we826-16M|\
|
|
zbt-we826-32M)
|
|
status_led="zbt-we826:green:power"
|
|
;;
|
|
zbt-wg3526-16M|\
|
|
zbt-wg3526-32M)
|
|
status_led="zbt-wg3526:green:status"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
set_state() {
|
|
get_status_led $1
|
|
|
|
case "$1" in
|
|
preinit)
|
|
status_led_blink_preinit
|
|
;;
|
|
failsafe)
|
|
status_led_blink_failsafe
|
|
;;
|
|
upgrade | \
|
|
preinit_regular)
|
|
status_led_blink_preinit_regular
|
|
;;
|
|
done)
|
|
status_led_on
|
|
;;
|
|
esac
|
|
}
|