Skip to content

Openwrt port zeroconf neighborhood

rraf edited this page Jun 18, 2012 · 5 revisions

##Prerequisites

If there's support for your router go with the Backfire release. The 2.4 kernel will do just fine.

After you managed to flash OpenWrt on your router, you should install a couple of libraries:

opkg install libavahi

opkg install uclibcxx

You might also need to install libpthread librt libgdbm libdaemon.


  • Buildroot. You will need to build a toolchain on your working machine to be able to compile code for your router.

You can use the following configuration file. Don't forget to change the target system!


git clone git://github.com/rraf/wiselib.git

cd wiselib

git checkout openwrt

Edit wiselib.testing/external_interface/openwrt/openwrt_types.h to make sure you use the right interface for your device.

cd apps/openwrt_apps/example_app/

Edit the Makefile to make sure TOOLS_PATH and OWRT_TOOLCHAIN_LIBS point to the right place.

make example_app

Now use scp`ftp\whatever` to get it on the router.

You can also compile and run it for the PC.

make example_pc


Testing

Run one instance on your router, and a few on your LAN PCs. Alternatively if you already have avahi installed on your PC you can just publish services and see how the neighborhood is populated.

sudo apt-get install avahi-utils

avahi-publish -s "Service name" _wiselib._udp 1337

At this point you should be notified on the router that a new node has joined the neighborhood. Kill avahi-publish and see how the node disappears.


Bugs/Patches

The OpenWrt port resides in wiselib.testing/external_interface/openwrt/.

The Zeroconf based neighborhood resides in wiselib.testing/algorithms/neighbor_discovery/echo_avahi.h

Please submit bug reports here https://github.com/rraf/wiselib/issues Pull requests for patches.