Sunday 12 July 2009

For Dummies: Howto create a new Freifunk mesh network

Introduction


Freifunk is a very cool version of Open WRT that allows you to create a mesh network of routers. You can simply connect additional routers to extend the network, and it pretty much takes care of itself.

Unfortunately documentation, at least in English, is somewhat lacking...

We are using it here in Afghanistan to make Mesh networks for schools as part of One Laptop Per Child. It avoids the need to cable between the classrooms and holds the possibility to extend the school network around the school.

This has been tested on my Ubuntu 8.10 Machine with a D-Link DIR 300 Router. This was the one we had recommended to use (it's price to hardware specs ratio is pretty good). However it should in theory work with any other router that supports Openwrt. If you are not using a dir 300 then obviously the dir 300 flash script does not apply - it should be flashed the normal tftp way the same as open wrt.

Getting Started

  1. Install tftp on your machine - from the command line run:

    $sudo apt-get install tftp-hpa

  2. Download the Dir 300 Flash script (dir300-flash-0.9.9.tar.gz) to any directory on your machine from http://x-alina.freifunk-potsdam.de/downloads/dir300-flash/

    $wget http://x-alina.freifunk-potsdam.de/downloads/dir300-flash/dir300-flash-0.9.9.tar.gz
    $tar -xzf dir300-flash-0.9.9.tar.gz

    This should result in a folder called dir300-flash

  3. Download into the newly extracted dir300-flash folder the firmware files. Download openwrt-atheros-root.squashfs and openwrt-atheros-vmlinux.lzma from http://dev.luci.freifunk-halle.net/freifunk-snapshots/atheros/ - or the e

Flashing the router

  1. cd into the dir300-flash directory that was created.

  2. Plugin the ethernet cable to the WAN socket on the back of the router to your computer's first ethernet interface (eth0)

  3. ./dir300-flash.sh

  4. Wait for the script to complete. Make sure that the router will not get unplugged during this time.

Configuration

For this let's assume that we are creating a Mesh under a private IP range (e.g. 192.168.25.x) .

  1. Unplug the cable between your computer and the router from the WAN port on the back of the router and put it into one of the four LAN ports.

  2. Open your browser and go to 192.168.1.1



  3. Username is root, password at this stage is blank

  4. Select Freifunk → Freifunkassistent



  5. Check the boxes to activate Freifunk and OLSR


  6. The IP address comes from putting Freifunknetz + Subnetz (Projekt) + Knoten together. For the moment I am using

    Freifunknetz = 192.168
    Subnetz (Projekt) = 25
    Knoten = 18


  7. If this is the router that will be connected to the Internet or wider network then check the box 'Eigenen Internetzugang freigeben'


  8. Click submit, then save and apply. This will take some time and there might be some errors in your browser. Don't worry...


  9. Under essid enter the normal essid that you want – this should be the same amongst all routers.


  10. Under Netzprefix enter the same as per Freifunknetz – 192.168 for example


  11. Click save and apply


  12. Click Network → Wifi → Wifi0 then choose a channel. Of course make sure to use the same channel with the different routers.


  13. Click Network → Interfaces → Wifi0 and change the netmask to 255.255.255.0


  14. Put a sticker on this router and then put it somewhere to the side. Repeat the procedure with another router giving it a different Knoten (node) number.


  15. Make sure that both routers are powered on and within range of each other. Wait a few minutes...


  16. Click status → OLSR → Routen. You should see the other router's IP listed here


  17. From your client computer try to ping the IP of the other router that is now connected through the mesh – e.g. ping 192.168.25.18


Troubleshooting / Additional Notes

  • Make sure that you do allow enough time for OLSR to determine routes before checking to see if it knows about other routers on your mesh
  • Encryption may well not work! As far as I have heard it causes some issues... I will check this out a little later...
  • It can be possible to run multiple wireless networks from one router - however when I tested this and added an AP network as well that didn't co-operate.

We are using Freifunk to create a wireless backbone – one can use one router as an access point then connect it to other routers running Freifunk that form the backbone – this is still under testing but seems to be co-operating as of right now. Each AP has a traffic control system on it – thus hopefully preventing the mesh backbone from being overloaded...




Thursday 18 June 2009

Step By Step Installing Greenstone 2.82 on Ubuntu 8.10 (Quickstart)

These instructions are designed for those that are completely new to Greenstone (as I was) and would to try it out. This will guide you from blank to having a library that will be accessible through your Apache HTTP server.

1.

I read elsewhere that the sun-java6 package version of java was not going to work. I think this was only for compilation on Ubuntu - I have tested it with the package version and it worked fine.

apt-get install sun-java6-jdk apache2
2.

First Download Greenstone from: http://prdownloads.sourceforge.net/greenstone/Greenstone-2.82-linux – Select For Linux under 'Latest Distribution'
3.

Make the file executable and start the installer:

chmod a+x Greenstone-2.82-linux
./Greenstone-2.82-linux

4.

Most of what's in the installer is pretty self explanatory and one can happily go clicking next through the installer...

5.

You will need to edit your apache configuration to be able to access the new digital library. I made a virtual host called greenstone by adding a line to /etc/hosts

127.0.0.1 greenstone

Then make a new virtual host in apache by creating a file /etc/apache2/sites-available/greenstone for example:


ServerName greenstone

#Greenstone 2 script:

ScriptAlias /greenstone/cgi-bin "/usr/local/Greenstone2b/cgi-bin"

Options None

AllowOverride None

Alias /greenstone "/usr/local/Greenstone2b/"

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all



6

a2ensite greenstone && /etc/init.d/apache2 restart



7

Go with your web browser to: http://greenstone/greenstone/cgi-bin/library.cgi



8

Now it's time to try and add a content – go to this page with your browser. It should provide some info about the java version installed and at the bottom Installation OK - http://greenstone/greenstone/cgi-bin/gliserver.pl?cmd=check-installation


9

A message will come after a little while like Could not connect to local library server after 20 seconds – click no . Then it will prompt for a URL. Enter http://greenstone/greenstone/cgi-bin/gliserver.pl . I found that if you use the library.cgi address as it suggests then the collections do not build.

10. You can now make your collection by simply adding files, going through the tabs and then going to build collection. When you refresh your browser on the library page, your new collection should appear.