Archive for February, 2008

D-Link DIR-300

Monday, February 11th, 2008

In the week since I’ve met this beast they’ve apparantly become quite popular. It seems to have sold out here in Christchurch, and I assume that things may be the same all over NZ.

Search here for a D-Link DIR-300 online

I’ve managed to install DD-WRT firmware onto my router. After some frustrating false starts.

Now that I’ve successfully done this I thought I’d post this update to cover what I feel are some limitations in the 2 guides I followed. ( BrainSlayer’s flashing.txt, and shadowandy’s mini flashing guide http://www.shadowandy.net/_html/archives/2007/09/mini_flashing_guide_for_dir300.html)

The part that gave me the most frustration was the initial TFTP of the temp bootloader. As I kept getting error messages from the 4 different tftp servers I tried I was convinced that it hadn’t worked. So I never actually moved onto the next step.
Turns out that you can ignore the TFTP errors when you transfer ap61.ram

After this life became easy again, and the guides easily followed.

The other trouble I had was connecting initially to the redboot shell. I was trying to use the built in WinXP telnet, and while I was able to get a connection I could not send a ^C. When I attempted to use putty as my telnet client I was not able to get the timing right to connect within the redboot timeout window.

That is when I went searching for an automated solution. I’ve stolen the following from a forum about Linksys NSLU2′s and modified it a bit.
http://www.nslu2-linux.org/wiki/HowTo/TelnetIntoRedBoot

(This has only been tested by me using XP)

Requires : putty.exe placed somewhere in your path.
Click Start, then Run, in the run box type putty, click OK. Verify that putty actually starts (and without needing you to click OK on the security dialog that appears)
In putty enter the IP of your DIR-300 (192.168.20.81, and the port, 9000) name the session dir300 and click save session. Then close putty.

save the following as a .bat file


echo off
echo Set objShell = WScript.CreateObject("WScript.Shell") > dir300.vbs
echo Set objExecObject = objShell.Exec("cmd /c ping -t -w 1 192.168.20.81") >> dir300.vbs
echo Wscript.Echo "Start DIR300 after first ping timeout..." >> dir300.vbs
echo Do While Not objExecObject.StdOut.AtEndOfStream >> dir300.vbs
echo strText = objExecObject.StdOut.ReadLine() >> dir300.vbs
echo Wscript.Echo strText >> dir300.vbs
echo If Instr(strText, "Reply") > 0 Then >> dir300.vbs
echo Exit Do >> dir300.vbs
echo End If >> dir300.vbs
echo Loop >> dir300.vbs
echo objShell.Run("putty -load dir300") >> dir300.vbs
echo Do Until Success = True >> dir300.vbs
echo Success = objShell.AppActivate("putty") >> dir300.vbs
echo Wscript.Sleep 200 >> dir300.vbs
echo Loop >> dir300.vbs
echo objShell.SendKeys "version" >> dir300.vbs
echo objShell.SendKeys "{ENTER}" >> dir300.vbs
echo Wscript.Echo "Done... You can close this command window." >> dir300.vbs
echo Wscript.Quit >> dir300.vbsCALL CScript dir300.vbs
del dir300.vbs

With the DIR-300 disconnected from the power run your .bat file. When you see the first line of timeouts appear power on your dir-300

The script should do it’s thing and you (hopefully) will be looking at a RedBoot> prompt waiting for you.