Skip to content

Mesh Potato Milestone 1 – Elektra

In the recent weeks I have been busy working on the software for the Mesh-Potato together with David Rowe. Amongst other things I have set up and maintained a Openwrt repository for our project on Sourceforge, as you probably already know. We had to work on the bleeding edge of OpenWRT to test the recent developments, particularly regarding the Madwifi driver. Simply using the tip of the Openwrt development can be troublesome, because what compiles today doesn’t necessarily build tomorrow. So we decided to make a snapshot in order to update and maintain it separately. I have spend much more time on our Openwrt repository than anticipated in the first place. Maintaining our Potato build repository should be a ongoing process until we can merge everything back into OpenWRT some day.

We have ported Oslec (Davids Open-Source-Line-Echo-Canceler) to Openwrt and fixed issues with Asterisk. There is a package for Asterisk in Openwrt Kamikaze, but it didn’t work. Asterisk is consuming a lot of the scarce room in the flash of a cheap embedded device. We had to use the extremely well compressing squashfs filesystem to squeeze everything including Asterisk, Iproute2, Batman and the Linux kernel into 4MB of flash. Currently there is about 500 KByte space left. So we could – with some effort – actually squeeze a web-interface like LUCI into 4MByte of flash. Having at least 8 MByte flash in the Mesh-Potato is surely a good idea.

At one point we decided to test the  feasibility of the Atheros AR2317 chipset for our upcoming product. Looking through the Openwrt wiki I found that there was a device on the market with that chipset, the D-Link DIR-300. However it was marked as “WiP” (Work in Progress). So I had to spend time on getting the D-Link DIR-300 run Openwrt which took me a few days. The main problem was that Openwrt didn’t know where to find the WiFi EEPROM data in the flash. I had to buy two DIR-300 because I bricked the first one and had to do some soldering on both devices because I needed the serial port and the JTAG port to revive it.

This is yet another good property of the Ubiquiti NS2 – all the pins for these ports are already there. Something that we should also consider for the Mesh-Potato.

David and I have tested the feasibility of VOIP over a Potato-Mesh with the GSM codec. It does work and it matched or exceeded our expectations.

When I had the DIR-300 working I wrote a few mails to the Freifunk mailing list about the possibility to use the DIR-300 with OpenWRT Kamikaze as a cheap replacement for the Linksys WRT54GL. Freifunk is always looking for cheap, flexible hardware that supports mesh networking. Several developers are now working on Freifunk support for this device. It works perfectly for me on the command line, but lacks easy point-and-click support. The firmware images available now for the DIR-300 in Freifunk networks don’t feature the ease-of-use and the user-friendliness that the Linksys WRT54GL support has, but the Freifunk community is on a good way.

I could omit work on the fragmentation bug in Madwifi. We don’t need fragmentation since our voice packets will be by far smaller than any reasonable fragmentation threshold (I’d say 256 Bytes is the lowest reasonable threshold), even if we use very long chunks of audio in the voice packets.  Audio chunks of 200ms or more would be impractical anyway.

Overall the problems with Madwifi were quite a headache. It is a major achievement that Madwifi is working well now. My contacts to Felix Fietkau, one of the OpenWRT developers helped a lot. He is also the guy doing the work regarding the Madwifi driver for OpenWRT.  Actually the Madwifi version in OpenWRT is the only one that actually works in Ad-Hoc and Ah-demo mode. If you want to do anything with a Atheros 802.11abg device you should currently use the Madwifi source and patches from Openwrt. (Until ath5k/ath9k support in the Linux kernel works at least as good as Madwifi works now) I’m using Freifunk as my only connectivity to the Internet every day. As soon as I had Madwifi working in our repository, the NS2 and later the DIR-300 became part of my networking infrastructure that I depend on every day.

The OpenWRT build environment is quite complex and it takes quite a while to get into it. The documentation available doesn’t match its complexity, it doesn’t even mention some of the great features that you either have to explore yourself or learn by talking to one of the OpenWRT developers. I learned a lot more about it in the recent weeks, also thanks to Felix who kindly answered many questions. OpenWRT is a great environment for embedded devices. It has been around for a while and it is already popular but I believe its success story is just about to begin.

%d bloggers like this: