Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
openwrt:reflash_wo_usb [2013/12/03 20:37] matthias created |
openwrt:reflash_wo_usb [2017/12/16 06:52] (current) comap89 [using Python & Linux] Misc. |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Reflashing via Failsafe mode and without USB ====== | ====== Reflashing via Failsafe mode and without USB ====== | ||
- | ===== using Python & Linux ===== | + | ===== Using Python and Linux ===== |
- | If your device is messed up and you are not able to change the network-configuration useful, you may can reflash the router with using you local network and a temporary webserver. | + | If your device is messed up and you are not able to change the network-configuration useful, you may reflash the router, using you local network and a temporary webserver. |
- | In the following HowTo, I assume, that you are using an MR3020 , but this method works for all routers- only exchange the image(-link). I assume you have Linux-Computer with a working python installation. | + | In the following HowTo, I assume that you are using an MR3020, but this method works for all routers: you have only to exchange the image(-link). I assume you have a Linux-Computer with a working Python installation. |
1. Connect your laptop to the internet. | 1. Connect your laptop to the internet. | ||
- | 2. open a Terminal and run | + | 2. Choose the correct image-file while referring to [[openwrt:hardware|our hardware list]], then open a Terminal and run: |
cd /tmp | cd /tmp | ||
- | wget http://stable.openwrt.piratebox.de/ar71xx_AA/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin | + | wget http://stable.openwrt.piratebox.de/auto/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin |
- | 3. After you had downloaded the image, run the following command to launch a small basic webserver: | + | 3. After you have downloaded the image, run the following command to launch a small basic webserver: |
- | **Python 2.7** | + | **Python 2.7**: |
python -m SimpleHTTPServer 8000 | python -m SimpleHTTPServer 8000 | ||
- | When this fails- you maybe have **Python 3.x** | + | When this fails (you maybe have **Python 3.x**): |
python3 -m http.server | python3 -m http.server | ||
- | 4. Then connect to your MR3020 and boot it into failsafe mode | + | 4. Then connect to your MR3020 and boot it into failsafe mode |
- | 5. Set your computer to static IP 192.168.1.2 | + | |
- | 6. Open | + | |
- | telnet 192.168.1.1 | + | 5. Set your computer to the static IP 192.168.1.2 |
- | 7. run the following command to download the image onto your MR3020 | + | 6. From Terminal, type: |
+ | |||
+ | telnet 192.168.1.1 | ||
+ | |||
+ | 7. Run the following command to download the image onto your MR3020: | ||
cd /tmp | cd /tmp | ||
Line 46: | Line 48: | ||
+ | ===== Reflash in Failsafe-Mode using Netcat ===== | ||
+ | Your box gets messed up? Sometimes it is only possible to recover it during failsafe mode. But how can you put the firmware image file to your box? | ||
- | ===== Reflash in Failsafe-Mode using netcat ===== | + | I read about something called Netcat. The detailed [[http://techtinkering.com/2013/03/25/using-netcat-to-create-ad-hoc-links-between-applications-and-machines/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+TechTinkering+%28TechTinkering%29|HowTo]] does not fit well, because the most images lack the server support. After some test, I found out that you can turn it around. |
- | Your box gets messed up? Sometimes it is only possible to recover it during failsafe mode. But how can you get the image to your box? | + | |
- | + | ||
- | I read about something called netcat. The detailed [[http://techtinkering.com/2013/03/25/using-netcat-to-create-ad-hoc-links-between-applications-and-machines/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+TechTinkering+%28TechTinkering%29|HowTo]] does not fit well, because the most images lack the server support. After some test, I found out, that you can turn it around. | + | |
- | This method works if your computer is linux. If you don't have linux as OS, try a live version of it.. i.e. [[http://grml.org|grml]]. | + | This method works if your computer is Linux. If you don't have Linux as OS, try a live version of it, i.e. [[http://grml.org|grml]]. |
- | To transfer a file to your router (The following assumes, that you already have access via failsafe-mode): | + | To transfer a file to your router (The following assumes that you already have access via failsafe-mode): |
- | **On the computer** check what you IP is (ifconfig). Then we are starting a Server and pipe the image file into it. After it is done, it will generate a hash-value. | + | **On the computer** check what you IP is (command: ifconfig). Then we are starting a Server and pipe the image file into it. After it is done, it will generate a hash-value. |
# cat openwrt....bin | nc -l 3333 && md5sum openwrt....bin | # cat openwrt....bin | nc -l 3333 && md5sum openwrt....bin | ||
| | ||
- | (sometimes (on my gentoo-box it was) the command is) | + | (sometimes (on my Gentoo-box it was) the command is) |
# cat openwrt....bin | nc -l -p 3333 -X && md5sum openwrt....bin | # cat openwrt....bin | nc -l -p 3333 -X && md5sum openwrt....bin | ||
| | ||
- | **On the router** we connect to the Server: (on the Router can the filename be shorter, different) | + | **On the router** we connect to the Server (on the Router can the filename be shorter, different): |
# cd /tmp | # cd /tmp | ||
Line 71: | Line 72: | ||
# md5sum openwrt....bin | # md5sum openwrt....bin | ||
| | ||
- | Compare the hash value of both outputs, if they are equal proceed with flashing. | + | Compare the hash value of both outputs, if they are equal then proceed with flashing. |