I'm trying to figure out how to enable zeroconfig DNS-SD on my leopard board based IP Camera (AKA Bonjour style announcement of services). The RR SDK includes HOWL and Avahi libraries but I don't fully understand how to use either of them.
With respect to HOWL this appears to be a dead project and I can't find any documentation on it's API's or anything.
Avahi does seem to be up to date and even a good match for Bonjour, however by default the RR SDK only builds the avahi-core and avahi-common libraries which suggests to me that I'd have to write my own application to publish my service. This seems odd considering that the avahi project includes a daemon and lots of helper utilities to get the job done.
I've managed to get the Avahi daemon to build and install but I can't get the client utilites to build, in particular I want the avahi-publish utility which will allow me to publish my service. The problem is the Avahi-utilities depend on the dbus library which shouldn't be a big deal since that is already built by the RR SDK however the automake make script keeps failing to find the 'libdbus-1.so.3' file even though it's right there in the $DEVDIR/fs/fs/usr/lib directory and near as I can tell gcc is given the correct path library paths to find it. The make command that is failing is:
arm-none-linux-gnueabi-gcc -I../../src "-DDEBUG_TRAP=__asm__(\"int \$3\")" -Wall -O2 -mcpu=arm926ej-s -I/home/dev/builds/eval/RR-SDK-368-EVAL2011Q2/fs/fsdev/usr/include -I/home/dev/builds/eval/RR-SDK-368-EVAL2011Q2/fs/fsdev/include -std=c99 -Wall -W -Wextra -pedantic -pipe -Wformat -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -fPIC -o .libs/avahi-browse avahi_browse-avahi-browse.o avahi_browse-sigint.o -L/home/dev/builds/eval/RR-SDK-368-EVAL2011Q2/fs/fsdev/usr/lib -L/home/dev/builds/eval/RR-SDK-368-EVAL2011Q2/fs/fsdev/lib ../avahi-client/.libs/libavahi-client.so ../avahi-common/.libs/libavahi-common.so
And the error is
/opt/codesourcery/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: warning: libdbus-1.so.3, needed by ../avahi-client/.libs/libavahi-client.so, not found (try using -rpath or -rpath-link)
Has anyone else gone down the path of zeroconfig and gotten anything to work?
Many thanks to anyone that can help me out.
Some follow up, I did some more research into the Avahi library and discovered that I probably don't need the publish utility as the daemon is configured to publish some static services that are described in xml files placed in a configuration directory (usually something like /usr/etc/avahi)
However that directory is hard coded into the avahi-daemon executable and it is determined by the --prefix parameter give to the configure script, and the RR SDK sets the --prefix parameter to a location on the build system (something like $DEVDIR/fs/fsdev/usr) and therefore the daemon will never find the configuration files.
It appears that what should be done is the --prefix parameter should not be used and instead the DESTDIR variable should be set when make install is run (e.g. make DESTDIR=$DEVDIR/fs/fsdev/usr install) but so far I haven't figured out how to express this in the RR SDK build framework.
If anyone can help me I'd really appreciate it.
A final update:
Ok I got this more or less working.
The avahi-daemon handles the mDNS-SD stuff and builds just fine for the LeopardBoard (without the DBUS support, not sure why DBUS wouldn't link but it wasn't important to me), which is just fine if you don't need to dynamically publish and browse for services on the device. The daemon is built with hard coded paths to it's configuration files, namely avahi-daemon.conf, and a services directory which has xml files that specify what services the daemon should publish, the path is determined by the following options to the autotools configure script:
--perfix, --sysconfdir, --localstatedir, etc.
The RR SDK makefile for this package was using the --prefix option to stage the software in the $(FSDEVDIR)/usr directory and this was causing the binaries to have messed up paths. Turns out RR and autotools has solution for this and that is the DESTDIR variable which uses a different mechanism to stage the files appropriately. Once I found this it was easy to get everything built, staged and installed in my devices file system.
I also created a service startup script to start it up via the rc.d mechanism, and called it out in the Makefile with the INIT_SCRIPT, and INIT_SCRIPT_LEVEL parameters.
The avahi package also includes avahi-autoipd daemon for handling Link Local address assignment and the avahi-dnsconfd daemon for linking all this to unicast DNS services. So far I've tested the avahi-autoipd service and it appears to work as advertised. I haven't setup an init script for it yet as the RR SDK Makefile structure doesn't appear to handle multiple daemon init's per package.
Here is my modified Makefile for the avahi software package:
I hope this helps somebody else, someday.