2014/09/17

Reverting openwrt to stock firmware

I'm still battling with what I want to do with my extra router (Netgear WNDR4000). Openwrt was not quite what I was hoping, and I know I need to learn a little more about networking to get it to bridge connections like I want. So I decided to go back to dd-wrt to get it set up again and then have access to the resulting config files as a basis.
The migration didn't go as well/smoothly as I had hoped. I got the firmware replaced following these steps:

From http://www.dd-wrt.com/wiki/index.php/Upgrade_from_openwrt
Upgrade From Openwrt
I had a linksys WRT54GS version 2 router that I wanted to upgrade from openwrt to dd-wrt. I could not find any documentation on how to do this. So I created this page just in case anyone else needed to do this. Replace your firware image referenced below with the correct image for you router.
    1. secure shell or telnet into the router running openwrt
    2. cd /tmp
    3. wget http://internet_path_to_your_firmware
    4. mtd -r write your_firmware
This sort of bricked my router. It would boot enough to ping, but nothing else was accessible. I managed to use atftp to load the stock Netgear firmware, and that worked. To do that I performed the following steps:

1. Download correct firmware from your router vendor for your router.
2. Run the following command from a Linux command prompt:
atftp --option "mode octet" --option "timeout 180" --verbose --trace --put --local-file router_firmware 192.168.1.1
3. Let it sit 5 or 10 minutes
4. Reboot

Then I was able to use the standard interface to load the dd-wrt initial conversion .chk file. After that, I upgraded to the mega firmware image for my router.

2014/09/11

Revert dd-wrt to other firmware on Netgear WNDR4000

I have been trying to convert my WNDR4000 router from dd-wrt to openwrt. I have been struggling with how to get this to work. I couldn't get the Netgear tftp instructions to function correctly (didn't seem to find the router). I finally stumbled on the following, which I used to get me to openwrt.

From: dd-wrt.com

Read: TFTP
http://www.dd-wrt.com/wiki/index.php/TFTP_flash
and look at the WNDR3300 wiki:
http://www.dd-wrt.com/wiki/index.php/Netgear_WNDR3300#Reverting_.2F_recovery_tftp_mode

The basic process is this:
1.) Download the latest Netgear Firmware ver.1.0.0.82 to your home folder
http://www.downloads.netgear.com/files/WNDR4000-V1.0.0.82_8.0.71.chk

2.) Set static IP on wired PC (ip:192.168.1.10 mask:255.255.255.0 gw:192.168.1.1)

3.) Do a 30/30/30 and set the password on http interface when finished

4.)
$ telnet -l root 192.168.1.1
# erase linux
# reboot

5.) On a linux desktop using atftp
$ atftp --option "mode octet" --option "timeout 180" --verbose --trace --put --local-file ~/WNDR4000-V1.0.0.82_8.0.71.chk 192.168.1.1

6.) Wait 5-10 min & the router is ok
Reboot router, Clear browser cache and return Static IP on computer to DHCP.

7.)
$ telnet -l root 192.168.1.1
#passwd


Step 7. enables the ssh daemon and allows package installation.

2014/09/02

PirateBox on a TP-Link TL-MR3020


 

I bought one of these little routers a few months ago for around $25 or so. My initial plan was to get something that I could run off of USB power in the car so that the kids could connect with their devices and annoy each other on long trips. I was also intrigued with its compatibility with open-wrt.

I had it floating around for a number of months, and it had made a few trips with us. It served its purpose, but it was pretty uninspiring. I don't like uninspiring. So a couple of weeks ago, I started reading up on converting it to open-wrt. Turns out, that step is pretty easy. I just followed the directions on the web site linked above and pretty much just flashed it like a normal firmware update.

It turns out that open-wrt can be pretty dull, too, if you don't have a goal. Enter PirateBox. They probably describe it best:
PirateBox is a DIY anonymous offline file-sharing and communications system built with free software and inexpensive off-the-shelf hardware.
 My idea was to provide the original desired functionality along with the ability to provide music and movies for the kids as well. It looks like I've got it all running, and this is how I did it.

One point I would like to bring up before we begin, I started with a standard open-wrt image on my router. The website's DIY page assumes that you start with the TP-Link firmware or an existing PirateBox install. I would recommend this. I got it straightened out, but it took some poking around and some luck in my original research.

For PirateBox, you will need the TL-MR3020 router and a USB stick. Some of the file system will reside on the USB stick permanently, so pick a stick that is big enough to allow for that and any files you want to serve/store.

I started the PirateBox conversion by downloading the two files that they provide via the website (install_piratebox.zip and *squashfs-factory.bin). Their recommendation for a fresh installation is to set the slider switch to the 3G option (I assume to get the USB port active). You extract the install_piratebox.zip file and copy the INSTALL folder to a USB drive. Remove the USB drive from your computer and plug it into the router and power it on. Connect your laptop to the router and update the firmware (via the normal administration tools) to the firmware file you downloaded from the PirateBox site. This will mount the USB on reboot and install PirateBox, just like the direction say.

I can't say how well this works because I didn't think to plan this far in advance when I started this whole thing. I had to follow the upgrade directions, but I had an issue because I had open-wrt installed already without the USB mounting modules required (and packaged with the PirateBox firmware). The premise for the upgrade is to copy the firmware file to the router via USB drive and copy it over the existing firmware. Upon rebooting, the USB drive will be seen, the zip file will be decompressed, and PirateBox will be installed.

My problem was that I couldn't mount my USB drive with the stock open-wrt firmware. In order to do this, I used some info I got from this site. That site is for setting up the router as a Pineapple box (for man-in-the-middle attacks). What was really important for me was the following piece:
Install the following packages :

opkg update
opkg install kmod-usb-storage
opkg install kmod-fs-ext4
opkg install block-mount
I didn't need the ext4 module since I used FAT32, but the block mount seems to solve the small issue I was having with seeing my USB drive on the router.

So I connected the router via Ethernet cable to my internet router so that I could install the required modules. Once I could mount the USB drive, I copied the PirateBox firmware onto the router with the following command:
cd /mnt/usb
mtd write -r openwrt firmware
Then I rebooted with:
reboot
I then waited the 20 to 45 minutes that are recommended (in my case, I went to bed). After that, I was able to telnet into 192.168.1.1 (note that, telnet, not SSH). In order to do this, I had to actually install telnet on my laptop. Anyway, once I got into the machine, I set the password via:
passwd
This allowed me used SSH again. After that, I followed the steps in the Post-Installation section to activate the Kareha board, setup the time, and start the miniDLNA server. This is what allows you to stream music and movies via a DLNA client.

The one issue that I had was getting the time set up. The TL-MR3020 doesn't have a time clock, so it defaults to 01/01/1970. Since it is designed to run as a stand alone network, there isn't access to an NTP server, either. There are directions in the PirateBox forum for this. At least for this current firmware. In essence, this is what you do (from the above link):


The step about the timesave.sh script is a script for fixing this. The issue is only, that the timesave.sh as a syntax error and the routine within the openwrt package has a bug too -- in 1.0.0

I prepared the fix for 1.0.1 which is currently in beta testing.

To fix it manually:

edit /opt/piratebox/bin/timesave.sh

find
if [ `get_datetime` -lt `cat $TIMESAVE` ] ;
and replace with
if [ `get_datetime` -lt `cat $TIMESAVE` ] ; then
(missing then)

Then edit /etc/rc.local

change
/opt/piratebox/conf/piratebox.conf /opt/piratebox/bin/timesave.sh recover
with
/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf  recover
Additionally run:
/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf  install

BUT, that is no exchange for areal Real-Time-Clock. This is not available on such cheap systems.
At that point, I shut down my router, mounted the USB stick on my laptop and copied a bunch of music and movies onto it. This is much faster than trying to upload them. For the DLNA server, you will need playlists for your music. I haven't bothered with this. A simple script can be run to parse a folder/folder structure to get songs available and create playlist files.

This was a really straight-forward install. I was impressed with how easy this was. The guys working on this project have done a great job, and the only issues I had were my own doing.

2013/11/24

Resurrection

After ages and ages of dust gathering, I think I might start this blog back up.

I have been bitten by the dork bug again after a very long stretch of not really doing anything. Part of that has to do with a long stretch traveling for work and only being focused on whatever project I was on. I have some time at home, finally, and I have found myself obsessing over little side projects.

My current focus is lower power computing. I bought a RaspberryPi at the beginning of the year, and it hasn't been doing much until now. I currently use it as a music player in my home office. More will come, but I'm not sure what it will become. I also have an old netbook that wants an update, and that sent me to the net. I stumbled on a post about CrunchBang Linux. It. Is. Awesome. I tested it out by installing it on an old (~7 years) laptop that we had lying around. I have tried some other distros on it, but it was so slow that it kept getting shelved. I put CrunchBang on it a couple of days ago, and it runs like a champ. It is running so well, in fact, that I have decided to start using it instead of buying a newer compact notebook. I know, right?

I plan on writing up more about what I have done with that laptop's configuration in a future post. I will also be adding my experiences with CrunchBang on my netbook once I get it backed up so it can be rebuilt. Hopefully, I find something more for my RPi besides being an MP3 player. I will include anything that comes along there as well.

Until then...

2009/01/30

Some upgrades really suck

So, what has been happening? My hard drives acted like they crashed. A couple of times. After migrating to openSuSE 11.0 and then on to openSuSE11.1, I have come to this conclusion. My computer just isn't up to it, my PCI-IDE adapter didn't consistently work, and X+nVidia=Unstable.

I installed 11.1. I really like it. But... It is unbelievably unstable. X crashes randomly. But frequently. I have completely given up on KDE for the moment. It runs really, really slow on my system. And it seemed the most unstable. So I switched to WindowMaker. I have used that for years as a backup. I got a little tired of it, and it wasn't any more stable. It is a little too simple. I only decided that after trying IceWM, though. Hell yes. I really like it. It is really easy to change the menu and the quick launch bar. I am still working on setting the icons and the backgrounds. I expect that to last about an hour or so once I set myself to it. Other than that, it is just as fast as WindowMaker, it works great over VNC, and it is great for tweaking. I expect much more from it in the very near future.

2008/12/12

I obviously suck

Ok, so I have accomplished zero of what I planned. Well not zero, I did some of it, but... Even worse, I sold out and gave up on MythTV because getting the damned EPG in Germany is such a pain in the ass. It took me weeks to get it working, and I ended up just running it by hand every so often because it was so freaking unreliable. So I caved and bought into Deutsche Telekom's TV over IP solution (Windows CE 5.0 on a little media box). The quality was tolerable for a while, but it is in the crapper right now. I have a few days off next week, I plan on calling to see what can be done.

Sorry.

In better news, I just installed openSuSE 11.0 during a drive rescue. I tried Ubuntu 8.10 while I was at it. I had a drive fail, and I decided to buy two new ones (one for root and home - 160 GB, the other for storage - 500 GB) so I could recover whatever I found to new drives. I went with SATA. Ubuntu saw the one IDE drive connected to my motherboard. It didn't see either of my SATA's or my IDE on a PCI controller. That pretty much sums up my previous experience with Ubuntu. 25% useful, but overall: FAIL! To top that crappy experiment off, the old drives weren't apparently. I may have nice, new, fast S-ATA drives now, but I am out €120 that I needn't be. Grrrr!

So SuSE 11.0 works. I had issues with the newest NVIDIA driver. My 512MB card just short of locked up with 3D games (only used to test if the driver works). I rolled that back a version, and it is OK again (I think I am on 163). KDE4 is cool in concept. My 1.6 (overclocked to 1.9) GHz system can't handle it, though. I am running WindowMaker as my main desktop. It has been a while since I needed it, but it is good enough and crazy fast.

I will be installing openSuSE 11.1 when it comes out week after next. I hope it is more stable. I will work some more on not installing crap to make that happen. I was a little more lax with the 11.0 install because I knew it was only for a few weeks until the new version came out.

I will try to be less of a suck after this. I can't promise it, but we'll see.

Oh, one last thing. Check out TiddlyWiki (http://www.tiddlywiki.com). This shit is amazing. It is a single file encapsulated wiki written in JavaScript. It is pretty cool for personal management. Notes, ideas, personal projects and the like. It looks like I might be learning a little bit of a new language in the near future.

2008/02/28

Vonage Motorola VT-2442 with T-Online

I have a Vonage/Motorola VT-2442 VoIP adapter that I am using while I am here so that my tenants and family can call us easily. We use it to make some phone calls as well to lighten the financial load here. It was a real pain in the ass to set up. There is nothing clear online, and the hotline can't get it to work, either. The hotline said that I needed the T-Online adapter in bridge mode, but that isn't true. Putting it in bridge mode kills its wireless function, which makes the whole system useless. The only things actually plugged into it are my printer and my VoIP adapter. I have the Vonage adapter running through the Telekom DSL modem so that the DSL modem manages the DSL connection and my wireless network as well. I will try to clean this up more later, but here is the gist of what you need:

Set the Vonage device up to authenticate with PPPoE. My Telekom adapter allows PPPoE passthrough. I had to activate that. Here's the trick, though. Your Telekom user name is composed of three different numbers. When I configured my Telekom adapter, I entered everything in its own little box. You can't do that with normal interfaces. To make the Telekom info fit into the single username/password entry field setup do this:

username = Anschlusskennung+T-Online-Nummer+#+Mitbenutzernummer@t-online.de
password= your T-Online password

The Anschlusskennung and the T-Online-Nummer should both be about 12 characters. The Mitbenutzernummer is typically 0001.

The result should look something like this:
username: 123456765432123456765432#0001@t-online.de

I was able to make the connection to Vonage when I entered this info. After the first time I powered the VoIP adapter down, it quit being able to connect. I went in and switched the connection to DHCP again, and it worked. It has worked that way without issues since. It seems that it just needed that one connection to get it straight.