Professional Documents
Culture Documents
Work Group (WG) from IETF called 6LowPAN created to develop an energy aware adaptation model for the integration of IPv6 packets over Low Power Wireless Personal Area Networks (LowPANs), and released two RFC RFC4919 and RFC4944 . There already 3 implementations for 6LowPAN which are: 1- 6Lowpancli (tinyos-2.1.0/apps/6lowpancli/README) 2- Blowpan (BLIP) 3- SICSlowpan 6Lowpancli and Blowpan (BLIP) implemented for TinyOS-2.x . SICSlowpan implemented for ContikiOS , there is comparison between them:
Installation of TinyOS-2.1.1:
( I will use Ubuntu-11.04 in VMware workstation. Set network adapter on NAT and chick internet connection) Open Terminal to edit sources.list file sudo gedit /etc/apt/sources.list add this line into the end of the file opened deb http://tinyos.stanford.edu/tinyos/dists/ubuntu karmic main karmic for all type of ubuntu distribution. Install aptitude package sudo apt-get install uptitude Install autoconf package sudo apt-get install autoconf2.13 Then type this command to install TinyOS-2.1.1 sudo aptitude install tinyos-2.1.1 Also you can install TinyOs-2.1.1 using Synaptic Package Manager after add deb http://tinyos.stanford.edu/tinyos/dists/ubuntu karmic main in setting->Repositories>Other Software, and then use search to find tinyos-2.1.1 and click on it and install it. Now change the owner of the folder tinyos-2.1.1/ sudo chown R username:group /opt/tinyos-2.1.1/ (change username by your user name, and group by user names group). Before to be ready to use tinyos-2.1.1 you should configure some environment variables sudo gedit /opt/tinyos-2.1.1/tinyos.sh add /tinyos.jar to the end of CLASSPATH to be like this : CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar Also edit user bash file as following: sudo gedit ~/.bashrc and add this line to the end of the file source /opt/tinyos-2.1.1/tinyos.sh If you find any terrible with java then install openjdk-6-jre-headless sudo apt-get install openjdk-6-jre-headless
If everything is okay then you can go ahead and test BLIP as it shown below.
Test BLIP:
Commissioning a simple blip subnetwork is not complicated. Here are the steps:
1- Add an 802.15.4 interface to the device (Edge router). 2- Install your program image on the motes (node router) 3- Compile and run the routing driver.
Note: Make sure that mote is defined, you can use this command to chick ls /dev/. Usually mote port is ttyUSB0 or ttyUSB1. Also you should note that mib520/510 programming board defines two ports ttyUSB0 -programming port- and ttyUSB1 communication port- so you should be careful on the port No. You dont need to determine port for telosb platform.
Now connect the edge router mote (which you installed IPBaseStation image on it) and let us assume it was micaz. Then run routing driver: While you are still in the $TOSROOT/support/sdk/c/blip directory run this command sudo driver/ip-driver /dev/ttyUSB1 micaz Note: Routing driver communicate with communication port /dev/ttyUSB1 not programming port /dev/ttyUSB0. If you see output like this, then everything is okay.
The numbers you see at the last two lines are the node id which are running while you run the command. Ping each node connected to edge router (sink) using ipv6 fec0::ID so open new terminal and type these commands : ping6 fec0::4
call Echo.bind(7); // open port on port 7 and start listening } event void RadioControl.startDone(error_t e) { } event void RadioControl.stopDone(error_t e) { } event void Echo.recvfrom(struct sockaddr_in6 *from, void *data, uint16_t len, struct ip_metadata *meta) { call Echo.sendto(from, data, len); // return the same message payload to the sender (ECHO) call Leds.led0Toggle(); } } SimpleUDPEchoC.nc file: configuration SimpleUDPEchoC { } implementation { components MainC, LedsC; components SimpleUDPEchoP; UDPEchoP.Boot -> MainC; UDPEchoP.Leds -> LedsC; components IPDispatchC; UDPEchoP.RadioControl -> IPDispatchC; components new UdpSocketC() as Echo; UDPEchoP.Echo -> Echo; } Makefile: COMPONENT=SimpleUDPEchoC CFLAGS += -DCC2420_DEF_CHANNEL=15 CFLAGS += -DRF230_DEF_CHANNEL=15 CFLAGS += -DIEEE154FRAMES_ENABLED include $(MAKERULES) Note: Usage: 1. Install IPBaseStation into edge router (mote) 2. Install SimpleUDPEcho in another mote 3. Run routing driver If you change channel in $TOSROOT/support/sdk/c/blip/serial_tun.conf you should change it here in Makefile as well. You can just bind one port .
4. Open terminal and connect with SimpleUDPEcho nc6 u fec0::4 7 assuming you installed SimpleUDPecho on node 4, 7 is the port number.
Tinyos-2.1.1 Troubleshooting :
-
If you try to run make micaz and it gives you a long error message starting with: Inttypes.h or stddef.h: No such file or directory I faced this error and tried a lot to fixed c library/build-essential with no avail, the solution was install tinyos-2.1.1 using aptitude from http://tinyos.stanford.edu/tinyos/dists/ubuntu instead of http://hinrg.cs.jhu.edu/tinyos and everything was okay. If you try to run make <platform> and it gives you an error in permission permission denied , then change the owner of the folder as it is explained in installation steps. Also if you find any installation problem especially in msp430 or avr packages as I found- then you may need to try to install tinyos-2.1.1 using installation steps above.
If you faced any troubles with this tutorial please feedback me: Alshaboti_it@yahoo.com
Further Reading :
http://docs.tinyos.net/tinywiki/index.php/BLIP_Tutorial http://docs.tinyos.net/tinywiki/index.php/Installing_TinyOS_2.1.1 http://tools.ietf.org/html/rfc4944 Evaluating 6lowPAN implementations in WSNs byRicardo Silva, Jorge S Silva and Fernando Boavida, Department of Informatics Engineering, University of Coimbra Installation of blip under Ubuntu 10.04.pdf