LaFoneraPlus Software Flashing

From DD-WRT Wiki

Revision as of 15:26, 11 October 2008 by Alvin (Talk | contribs)
Jump to: navigation, search


Contents

Disclamer

I've based this tutorial on the LaFonera Software Flashing tutorial and I've tried it only once.

For the little story, A friend of mine bought a LaFonera+ router beacause it was the cheapest acces point. Then I told him that we can install DD-WRT to have a lot of funtionnality even when I didn't really know if DD-WRT would work on LaFonera+.
So his box was updated and registered with the firmware 1.1.7 (if I remember corectly) and all tutorials to install OpenWrt failled.

I've only tried it once but it was working for me (Even the LAN port)

And as usual, if something bad happend i'm not responsible (even if we can (almost) always recover a bricked Fonera) :D

I haven't a second lafonera+ so if someone can test it (or send me another Fonera+:D) it would be cool


Preparation

You'll need the following for this tutorial:

  1. Telnet client
    • For Windows, Putty again will work.
    • For Mac OS X, telnet is built in. Open Terminal.app and use "telnet".
  2. The following files:
    1. The firmware files:
  3. TFTP server software.
    (TFTP is not FTP; these are different protocols. TFTP, unlike FTP, is used primarily for transferring files to and from network equipment (e.g. your router, switch, hub, whatnot firmware upgrade or backup, or configuration backup and restore))
    Here are some options:
    • Simple TFTP server for Windows: http://www.jounin.net/tftpd32.html Download this and run it, click the Browse button and select the folder containing the rootfs and vmlinux files from above, and use the given server interface as your redboot remote server ip.
    • If you're running Linux, here's the simplest cross-distribution way to setup a TFTP server:
      1. Build tftp-hpa by running ./configure and then make.
      2. Become root (or use sudo) and run ./tftpd/tftpd -s -L [tftpdir] where [tftpdir] is the directory containing vmlinux.bin.l7 and root.fs. Note that this directory and its content must be readable by the nobody user.
      3. Test with a command-line TFTP client, such as the one that was built with tftp-hpa.
    • If you're running Ubuntu, type "sudo apt-get install tftpd-hpa" and put files into /srv/tftp/ directory.
    • If you're running Mac OS X, you can use the integrated tftp server:
      1. Create the TFTP server root by typing sudo mkdir /private/tftpboot
      2. Start the server by typing sudo /sbin/service tftp start
      3. Test it by typing tftp localhost then get (filename) where (filename) is the name of a file you have put in /private/tftpboot
      4. Note: the above instructions only seem to work on older OS X installations. If you're having trouble with the built-in TFTP on the command line, you can use this very useful freeware to manage it with a GUI: http://www.macupdate.com/info.php/id/11116
  4. An Ethernet cable to connect LaFonera to your computer and/or router. (LaFonera's Ethernet port is auto-sensing.)


Flashing

Step 1 - Access the RedBoot command prompt

You need to connect to your FoneraPlus using redboot

  • a) Configure your PC so you have an address like 192.168.1.1 with 255.255.255.0 as netmask.
  • b) Connect your PC and the LaFonera through a ethernet cable to the WAN port.
  • c) Disconnect and reconnect the power to your LaFonera. In the first 10 secs you can access to RedBoot via a plain Telnet connection on port 9000.
    • Open a command prompt or terminal window and type in the following:
telnet 192.168.1.254 9000
Note the 9000 after the IP. This specifies port 9000, which is the port RedBoot is listening on.
If the RedBoot> prompt is not immediately visible, try pressing enter once you've connected.
[You can use a IP/port scan program like Angry IP Scanner, and as soon as it can ping to your LaFonera you can Telnet to it for 10 seconds and you can also check if port 9000 is available]
[Sometimes you may have to use another telnet client such as Putty. Windows' built-in Telnet client may fail to show the prompt after rebooting the LaFonera]
If everything goes well you should have a "RedBoot>" prompt in telnet.

Step 2 - Get the DD-WRT binaries

Download the latest linux.bin from: here [v24 SP1]

Step 3

For v24 RC7 and later:

Copy linux.bin to your TFTP server directory.

No matter what you use for a TFTP server, RedBoot will try to fetch the files from the root directory, e.g., /root.fs. Make sure your TFTP server is configured to do this as some are not by default.

Step 4 - Configure Redboot (Optionnal if your IP is 192.168.1.1)

Configure RedBoot for local IP address and TFTP server in telnet.

ip_address -l [local ip address/24] -h [remote server address]
Replace "[local ip address/24]" with "192.168.1.254/24" and "[remote server address]" with whatever you entered as the IP address of your TFTP server, 192.168.1.1 in this case.
ip_address -l 192.168.1.254/24 -h 192.168.1.1

If the local IP address changes from 192.168.1.254 your Telnet session will die and you will need to reconnect to the newly entered IP address.

Step 5 - Flashing the La Fonera

Type theses command in your redboot console

fis init
load -r -b 0x80041000 linux.bin
fis create linux

The last command, 'fis create linux', takes a considerable amount of time: 35 minutes or more in some cases. Do not lose your patience and power-cycle your FON, or you'll have to start Steps 4 and 5 over again!


Do not reboot yet because boot script needs to be modified:

RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -l vmlinux.bin.l7
.. exec
Enter script, terminate with empty line
>> fis load -l linux
>> exec
>>
Boot script timeout (1000ms resolution): 2
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.1.254
Local IP address mask: 255.255.255.0
Default server IP address: <blank>
Console baud rate: 9600
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Update RedBoot non-volatile configuration - continue (y/n)? y
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot>reset

That's it. Your LaFonera should reboot and start DD-WRT. It by default will DHCP an external IP address, start an open wireless network called "dd-wrt" and have management at http://192.168.1.1 (on port 80). The default username is "root" and the default password is "admin".

Don't worry if the power light stay orange, your fonera is working corectly.


Recovery of a non-responsive LaFonera

If you've managed to get partway through this guild and find the LaFonera doesn't seem to respond anymore, here are a few recovery tricks.

  1. Set your computer's network card IP address to 169.254.255.2 and the subnet mask to 255.255.0.0. You may need to disconnect/disable all other network cards on that PC to ensure the proper route is used.
  2. Connect your LaFonera to the network card via a network cable.
  3. In a browser, try to connect to http://169.254.255.1:8080
  4. If that fails, try to establish an SSH connection to 169.254.255.1
  5. If that fails, try to establish a Telnet connection to 169.254.255.1 on the standard port (23), or port 9000.
    • Power on the LaFonera, and after 2 to 4 seconds, try to start the Telnet connection to catch the RedBoot prompt.
    • When Using RedBoot, make sure you are using line mode for Telnet. In Mac OS X and Linux, enable this by creating a file named ".telnetrc" in your home folder. Add the following lines:
192.168.1.254
	mode line

If all steps above fails you can try this:

1. Change your:

IP adress to: 192.168.1.166
Subnet mask to: 255.255.255.0
Standard gateway to: 169.254.255.1
DNS: 169.254.255.1 (maybe is an optional setting)

2. Open Putty and enter:

Host name: 192.168.1.254
Protocol: Telnet 
Port 9000

3. DON'T press "Open"!

4. Power on your LaFonera

5. When your computer gets an IP adress press the "Open" button in Putty

6. Hopefully you will see someting like this now:

== Executing boot script in 9.160 seconds - enter ^C to abort
 ^C
 RedBoot>

7. If Putty timeout or can't connect to your LaFonera try to restart the LaFonera and try to catch the RedBoot prompt (you only have a few seconds to do that!)

If that fails, you may have to resort to a serial connection

Serial connect devices are listed in the LaFonera Software Flashing / External Links section.

See also LaFonera Software Debricking.


References