F+ Adv

From FON Wiki Beta

Jump to: navigation, search
Changes and instructions described in this page are meant to be done by developers only. Applying these changes to your La Fonera might irremediably damage it. FON will not be held responsible for their consequences. Read instructions carefully!

This page intends to document advanced usage of La Fonera+

Contents

Cosmetics

  • Tired of being "unregistered" on a Fonera+
launch a SSH session to 192.168.10.1
echo 1 > /etc/config/registered
(refresh) your webbrowser for 192.168.10.1 :-)
  • you want a "freewlan" skin/basic functionality on your La Fonera+ ?
cd /tmp
wget http://www.fonera.be/extras/freewlan/install.sh && chmod +x install.sh && ./install.sh
WARNING : don't be a cowboy and don't try to test QRM on this ported version yet! It will brick your Fonera+

Memory related

  • To preserve memory the busybox has been minimalized. There is no VI editor on the Fonera+. When editing scripts on e.g. Windows, make sure you remove the typical MsDos Endlines by using
cat status.sh|sed 's/.$//' >statusnew.sh
  • Want to remove functionality to get more free memory?
rmmod ... (scanner, webcam, ...)

Troubleshooting

  • the SSID is "FON_ATTENTION_PLEASE"
* you will also notice Wireless&Power blinking orange
* You will also notice that you will have an ip in the 192.168.1.x range
* Do a power recycle first, perhaps it will go away at next reboot!
    • Browse to 192.168.1.1
    • Username :admin
    • Password : the serial number on the back of your La Fonera

Development

  • The La Fonera / + / 2 is just an embedded linux router which can run compiled MIPS binaries.
    • Any opensource C source can thus be ported to a La Fonera environment:

Prerequisites

Installation

The following packages are necessary to compile on your development machine for La Fonera

  • gcc
  • binutils
  • patch
  • bzip2
  • flex
  • bison,
  • make
  • gettext
  • pkg-config
  • unzip
  • libz-dev
  • libc headers.
NOTE: More packages are needed, so list needs to be updated --RHarmsen 09:37, 15 October 2008 (UTC)
For Windows users it's perhaps more practical to have a "cygwin" environment?
$ mkdir /some/where/fonera-src
  • Go to the folder that you just created and extract fonera.tar.bz2
$ cd /some/where/fonera-src/
$ tar jxvf /another/where/fonera.tar.bz2
  • Configure your environment
$ make V=99 menuconfig
  • Quit & Save
  • Compile your Environment
$ make V=99
  • Your development environment is now finished

PATH config

  • Add the following in your path
$ PATH=$PATH:/some/where/fonera-src/staging_dir_mips/bin
$ export PATH

Example 'Hello World'

  • Code
 $ cat > test.c << EOF
 #include <stdio.h>
 int
 main(int argc, char *argv[])
 {
     printf("Hello World !\n");
 }
 EOF
  • Compilation
$ mips-linux-uclibc-gcc test.c -o test

  • Send it to your La Fonera using eg SCP
$ scp test root@192.168.10.1:/tmp
  • Execute it
root@OpenWrt:~# ./test
Hello World

Already ported Applications

DISCLAIMER : La Fonera uses an Atheros Mips CPU running in big endian mode. OpenWrt is built for Broadcom MIPS CPUs running in little endian mode. So you will need to build your applications yourself, using a big-endian tool set. Only use *-MIPS.IPK and not *-MIPSEL.IPK

BEWARE : installing additional packages may compromise the stability of la fonera+, cause memory leaks and malfunctions. Install packages under your own responsability

  • Sometimes ipkg is very long to run, and memory errors can occur.
    • Tips :
      • "wget" your ipk package to /tmp, and then run it.
      • Kill not needed processes with a "killall" command for :dnsmasq,chilli,fonstate,httpd,fonsmcd,crond,hotplug2,logger,syslogd,klogd,watch_chilli

FONERA Classic (2100/2200) Repository

root@OpenWrt:/# echo "src gcd http://www.gcd.org/fonera" >> /etc/ipkg.conf
root@OpenWrt:/# ipkg update
Downloading http://www.gcd.org/fonera/Packages
Updated list of available packages in /usr/lib/ipkg/lists/gcd
Done.
  • After modification of /etc/ipkg.conf, run ``ipkg update, and the list of feed will be saved in /usr/lib/ipkg/lists/gcd
  • Then, run ``ipkg install <package> to install the package. Refer the help message shown by ``ipkg -h.
NOTICE: ipkg 0.99.162 installed in the current La Fonera (archived in /bin/busybox) has a problem: 
you may remove a non-empty directory while running ``ipkg remove <package> 
(exactly saying, it's a bug of the rmdir implementation of mini_fo). 
BE CAREFUL! Removing important directories such as /lib causes serious problem. 
Use alternative ipkg (ex. bugfixed ipkg 0.9 sh script), or do not use ``ipkg remove <package>.

FONERA + (2201) Repository

Busybox upgrade

  • Busybox provided in original Fonera+ firmware by FON is very poor.
  • Upgrading Busybox to version 1.4.2-1 will permit you to use "vi" editor, and retrieve colors for displaying files and directories. * Perhaps more !
root@OpenWrt:~# cd /tmp
root@OpenWrt:~# wget http://downloads.openwrt.org/kamikaze/7.06/atheros-2.6/packages/busybox_1.4.2-1_mips.ipk
Connecting to downloads.openwrt.org [195.56.146.238:80 ]
busybox_1.4.2-1_mips 100% |*****************************|   312 KB 00:00:00 ETA
root@OpenWrt:~# ipkg install busybox_1.4.2-1_mips.ipk
Upgrading busybox on root from 1.4.1-1 to 1.4.2-1...
Configuring busybox
Done.
  • Installation is about 5 to 7 minutes, be patient.
  • If you get error message : ipkg: fork failed: Cannot allocate memory , please kill all processes as described in "ipkg installing packages" section
  • Reboot your Fonera+ after upgrading

CIFS Installation

opkg install kmod-fs-cifs
  • modify section 'mount' on /etc/fstab and please change it with YOUR configuration
config 'mount'
       option 'target' '/mnt/cifs'
       option 'device' '//169.254.255.2/fonera'
       option 'fstype' 'cifs'
       option 'options' 'user=foneraplus'
       option 'enabled' '1'
  • this will automount remote share 'fonera' at next reboot.
    • /etc/fstab is automatically updated
    • Make sure the user "foneraplus" exists on your fileserver.
    • "169.254.255.2" is your fileserver, if not adapt!

Samba Client Installation

root@Fonera:/# ipkg list | grep samba
samba-client - NetBIOS/SMB simple client
samba-common - NetBIOS/SMB server and client shared files
samba-server - NetBIOS/SMB file and print server
root@Fonera:/# ipkg install samba-client
root@Fonera:/# smbclient -L 192.168.0.1
session request to 192.168.0.1 failed (Called name not present)
session request to 192 failed (Called name not present)
Password:
       Sharename      Type      Comment
       ---------      ----      -------
       foneraplus     Disk

root@Fonera:/# smbclient //192.168.0.1/foneraplus
session request to 192.168.0.1 failed (Called name not present)
session request to 192 failed (Called name not present)
Password:
smb: \> ls
 .                                   D        0  Sun Oct 21 05:56:30 2007
 ..                                  D        0  Sun Oct 21 05:56:30 2007
 test.txt                            A  4128768  Sun Oct 21 05:57:24 2007
smb: \> exit
root@Fonera:/# mount  //192.168.0.1/foneraplus /mnt
mount: mounting \\192.168.0.1\foneraplus on /mnt failed: No such device
root@Fonera:/# ls /
bin         home        misc        rom         sys         var
dev         jffs        mnt         root        tmp         webcam_www
etc         lib         proc        sbin        usr         www
root@Fonera:/# mount
mount       mount.cifs  mount_root
mount -t cifs //remote_ip/share /mnt/remote -o user=username, passwd=my_pass   
  • password not mandatory.

VPN WARP

SERVICE HAS BEEN DISCONTINUED ON AUGUST 2008
More info : http://mobile.biglobe.ne.jp/vpnwarp/
Source: http://www.gcd.org/fonera/
  • Installation of www.gcd.org/fonera as extra IPK repository for La Fonera 1
root@OpenWrt:~# echo "src ggd http://www.gcd.org/fonera">> / etc / ipkg.conf 
root@OpenWrt:~# ipkg update 
Downloading http://download.fon.com/release/fonera/0.7/packages/Packages 
Updated list of available packages in /usr/lib/ipkg/lists/fon 
Downloading http://www.gcd.org/fonera/Packages 
Updated list of available packages in /usr/lib/ipkg/lists/gcd 
Done. 
root@OpenWrt:~# 
  • Installation of the VPN Relay Agent:
root@OpenWrt:~# ipkg install relayagent 
Installing relayagent (1.0.7) to root... 
Downloading http://www.gcd.org/fonera/relayagent_1.0.7_mips.ipk 
Installing libopenssl (0.9.8d-1) to root... 
Downloading http://www.gcd.org/fonera/libopenssl_0.9.8d-1_mips.ipk 
Installing zlib (1.2.3-3) to root... 
Downloading http://www.gcd.org/fonera/zlib_1.2.3-3_mips.ipk 
Configuring libopenssl
Configuring relayagent
Configuring zlib
Done.
root@OpenWrt:~#
senri:/home/sengoku% echo "password" > relay,5000005-pass.txt 
senri:/home/sengoku% scp -p relay,5000005.pfx relay,5000005-pass.txt fonera:/etc/warp/ 
root@fonera's password: admin
relay,5000005.pfx                             100% 4856     4.7KB/s   00:00 
relay,5000005-pass.txt                        100%    9     0.0KB/s   00:00 
root@OpenWrt:~# cd /etc/warp/ 
root@OpenWrt:/etc/warp# ls -l 
-rw-------    1 root     root            9 Jan  9 04:09 relay,5000005-pass.txt 
-rw-------    1 root     root         4856 Jan  9 04:09 relay,5000005.pfx 
-rw-r--r--    1 root     root         3290 Jan  9 07:47 relayagent.cfg.sample 
root@OpenWrt:/etc/warp# cp relayagent.cfg.sample relayagent.cfg 
root@OpenWrt:/etc/warp# vi relayagent.cfg 
#-------------------------------------------------------------------- 
#-x pfx formaat om de client-certificaat 
#-X opgeven van het wachtwoord bestand 
#-------------------------------------------------------------------- 
-x "/etc/warp/relay,0000000.pfx"
-X "/etc/warp/relay,0000000-pass.txt"
  • Make sure the relay service is started at next reboot:
root@OpenWrt:~# /etc/init.d/N50relayagent start 
#------------------------------------------------- ------------------- 
#<relay SABA:POTO> <bestemming hostnaam: poortnummer >
# -p optie is de betekenis van de volgende # 
# <Proxy Server name: haven number> <bestemming hostnaam: poortnummer 
# 
#----------------------------------------
warp.klab.org:443 localhost:80