Back in December ZipIts were selling for $9.99 on amazon.  It seemed like way too good a deal to be true, but I couldn’t resist the urge to get one, they have so many features that interest me.  I figured it was worth the risk.  I received the ZipIt, installed Linux, and tested out the hardware.  Impressed as I was, I ordered 10 more.  One of the primary reasons for acquiring  this many ZipIts was to set up and experiment with a mesh network.  I’m not disappointed, the value of my Zipits went way up this past weekend!  This post describes the steps for configuring the ZipIt as a node on a mesh network.

As of Linux kernel 2.6.38 the batman-adv kernel module is in mainline.  Using buildroot I configured and built the kernel to include the module.  I cross-compiled the user land utility batctrl and installed it to the /usr/sbin directory of Z2Lite.

To set up a mesh network node, boot Z2Lite and issue the following commands.  I put them in a script file and assigned the script to a key in tmux.conf.  Be sure to kill the wpa-supplicant process if it’s running.

z2lite:~# modprobe batman-adv

z2lite:~# ifconfig wlan0 down

z2lite:~# ifconfig wlan0 mtu 1476
z2lite:~# iwconfig wlan0 mode ad-hoc
z2lite:~# iwconfig wlan0 essid zipit ap 02:1A:34:56:78:9A channel 1

z2lite:~# batctl if add wlan0

z2lite:~# ifconfig bat0 192.168.11.219
z2lite:~# ifconfig wlan0 up
z2lite:~# ifconfig bat0 up

Assign a unique AP mac address for each node (i.e. ZipIt) and choose a channel that best suits your environment.  That’s it, everything else is just like other IP networks, ping, ssh etc.  The batctl utility has a few commands for troubleshooting the network if you have issues.  I haven’t had time to experiment yet, but the first is going to be location triangulation.  I think it’s built into the protocol.

 

http://www.open-mesh.org/

http://hostwork.com/users/matt/zipitz2/

These are the steps for setting up a toolchain and SDK to cross compile GNU Linux for the Beagleboard ver. C4 (OMAP 3530).  The host is Ubuntu 10.04.  The toolchain is then used to cross compile the Codelite package.

Toolchain

Start by making a filesystem and SDK with Narcissus.  Be sure to include the option for the toolchain and X11 with xfce4.  Save and extract the SDK to the root / of the partition.
mark@ubuntu:~$ cd /
mark@ubuntu:/$ sudo tar -xfv /home/mark/Downloads/angstrom-SDK.tar.gz

This should create the folders:
/usr/local/angstrom/…
/var/lib/opkg/…

I made the following changes to the environment-setup script located in /usr/local/angstrom/arm/../environment-setup

-export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}pkgconfig
+export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS/usr/lib/pkgconfig

alias gcc=”arm-angstrom-linux-gnueabi-gcc”
alias g++=”arm-angstrom-linux-gnueabi-g++”
alias as=”arm-angstrom-linux-gnueabi-as”
alias strip=”arm-angstrom-linux-gnueabi-strip”
alias ld=”arm-angstrom-linux-gnueabi-ld”

CORE_NUM=`cat /proc/cpuinfo | grep processor | wc -l`
alias make=”make -j$CORE_NUM”

Beagleboard rootfs install

Save the file system tar.gz that Narcissus generated and untar it to the SD partition.  There are a number of ways to boot the Beagleboard and the particulars of this step are not included.  Once Angstrom has booted, login as root and issue the following commands.

root:~# opkg install angstrom-x11-base-depends
root:~# startxfce4

Cross Compiling

The Codelite project requires the wxWidgets GTK libraries.
Get the wxWidgets source package from http://www.wxwidgets.org/downloads/
Untar and cd to the root of the wxWidgets folder

Prepare the shell for cross compiling by running the environment-setup script.  Don’t forget the period before /usr/…

wxWidgets-2.9.1$ . /usr/local/angstrom/arm/environment-setup
wxWidgets-2.9.1$ opkg-target update
wxWidgets-2.9.1$ mkdir build_gtk
wxWidgets-2.9.1$ cd build_gtk

Build wxWidgets with the Narcissus SDK:

build_gtk$ ../configure –enable-unicode –enable-debug –host=arm-angstrom-linux-gnueabi –with-gtk
build_gtk$ make -j2
build_gtk$ sudo make install

Build Codelite with Narcissus SDK:
Downloads$ svn co https://codelite.svn.sourceforge.net/svnroot/codelite/trunk codelite
Downloads$ cd codelite/
codelite$ ./configure –host=arm-angstrom-linux-gnueabi
codelite$ make -j2

Install on Beagleboard

Copy the wxWidgets libraries labled ‘libwx_xxx_xxxx.so’ to /usr/local/lib/ of the Beagleboard rootfs.  Also copy the codelite folder to a location on the Beagleboards rootfs.

Boot the Beagleboard and issue the following commands as root user.
root:~# echo “/usr/local/lib” >> /etc/ld.so.conf
root:~# ldconfig

You can either edit the Makefile and change the paths or delete it and reconfigure a new one.  I think it still needs to be edited even after a reconfigure iirc.

root:~# cd codelite

root:~/codelite# ./configure
root:~/codelite# make install

Codelite should now be up and running on the Beagleboard.

 

Links:

http://narcissus.angstrom-distribution.org/

http://prdownloads.sourceforge.net/wxwindows/wxWidgets-2.8.12.tar.gz

http://www.wxwidgets.org/downloads/

http://codelite.org/

 

© 2016 engine12