Fonera with OLSR (English)

Aus wiki.freifunk.net
Wechseln zu: Navigation, Suche
This page is a (partial) translation of Fonera mit OLSR (specifically, this snapshot). It is a quick-and-dirty translation and questions should be referred to the original article.

To use the Fonera with OSLR, you need to overwrite it with your own firmware. For this, OpenWrt Kamikaze is best.

Inhaltsverzeichnis

Precompiled OpenWrt image and matching packages

The project delivers precompiled firmware and repositories [1]. They are often updated but are not tested.

There is also an unofficial OpenWrt image and IPKG repository for Fonera [2]. There is also the Fonera repository by Sven-Ola in connection with the Freifunk-Fonera-Pack.

To connect to the device

Serial interface

The best access is via a serial interface, e.g. with a conventional USB-to-serial converter. A discussion about usable cables and the pin connectors is in the forum [3].

Fonera doesn't boot when the USB-to-serial cable is connected directly, specifically the TX pin, so first the cable (TX pin) has to be removed, then connect the Fonera to the power, and after 5-8 seconds attach the serial cable.

Ethernet

The Fonera listens in factory settings at the LAN port at 169.254.255.1. This means you can connect with eternet if you give yourself the local IP from the network 169.254.255.0/24.

With one of the following methods you can get access to ssh:

Important: With the latest Fonera firmware (0.7.1-2), which is installed automatically, as soon as the Fonera connects to the Internet, there have been loopholes closed and both of the hacks don't work anymore. However the update can be removed when the device is reset to factory defaults.

Patching RedBoot ethernet access

With some tricks, you can also enable access to the bootloader via ethernet cable. From the shell you can patch the configuration of the bootloader so that for 10 seconds during boot, at the IP address 192.168.1.254, at port 9000, is reachable via Telnet. For this the configuration of the bootloader is written in flash memory.

root@OpenWrt:~# wget http://coppercore.net/~kevin/fon/out.hex
root@OpenWrt:~# mtd -e "RedBoot config" write out.hex "RedBoot config"
root@OpenWrt:~# reboot 

On devices with an older Fon firmware (v. 0.7.0-4?), you need to possibly use a patched kernel to get write access to the flash memory:

root@OpenWrt:~# wget http://coppercore.net/~kevin/fon/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma
root@OpenWrt:~# mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
root@OpenWrt:~# reboot 

This method was deveoped by Camicia and others in the DD-WRT forum. The following files are such: [4] [5] [6] [7]

Overwriting the flash memory

To install a system on fonera you need to write a new root filesystem and matching kernl in the flash memory.

The process takes several minutes and must not be interrupted!

Flash the mtd

With mtd program you can override the flash memory and install a new OpenWRT image this way with wget or scp:

root@OpenWrt:~# mtd -e vmlinux.bin.l7 write openwrt-atheros-2.6-vmlinux.lzma vmlinux.bin.l7
root@OpenWrt:~# mtd -e rootfs write openwrt-atheros-2.6-root.jffs2-64k rootfs
root@OpenWrt:~# reboot

Attention: This method was successfuly tested with the fon firmware 0.7.1-r1 and the snapshot image. However there are several people who have bricked their devices this way. If you don't have a serial cable, you should first open access to the boatloader via ethernet and to still be functional.

Flashing with RedBoot

In the Fonera the FOSS bootloader RedBoot [8] is installed which among other things can overwrite the flash memory.

Over serial console

If you are connected via serial interface (see above) you can simply start the flash process and simply move the flashable files with XModem or YModem.

It is recommended to change the baud rate first to not do this at a snail's pace:

RedBoot> baudrate -b 115200

Afterwards you also need to adjust the terminal program accordingly to complete the following flash process:

RedBoot> fis init
RedBoot> load -r -v -b %{FREEMEMLO} openwrt-atheros-2.6-root.jffs2-64k -m ymodem

In the terminal program there will be a "C" and you can start the transfer of the new root filesystem (openwrt-atheros-2.6-root.jffs2-64k).

After the file is transferred, you create a partition in the flash memory and save the transferred file there:

RedBoot> fis create -f 0xA8030000 -l 0x00700000 -e 0x00000000 rootfs

Now you transfer the new kernel (openwrt-atheros-2.6-vmlinux.lzma) and create a partition for it:

RedBoot> load -r -v -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma -m ymodem
RedBoot> fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7
Over ethernet

For a connection via ethernet (see above) you need to make sure that the network card is active while the Fonera is being booted. The automatic netlink check of modem devices might fail at this. A router or switch in between might solve this.

Once you have turned on the Fonera you have about 10 seconds to connect via Telnet and then by pressing Ctrl-C during the boot process. If you do not succeed to do this in time or it's not accepted otherwise, you can aslo use this script. It is used as follows:

perl redboot.pl <fonera_ip>

If you are connected via ethernet you need the send the files via tftp or http to the device.

After you are connected to the Fonera you need create a temporary network connection. The syntax is as follows:

RedBoot> ip_addr -h <server_ip> -l <fonera_ip>/24

As server_ip you need to give an IP from which the files can be transffered. The fonera_ip has to be in the same network.

RedBoot> ip_addr -h 192.168.1.23 -l 192.168.1.254/24

Next, you start the flash process by transferring the root filesystem via tftp. Then you create a partition in flash and save the transferred file there.

RedBoot> fis init
RedBoot> load -r -v -b %{FREEMEMLO} openwrt-atheros-2.6-root.jffs2-64k
RedBoot> fis create -f 0xA8030000 -l 0x00700000 -e 0x00000000 rootfs

Now you transfer the new kernel and create a partition for it as well.

RedBoot> load -r -v -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma
RedBoot> fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7

Alternatively you can transfer files via http to the router, as described in [9].

Booting the new system

Finally, you can load and boot the new kernel:

RedBoot> fis load -l vmlinux.bin.l7
RedBoot> exec

Now the boot process has been finished and after pushing the Enter button you should be logged into the new system.

Please press Enter to activate this console. 

Configuration

The confiruation for Fonera as Freifunk node with OLSR

Setting the password

root@OpenWrt:~# passwd

As long as no password is set, you can log into the system via Telnet. After the password is set, Telnet is deactivated and only ssh works.

Setting up the network

The confirguaton of the ethernet interface comes from the file /etc/config/network. e.g:

config interface wan
        option ifname   eth0
        option proto    dhcp

config interface lan
       option ifname   eth0.1
       option proto    static
       option ipaddr   169.254.255.1
       option netmask  255.255.255.0

A detailed scrbiption can be found in the OpenWrt wiki [10].