kls0e hi :-)

How to run your own Freifunk Berlin service

Martin, a fellow Freifunker from Freifunk Fürstenwalde asked me to publish a tutorial on how to set up your own service in the Freifunk Berlin network. It is actually quite easy once you know how.

Note: Your service has to have an ip reachable from within Freifunk Berlin, you can configure a static ip for it from your Freifunk dhcp pool. If you use the first dhcp ip your Freifunk router would issue to a client, edit its /etc/config/dhcp and raise option start ‘2’ to option start ‘3’ in the lower dhcp config block. This reserves the ip for your static configured service host and avoids duplicate ip delegation via dhcp.

How to announce your service in the Freifunk Berlin network:

  1. log in to your router via ssh

  2. edit the olsr config of your router:
    vim /etc/config/olsrd

  3. scroll down to the section that starts with

config LoadPlugin
     option library 'olsrd_nameservice'
  1. press i to insert text

  2. add

list hosts '<freifunk-ip> <hostname without .olsr>'
list service 'http://<freifunk-IP:port>|tcp|<name of service>'

example: let’s say my service has 10.31.44.119 and I would like the host to be known as kls0e.olsr, and let’s say there is a web server up at port 10178, and every router at Freifunk Berlin should show a link named kls0e to this server under Services on its web gui, then my nameservice plugin section would look like so:

config LoadPlugin
        option library 'olsrd_nameservice'
        option suffix '.olsr'
        option hosts_file '/tmp/hosts/olsr'
        option latlon_file '/var/run/latlon.js'
        option services_file '/var/etc/services.olsr'
        list hosts '10.31.44.119 kls0e'
        list service 'http://10.31.44.119:10178|tcp|kls0e'

udp protocol is also an option instead of tcp. Port info is mandatory, even if it is port 80.

Give it 5-15 minutes to propagate your service announcement across the network.

From my experience, sometimes not all nodes can resolve the hosts entry, so I have chosen to publish the service with its direct Freifunk ip instead of an OLSR host name. The latter would be cooler but form follows function, I am glad if it works for you tho, please try.
Update: Noki kindly mentioned that it makes sense to issue a static dhcp lease for the device hosting the service.

Freifunk Berlin mesh protocol snippets

We are moving from IBSS to 802.11s as the main mesh protocol used for our meshes in the Freifunk Berlin network.

I think the easiest way to adjust the mesh protocol of a freifunk router is to edit /etc/config/wireless and insert or replace the config blocks accordingly.

Please pay attention to the interface names of dual-band devices, the majority of routers call their 2.4 ghz module radio0 and their 5 ghz module radio1, but a Ubiquiti UAP Pro flying saucer frisbee for that matter keeps it vice versa.

If your router only has one radio (radio0), just use the radio0 snippet.

# 802.11s for 2.4 ghz                         
config wifi-iface                   
        option network 'wireless0' 
        option device 'radio0'     
        option ifname 'wlan0-mesh-2'
        option mode 'mesh'               
        option encryption 'none'             
        option mesh_fwding '0'               
        option mesh_id 'Mesh-Freifunk-Berlin'
        option mcast_rate '12000'

# 802.11s for 5 ghz                                   
config wifi-iface                             
        option network 'wireless1'            
        option device 'radio1'                
        option ifname 'wlan1-mesh-5'          
        option mode 'mesh'                    
        option encryption 'none'              
        option mesh_fwding '0'                
        option mesh_id 'Mesh-Freifunk-Berlin'
        option mcast_rate '12000'
# Ad-Hoc / IBSS  for 2.4 ghz         
config wifi-iface                            
       option ssid 'intern-ch13.freifunk.net'
       option ifname 'wlan0-adhoc-2'
       option network 'wireless0'
       option encryption 'none'
       option device 'radio0'          
       option bssid 'D2:CA:FF:EE:BA:BE'
       option mcast_rate '6000'
       option mode 'adhoc'

# Ad-Hoc / IBSS for 5 ghz         
config wifi-iface                           
       option bssid '02:36:CA:FF:EE:EE'     
       option ifname 'wlan1-adhoc-5'        
       option network 'wireless1'           
       option ssid 'intern-ch36.freifunk.net'
       option mcast_rate '12000'             
       option mode 'adhoc'                   
       option device 'radio1'

You can apply all changes made to /etc/config/wireless simply by issuing wifi. There is no need to reboot. If you want the new set mesh interfaces to be monitored with the stats monitor, edit /etc/config/luci_statistics and replace or adjust the interface names in the corresponding sections. To apply these changes, run /etc/init.d/luci_statistics restart.
Bonus: If you have made changes to /etc/config/network, just run service network reload to apply.

24h auto rebooting a router with cron

There is an old WDR3600 we have had donated by some kind soul and its 2.4 ghz radio every now and then would conk out, but it is just not broken enough to throw it away. Rebooting it every 24 hours does the trick:

  1. crontab -e

  2. press shift+G to go to the end of the cron job table

  3. press i for text insert mode

  4. insert this line to reboot the router every night at 3:42 AM:

42 3 * * * sleep 70 && touch /etc/banner && reboot >/dev/null 2>&1

This was initially posted by Jan at Freifunk Winterberg and I thought the line is worth sharing as there is a simple fail-safe option included which essentially prevents the router from accidentally entering a continuous boot-loop caused by a wrong date / time set on the machine. This is a common issue since most routers do not sport an embedded buffered clock and sync their time and date by ntp every once in a while.

compiling Falter Images for Freifunk Berlin

For various reasons, I am glad that Nick has made some efforts to flange our precious Freifunk Berlin Firmware onto Vanilla OpenWrt. The results are in the Falter Github Repo.


Update: The following tutorial is now deprecated as it might contain an outdated diffconfig. Things just got easier: Martin was so kind as to create a build script for Falter images, please find it here and use it instead.
Here is a quick tutorial on how to build working Freifunk Berlin tunneldigger Images using Falter on a linux box:
  1. install OpenWrt build prerequisites aka needed packages as described here.

  2. clone OpenWrt

git clone https://git.openwrt.org/openwrt/openwrt.git falter

  1. change into falter folder by

cd falter

  1. copy feeds.conf.default to feeds.conf

cp feeds.conf.default feeds.conf

  1. add the following line to feeds.conf

src-git falter https://github.com/Freifunk-Spalter/packages.git

  1. run the following two scripts
./scripts/feeds update -a
./scripts/feeds install -a


  1. select your platform and router with the following command. if you do not know where to find it, have a look at the OpenWrt wiki (I’d just google openwrt <routername>) for the router you want to build for, and look at the URLs of the downloadable images, you can get the info from the path, e.g. “ath79” and such

make menuconfig

save + exit.

  1. create a plain-text file called diffconfig and insert this with your favourite text editor:
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_collectd=y
CONFIG_PACKAGE_collectd-mod-cpu=y
CONFIG_PACKAGE_collectd-mod-interface=y
CONFIG_PACKAGE_collectd-mod-iwinfo=y
CONFIG_PACKAGE_collectd-mod-load=y
CONFIG_PACKAGE_collectd-mod-memory=y
CONFIG_PACKAGE_collectd-mod-network=y
CONFIG_PACKAGE_collectd-mod-olsrd=y
CONFIG_PACKAGE_collectd-mod-ping=y
CONFIG_PACKAGE_collectd-mod-rrdtool=y
CONFIG_PACKAGE_collectd-mod-uptime=y
CONFIG_PACKAGE_falter-berlin-dhcp-defaults=y
CONFIG_PACKAGE_falter-berlin-firewall-defaults=y
CONFIG_PACKAGE_falter-berlin-freifunk-defaults=y
CONFIG_PACKAGE_falter-berlin-lib-guard=y
CONFIG_PACKAGE_falter-berlin-migration=y
CONFIG_PACKAGE_falter-berlin-network-defaults=y
CONFIG_PACKAGE_falter-berlin-olsrd-defaults=y
CONFIG_PACKAGE_falter-berlin-statistics-defaults=y
CONFIG_PACKAGE_falter-berlin-system-defaults=y
CONFIG_PACKAGE_falter-berlin-tunneldigger=y
CONFIG_PACKAGE_falter-berlin-uhttpd-defaults=y
CONFIG_PACKAGE_falter-berlin-uplink-tunnelberlin-tunneldigger=y
CONFIG_PACKAGE_falter-common=y
CONFIG_PACKAGE_falter-common-olsr=y
CONFIG_PACKAGE_falter-policyrouting=y
CONFIG_PACKAGE_falter-profiles=y
CONFIG_PACKAGE_ip-full=y
CONFIG_PACKAGE_iperf=y
CONFIG_PACKAGE_kmod-ipip=y
CONFIG_PACKAGE_kmod-iptunnel=y
CONFIG_PACKAGE_kmod-iptunnel4=y
CONFIG_PACKAGE_kmod-l2tp=y
CONFIG_PACKAGE_kmod-l2tp-eth=y
CONFIG_PACKAGE_kmod-l2tp-ip=y
CONFIG_PACKAGE_kmod-ledtrig-default-on=y
CONFIG_PACKAGE_kmod-ledtrig-heartbeat=y
CONFIG_PACKAGE_kmod-ledtrig-netdev=y
CONFIG_PACKAGE_kmod-ledtrig-timer=y
CONFIG_PACKAGE_kmod-udptunnel4=y
CONFIG_PACKAGE_kmod-udptunnel6=y
CONFIG_PACKAGE_libelf=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_libltdl=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_libuhttpd-openssl=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_liboping=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_librrd1=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuci-lua=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci-app-falter-owm=y
CONFIG_PACKAGE_luci-app-falter-owm-ant=y
CONFIG_PACKAGE_luci-app-falter-owm-cmd=y
CONFIG_PACKAGE_luci-app-falter-owm-gui=y
CONFIG_PACKAGE_luci-app-ffwizard-falter=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-olsr=y
CONFIG_PACKAGE_luci-app-olsr-services=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-app-statistics=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-compat=y
CONFIG_PACKAGE_luci-lib-base=y
CONFIG_PACKAGE_luci-lib-httpclient=y
CONFIG_PACKAGE_luci-lib-httpprotoutils=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-ipkg=y
CONFIG_PACKAGE_luci-lib-json=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-ssl-openssl=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-falter=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_micrond=y
CONFIG_PACKAGE_mtr=y
CONFIG_PACKAGE_olsrd=y
CONFIG_PACKAGE_olsrd-mod-arprefresh=y
CONFIG_PACKAGE_olsrd-mod-dyn-gw=y
CONFIG_PACKAGE_olsrd-mod-jsoninfo=y
CONFIG_PACKAGE_olsrd-mod-nameservice=y
CONFIG_PACKAGE_olsrd-mod-txtinfo=y
CONFIG_PACKAGE_olsrd-mod-watchdog=y
CONFIG_PACKAGE_pingcheck=y
CONFIG_PACKAGE_resolveip=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rrdtool1=y
CONFIG_PACKAGE_tcpdump=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_uclibcxx=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_zlib=y

The diffconfig essentially tells the OpenWrt build system to include our Freifunk Berlin packages as well

  1. merge the diffconfig into the OpenWrt .config file
    cat diffconfig >> .config

  2. Sync the edited OpenWrt config, important, don’t forget:
    make defconfig

  3. finally: Build the whole thing. The first build will take some time, roughly 1h or so, after that the consecutive builds will be much faster
    make -jX V=s important: replace the X with cpu threads of your machine +1, for example I have 4 cpu cores that can do 8 threads via Hyperthreading, so I compile using make -j9 V=s

The resulting image will be in bin/targets and is ready to flash. Of course it can be used for plain-mesh nodes as well. You can also sysupgrade from 18.06-based and 19.07-based nodes preserving their config.

Enjoy your falters! Many thanks to everyone who contributed to this and to the Freifunk Berlin Firmware.

PS: Whenever you want to update your buildroot with the latest patches and code, run
git pull
./scripts/feeds update -a
./scripts/feeds install -a

and continue from step 6.

speedtest oneliner for OpenWrt

rudimentary OpenWrt speed test to /dev/null, 100 MB:

START=$(date +%s);  wget -O /dev/null http://speed.hetzner.de/100MB.bin; END=$(date +%s); echo $((END-START))| awk '{print int(800/$1)}'

Mbit/s is shown after completion. Should work on other Linuxes, too, needs wget.

Sourced from the freifunk forum, posted by adorfer, there are some elaborate alternatives mentioned in the thread but this simple approach works for me.

FahrArt bike repair at Haus der Materialisierung

Let me recommend the FahrArt bike repair service at Haus der Materialisierung. Like all the manifold interesting projects located at HdM near Alexanderplatz, their focus is on sustainability and their service is very affordable. They work with used and new bike parts and have very friendly conditions while delivering profound and professional work.

I would pop up spontaneously on a Wednesday evening while they have their open workshop and Max would install some new spare 7-shift shimano rear sprockets right away.

That made me feel happy.

The sprockets were saved from a bike shop clear-out as I had learned later and now experience new (heavy!) use ☺. I also had tons of questions about bikes and how to adjust all the components properly and everything was answered thoroughly and very friendly. So you can learn a lot there as well if you are interested. They also sell affordable used bikes in perfect condition and they will custom build one for you as well.

FahrArt is open Monday – Friday, 12 till late. In case you are planning to go there on a Wednesday and get your bike fixed, feel free to visit our freifunk hackspace and have a cold beverage with us.