How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit ...

6
1 How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit using VirtualBox 5.1.26 This guides explain the installation of TinyOS version 2.1.1 on Ubuntu by using VirtualBox virtualization. The installation lets one to compile and run tinyos on telosb and micaz motes. On top of that, it lets one to simulate wsn sensor motes on micaz platform. 1. Download and install Ubuntu 14.04.5-LTS 32-bit iso from http://releases.ubuntu.com/14.04/ 2. Download and install VirtualBox from https://www.virtualbox.org/wiki/Downloads 3. Download and install VirtualBox Extension Pack from https://www.virtualbox.org/wiki/Downloads 4. Install Ubuntu in VirtualBox. Update the installed Ubuntu kernel to the latest release using ‘Software Updater’ manager in Ubuntu. Link from http://askubuntu.com/questions/142549/how-to-install-ubuntu-on-virtualbox gives a good guide on how to do this. 5. Share folder between the host (computer where the virtualbox is installed: in this case Windows) and the guest (the virtual machine: in this case Ubuntu). The following steps enable one to do this: a. In Windows, set permission to share the intended folder to be shared. This can be done by: Right click on the folder to be shared (Windows Explorer) → Share with → Specific people b. On Ubuntu VM, click: Shared folder → Adds new shared folder (folder with the plus sign icon). Then choose the folder in Windows you would want to give share.

Transcript of How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit ...

Page 1: How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit ...

1

How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit using VirtualBox 5.1.26 This guides explain the installation of TinyOS version 2.1.1 on Ubuntu by using VirtualBox virtualization. The installation lets one to compile and run tinyos on telosb and micaz motes. On top of that, it lets one to simulate wsn sensor motes on micaz platform. 1. Download and install Ubuntu 14.04.5-LTS 32-bit iso from http://releases.ubuntu.com/14.04/ 2. Download and install VirtualBox from https://www.virtualbox.org/wiki/Downloads 3. Download and install VirtualBox Extension Pack from

https://www.virtualbox.org/wiki/Downloads 4. Install Ubuntu in VirtualBox. Update the installed Ubuntu kernel to the latest release using

‘Software Updater’ manager in Ubuntu. Link from http://askubuntu.com/questions/142549/how-to-install-ubuntu-on-virtualbox gives a good guide on how to do this.

5. Share folder between the host (computer where the virtualbox is installed: in this case Windows)

and the guest (the virtual machine: in this case Ubuntu). The following steps enable one to do this:

a. In Windows, set permission to share the intended folder to be shared. This can be done

by: Right click on the folder to be shared (Windows Explorer) → Share with → Specific people

b. On Ubuntu VM, click: Shared folder → Adds new shared folder (folder with the plus sign icon). Then choose the folder in Windows you would want to give share.

Page 2: How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit ...

2

c. While running the Ubuntu VM, install VirtualBox ‘Guest Additions’ tool by clicking:

Devices → Insert Guest Additions CD Image. Then, restart the Ubuntu guest VM.

d. Add user (your Ubuntu user) in the Ubuntu VM to be included in the ‘vboxsf’ group.

Launch ‘Terminal’ in Ubuntu and issues these commands: $sudo adduser username vboxsf … where username is your user name in ubuntu. Restart Ubuntu guest VM.

Page 3: How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit ...

3

e. Click the ‘File Explorer’ in Ubuntu desktop IDE. You should be able to see the shared folder and gain access to it.

In ‘Terminal’ you can access the shared folder under ‘media’ folder in root directory.

6. Install supported packages $sudo apt-get install openjdk-7* $sudo apt-get install build-essential $sudo apt-get install python-dev

Page 4: How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit ...

4

$sudo apt-get install python-setuptools $sudo apt-get install python-doc $sudo apt-get install python-docutils $sudo apt-get install swig $sudo apt-get install perl $sudo apt-get install bison $sudo apt-get install graphviz 7. Install all (dependings on the toolchain you need) the below AVR, MSP430, and TinyOS packages and tools - all AVR and MSP430 packages are downloadable from: 1. http://tinyos.stanford.edu/tinyos/dists/ubuntu/pool/main/ 2. http://tinyos.stanford.edu/tinyos/dists/ubuntu/full-listing/i386 3. http://tinyos.stanford.edu/tinyos/dists/ubuntu/full-listing/all - use command: $sudo dpkg -i <package-name.deb> AVR tinyos-base_2.1-20080806_all.deb avr-tinyos-base_2.1-20080806_all.deb avr-binutils-tinyos_2.17-20110726_i386.deb avr-gcc-tinyos_4.1.2-20110803_i386.deb avr-libc-tinyos_1.6.7-20110726_i386.deb avrdude-tinyos_5.10-20110819_i386.deb avr-tinyos_2.1-20080806_all.deb avr-optional-tinyos_2.1-20090326_all.deb MSP430 msp430-tinyos-base_2.1-20080806_all.deb msp430-binutils-tinyos_2.17-20080806_i386.deb msp430-gcc-tinyos_3.2.3-20080806_i386.deb msp430-libc-tinyos_20060801cvs-20080806_i386.deb msp430-tinyos_2.1-20080806_all.deb msp430-optional-tinyos_2.1-20090326_all.deb TinyOS Tools nesc_1.3.4-20120709_i386.deb tinyos-tools_1.4.2-20120808_i386.deb deputy-tinyos_1.1-20080807_i386.deb tinyos-required-msp430_2.1-20090326_all.deb tinyos-required-avr_2.1-20090326_all.deb

Page 5: How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit ...

5

tinyos-required-all_2.1-20090326_all.deb tinyos-2.1.1_2.1.1-20100401_all.deb 8. Change owner of the installed TinyOS folder. - $cd /opt - $sudo chown -R user:user tinyos-2.1.1 9. Change permission to all of the installed TinyOS folfer. - $sudo chmod -R 755 tinyos-2.1.1 10. Set path. a. Create tinyos.sh file (if doesn't exist) in /opt/tinyos-2.1.1 and add these lines: #! /usr/bin/env bash # Here we setup the environment variables needed by the tinyo make system echo "TinyOS source: /opt/tinyos-2.1.1" export TOSROOT= export TOSDIR= export MAKERULES= TOSROOT="/opt/tinyos-2.1.1" TOSDIR="$TOSROOT/tos" CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java:.:$TOSROOT/support/sdk/java/tinyos.jar PYTHONPATH=.:$TOSROOT/support/sdk/python:$PYTHONPATH MAKERULES="$TOSROOT/support/make/Makerules" export TOSROOT export TOSDIR export PYTHONPATH export CLASSPATH export MAKERULES b. Add these lines in .bashrc profile: $cd $sudo gedit .bashrc source /opt/tinyos-2.1.1/tinyos.sh export PYTHONPATH=.:$PYTHONPATH:$TOSROOT/support/sdk/python export PATH=$TOSROOT/support/sdk/c:$PATH … restart the terminal

Page 6: How to Install TinyOS 2.1.1 on Ubuntu 14.04.5-LTS 32-bit ...

6

11. Change python version in /opt/tinyos-2.1.1/support/make/sim.extra to 2.7 (depends on your python version) Update the version at the line: "PYTHON_VERSION=2.7" 12. Exit terminal, open new terminal, and check the tinyos installation $tos-check-env 13. Install java jni $sudo tos-install-jni 14. Compile TinyOS code in telosb platform $/opt/tinyos-2.1.1/apps/Blink/make telosb 15. Run TinyOs code in telosb mote - connect TelosB mote to the USB port of the machine $motelist $sudo chmod 777 /dev/ttyUSBx ('x' is the detected USB port) $make telosb install,1 bsl,/dev/ttyUSBx 16. Compile TinyOS code in micaz platform $/opt/tinyos-2.1.1/apps/Blink/make micaz 17. Simulate TinyOS code in micaz platform $/opt/tinyos-2.1.1/apps/Blink/make micaz sim ---------------------------------------------------------------------------------------------------------------- Yusnaidi MD Yusof Universiti Teknologi Malaysia, Kuala Lumpur. [email protected]