26th October 2008

Oh Lord ! OpenWrt just work on Fonera+ !

Tags : ,

posted in Embedded |

Yes ! The last OpenWrt snapshot (20080910 (update : 20081015)) just work fine ! Happy time ! Just get rootfs (openwrt-atheros-root.jffs2-64k) and kernel (openwrt-atheros-vmlinux.lzma) then flash it with RedBoot and console adaptater.

Startup :

+Ethernet eth0: MAC address 00:00:00:00:0:00
IP: 192.168.10.10/255.255.255.0, Gateway: 0.0.0.0
Default server: 192.168.10.1

RedBoot(tm) bootstrap and debug environment [ROMRAM]
OpenWrt certified release, version 1.1 - built 22:32:28, May  7 2007
Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: FON 2201
RAM: 0x80000000-0x81000000, [0x80040290-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 10.000 seconds - enter ^C to abort

The La Fonera+ (FON2201), with Fon firmware use a second bootloader (stage2) who load the kernel, etc... The OpenWrt firmware don't. Everything just work like with classic Fonera (FON2100). So, we flash it with :

fis init

ip_address -l 192.168.10.10/24 -h 192.168.10.1

load -r -b 0x80041000 openwrt-atheros-2.6-root.jffs2-64k
fis create -b 0x80041000 -f 0xA8030000 -l 0x006F0000 -e 0x00000000 rootfs

load -r -b 0x80041000 openwrt-atheros-2.6-vmlinux.lzma
fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.l7

Wait, take a cup of coffee... then take care of Redboot configuration. We have :

RedBoot> fconfig -l -n
boot_script: true
boot_script_data:
.. fis load -b 0x80100000 loader
..  go 0x80100000

boot_script_timeout: 2
bootp: false
bootp_my_gateway_ip: 0.0.0.0
bootp_my_ip: 192.168.1.1
bootp_my_ip_mask: 255.255.255.0
bootp_server_ip: 192.168.1.254
console_baud_rate: 9600
gdb_port: 9000
info_console_force: false
net_debug: false

Ok. Change to :

RedBoot> fconfig
Run script at boot: true
Boot script:
.. fis load -b 0x80100000 loader
..  go 0x80100000
Enter script, terminate with empty line
>> fis load -l vmlinux.bin.l7
>> exec
>>
Boot script timeout (1000ms resolution): 10
Use BOOTP for network configuration: false
Gateway IP address:
Local IP address: 192.168.10.10
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.10.1
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

Then reboot with reset. And then... let the magic happen :

RedBoot> fis load -l vmlinux.bin.l7
Image loaded from 0x80041000-0x80297085
RedBoot> exec
Now booting linux kernel:
 Base address 0x80030000 Entry 0x80041000
 Cmdline :
Linux version 2.6.26.3 (andy@devsandbox.padded-cell.net)
        (gcc version 4.1.2) #1 Tue Sep 9 17:29:16 PDT 2008
CPU revision is: 00019064 (MIPS 4KEc)
Determined physical RAM map:
 memory: 01000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
  Normal          0 ->     4096
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0:        0 ->     4096
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
Kernel command line: console=ttyS0,9600 rootfstype=squashfs,jffs2 init=/etc/preinit
Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 16 bytes
PID hash table entries: 64 (order: 6, 256 bytes)
console [ttyS0] enabled
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 13480k/16384k available (1943k kernel code, 2904k reserved, 323k data, 128k init, 0k highmem)
SLUB: Genslabs=6, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
net_namespace: 644 bytes
NET: Registered protocol family 16
Radio config found at offset 0xf8(0x1f8)
AR531x PCI init...
done
PCI: fixing up device 0,3,0
PCI: Failed to allocate mem resource #1:4000000@84000000 for 0000:00:00.0
PCI: Failed to allocate mem resource #1:4000000@84000000 for 0000:00:03.0
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
ar531x: Registering GPIODEV device
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
msgmni has been set to 26
io scheduler noop registered
io scheduler deadline registered (default)
gpiodev: gpio device registered with major 254
gpiodev: gpio platform device registered with access mask FFFFFFFF
Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0xb1100003 (irq = 37) is a 16550A
eth0: Atheros AR231x: 00:18:84:a0:5b:98, irq 4
ar2313_eth_mii: probed
eth0: Marvell 88E6060 PHY driver attached.
eth0: attached PHY driver [Marvell 88E6060] (mii_bus:phy_addr=0:1f)
cmdlinepart partition parsing not available
Searching for RedBoot partition table in spiflash at offset 0x7d0000
Searching for RedBoot partition table in spiflash at offset 0x7e0000
6 RedBoot partitions found on MTD device spiflash
Creating 6 MTD partitions on "spiflash":
0x00000000-0x00030000 : "RedBoot"
0x00030000-0x00720000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
split_squashfs: no squashfs found in "spiflash"
0x00720000-0x007e0000 : "vmlinux.bin.l7"
0x007e0000-0x007ef000 : "FIS directory"
0x007ef000-0x007f0000 : "RedBoot config"
0x007f0000-0x00800000 : "boardconfig"
Registered led device: gpio0
Registered led device: gpio1
Registered led device: wlan
Registered led device: gpio3
Registered led device: gpio4
Registered led device: gpio7
nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
eth0: Configuring MAC for full duplex
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP vegas registered
NET: Registered protocol family 17
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (jffs2 filesystem) readonly.
Freeing unused kernel memory: 128k freed
Please be patient, while OpenWrt loads ...
Algorithmics/MIPS FPU Emulator v1.5
- preinit -
Press CTRL-C for failsafe
- init -
Please press Enter to activate this console. PPP generic driver version 2.4.2
device eth0.0 entered promiscuous mode
device eth0 entered promiscuous mode
br-lan: port 1(eth0.0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 1(eth0.0) entering forwarding state
ipt_time loading
wlan: trunk
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.10.5.6 (AR5212, AR5312, RF5111, RF5112, RF2316, RF2317, TX_DESC_SWAP)
ath_rate_minstrel: Minstrel automatic rate control algorithm 1.2 (trunk)
ath_rate_minstrel: look around rate set to 10%
ath_rate_minstrel: EWMA rolloff level set to 75%
ath_rate_minstrel: max segment size in the mrr set to 6000 us
wlan: mac acl policy registered
ath_ahb: trunk
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
ath_ahb: wifi0: Atheros 2315 WiSoC: mem=0xb0000000, irq=3

BusyBox v1.11.1 (2008-09-09 15:08:51 PDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge, r12419) -------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#

Luvzzzzz ! Next step :

 root@OpenWrt:/# cat /proc/net/dev
Inter-|   Receive
 face |bytes    packets errs drop fifo...
    lo:       0       0    0    0    0...
  eth0:       0       0    0    0    0...
eth0.0:       0       0    0    0    0...
eth0.1:       0       0    0    0    0...
br-lan:       0       0    0    0    0...
 wifi0:       0       0    0    0    0...

What the... ?! I see VLAN stuff here. And... we have a bridge too :

brctl show
bridge name bridge id          STP enabled  interfaces
br-lan      8000.001884a05b98  no           eth0.0

Not very usefull for testing, so :

root@OpenWrt:/# ifconfig br-lan down
br-lan: port 1(eth0.0) entering disabled state
root@OpenWrt:/# brctl delbr br-lan
device eth0.0 left promiscuous mode
br-lan: port 1(eth0.0) entering disabled state
root@OpenWrt:/# ifconfig eth0.0 192.168.10.10
root@OpenWrt:/# ifconfig eth0.1 192.168.0.24

And :

root@OpenWrt:/# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
64 bytes from 192.168.0.1: seq=0 ttl=64 time=1.912 ms
64 bytes from 192.168.0.1: seq=1 ttl=64 time=1.475 ms
root@OpenWrt:/# ping 192.168.10.1
PING 192.168.10.1 (192.168.10.1): 56 data bytes
64 bytes from 192.168.10.1: seq=0 ttl=64 time=2.538 ms
64 bytes from 192.168.10.1: seq=1 ttl=64 time=1.460 ms

Nice. Just for fun :

root@OpenWrt:/# arp
IP address    HW type  Flags  HW address         Mask  Device
192.168.10.1  0x1      0x2    00:0d:60:cb:5a:27  *     eth0.0
192.168.0.1   0x1      0x2    00:19:66:2e:b2:13  *     eth0.1

Ok, it work. Let's change the configuration (without uci here). We play with configuration files :

# /etc/config/network
config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'

config 'interface' 'lan'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'netmask' '255.255.255.0'
        option 'ifname' 'eth0.0'
        option 'ipaddr' '192.168.0.24'

config 'interface' 'wan'
        option 'ifname' 'eth0.1'
        option 'proto' 'static'
        option 'netmask' '255.255.255.0'
        option 'ipaddr' '192.168.10.10'
# /etc/config/wireless
config wifi-device  wifi0
        option type        atheros
        option channel     auto
        option disabled    0
        option channel     6
        option disabled    0
        option diversity   0
        option txantenna   1
        option rxantenna   1
        option mode        11bg

config wifi-iface
        option device     wifi0
        option network    lan
        option mode       ap
        option ssid       OWRTplus
        option encryption psk
        option key        'coucou'
        option txpower    '18'

The reboot and... :

root@OpenWrt:/# cat > /etc/resolv.conf
nameserver 80.10.246.130
nameserver 80.10.246.3
root@OpenWrt:/# route add default gw 192.168.0.10
root@OpenWrt:/# ping www.google.com
PING www.google.com (209.85.129.147): 56 data bytes
64 bytes from 209.85.129.147: seq=0 ttl=239 time=47.223 ms
64 bytes from 209.85.129.147: seq=1 ttl=239 time=47.247 ms

The La Fonera+ access to internet ! We can install other stuff now. ipkg is dead, we now have opkg and it's allready configured :

root@OpenWrt:/# cat /etc/opkg.conf
src snapshots http://downloads.openwrt.org/snapshots/atheros/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists

root@OpenWrt:/# opkg update

root@OpenWrt:/# opkg install wpa-supplicant
Installing wpa-supplicant (0.6.3-1) to root...
Configuring wpa-supplicant

root@OpenWrt:/# opkg install hostapd
Installing hostapd (0.6.4-1) to root...
Installing libopenssl (0.9.8h-1) to root...
Installing zlib (1.2.3-5) to root...
Configuring hostapd
Configuring libopenssl
Configuring zlib

What a good time ! So, reboot and... BOOM !

device ath0 entered promiscuous mode
br-lan: port 2(ath0) entering learning state
br-lan: topology change detected, propagating
br-lan: port 2(ath0) entering forwarding state
br-lan: port 2(ath0) entering disabled state
device ath0 left promiscuous mode
br-lan: port 2(ath0) entering disabled state

Strange. Searching, searching... and... what about... :

root@OpenWrt:/etc/init.d# /sbin/wifi down
root@OpenWrt:/etc/init.d# /sbin/wifi up
Configuration file: /var/run/hostapd-ath0.conf
Line 10: invalid WPA passphrase length 6 (expected 8..63)
WPA-PSK enabled, but PSK or passphrase is not configured.
2 errors found in configuration file '/var/run/hostapd-ath0.conf'
enable_atheros(wifi0): Failed to set up hostapd for interface ath0

Ok. My fault ! Passphrase update and Reboot.

Nice, it's alive ! Here we have a La Fonera+ with a nice OpenWrt, two ethernet, a bridge, and a WPA AP WPA...

Hey, OpenWrt guys'n'girls ! What a nice job ! We love you !

This entry was posted on Sunday, October 26th, 2008 at 12:49 pm and is filed under Embedded. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

There are currently 5 responses to “Oh Lord ! OpenWrt just work on Fonera+ !”

Why not let us know what you think by adding your own comment! Your opinion is as valid as anyone elses, so come on... let us know what you think.

  1. 1 On October 28th, 2008, Josu said:

    Hello, I have a La Fonera+ and I am very happy about your article.

    I have an other WRT54GL with OpenWRT and it is fantastic. But I have installed from the web interface.

    I don’t understand how to install the firmware. I have some questions:

    1. How I connect the router to the PC?
    2. How access to the router?
    3. Which files download on http://downloads.openwrt.org/kamikaze/7.09/?
    4. Once I have installed, I can reinstall other firmwares? DD-WRT, Tomato, FON, etc???

    Thank you very much for all.

  2. 2 On October 29th, 2008, apak said:

    Could you please post the files you used?
    I have used latest snapshots, and they don´t work anymore.
    Can´t pass the step about the ping. The ping don´t respond.
    Thanks

  3. 3 On October 29th, 2008, Lefinnois said:

    Josu : 7.09 don’t handle Vlan stuff on the fonera+, you must use snapshots or build from SVN. To flash, you must get access to Redboot prompt. Easy way is by the serial console port (http://www.lefinnois.net/wpen/index.php/2007/04/07/first-post/) or search google for “fonera redboot telnet”

    Apak : hmmmm…. iptables ? /etc/init.d/firewall ?

  4. 4 On October 31st, 2008, Josu said:

    Thankyou for your response. Sorry for my ignorance, but which is the diference between 7.09 and the snapshot? What that snapshot mean?

    Do you refer to http://downloads.openwrt.org/snapshots/atheros/?

    The last question: How do you upload the files to Fonera on Redboot?

    Thankyou very much for your help.

    Regards.

  5. 5 On November 12th, 2008, E-breaker said:

    Thanks so much, I haven´t time to try it. But this weekend i´ll probably try this, thanks Again. :D:D:D:D

    I´ll be a pleasure if you let me translate this into Spanish, and give me permision to post in Webs in Spanish.

    Thanks Again. and please answer me.

Leave a Reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image