Post on 28-Nov-2014
How to get started with WSN
How to install a NesC code on
a MICAz Plateform (Windows XP plateform)
LE SAOUT F. – PLACAIS P.
[24/06/2008]
Sources :
http://sing.stanford.edu/klueska/installing_xubuntos_vm.html : a tinyos tutorial by Klueska slightly modified
[This tutorial provides instructions for installing XubuntOS inside a VMware virtual
machine. Instructions are provided for Windows users. It provides also some tips for use
XubuntOS and install the necessary components for install a NesC code on a MICAz mote by
using a MIB600 interface]
How to get started with WSN
Page 2
Note: You will need to make sure you have administrative rights on your Windows machine
before starting. Otherwise, you will have to get your system administrator to follow these
instructions instead.
OK, let’s get started.....
Contents
1 Windows VMware Server Installation
2 XubunTOS Installation
3 Java JDK Update
4 Connect the MIB600 interface to your computer
5 Installing the “Blink” program
6 Why choose TinyOS 2.x?
7 Some tips for XubuntOS
8 Some links
How to get started with WSN
Page 3
Windows VMware Server Installation
First thing you want to do is get VMware installed and running on your system. So, you will
need a registration key. Obtaining a key is free, so just go to this website
(http://register.vmware.com/content/registration.html) and you’ll receive one.
Write this key down somewhere, you will need it again later at the end of the installation
process.
Now go to the web address found here (http://register.vmware.com/content/eula.html) to
download VMware for windows. Agree to the end user license agreement and then select to
install the binary installer seen below: Once it is downloaded, go ahead and open it up to
start the installation process.
Go ahead and follow all the instructions and choose all the default values to get VMware for
windows installed. Once installed, open it up and follow the instructions found in the next
section to install the actual XubunTOS image into a virtual machine on your PC.
How to get started with WSN
Page 4
XubunTOS Installation
First you need to get a copy of the XubunTOS 2.0 cd image from here
(http://toilers.mines.edu/files-XubunTOS/XubunTOS-2.0.iso). Once you have the image you
can start up VMware and install it into a virtual machine.
Note: Some of the icons look different than below if you installed VMware on a windows machine.
The process for installation is still the same though, just find the icons with the same names
as the ones indicated and you should be fine.
Go ahead and open up VMware following the instructions for your particular operating
system from above. In the window that pops up, choose 'Local Host' and click on connect.
How to get started with WSN
Page 5
Once you have clicked on 'Connect', the following window will open up. Go ahead and click
on 'Create a new virtual machine’.
The following window should now pop up. Go ahead and click on 'Next'.
How to get started with WSN
Page 6
Choose 'Typical' installation and click on 'Next'
How to get started with WSN
Page 7
Now choose your operating system. XubunTOS is based on Ubuntu, so you should choose
the following set of options and click on 'Next'
How to get started with WSN
Page 8
Now give your virtual machine a name. I choose XubunTOS 2, but you can really choose
anything you want. Go ahead and leave the installation location with its default value. This
is where your virtual machine will be installed on your hard disk. If you change this
location, you will have to configure things differently later so that the VMware server can
find your virtual machine installation.
How to get started with WSN
Page 9
Now you need to choose how much space you want reserved for your virtual machine
installation. I have chosen 10 GB, but you may wish to choose more or less depending on
how much TinyOS development works you actually do. Once you select this value, it can't be
changed.
This is all the space your virtual machine will ever be able to use, so choose this value
wisely.
Additionally, you must choose if you want all this space allocated now or if you want the
disk size to increase over time as you add files to you virtual machine. I have chosen to let it
grow as I add more files, but you can choose either option and it should work just fine.
Once you've made your selections click 'Finish'.
How to get started with WSN
Page 10
Now its time to actually install XubunTOS onto your newly created virtual machine. Go
ahead and select 'Edit virtual machine settings'
How to get started with WSN
Page 11
In order to install XubunTOS, you need to tell the virtual machine to boot from the 'iso'
image you downloaded earlier. Go to the 'Hardware' tab, select connection from an ISO
image, and insert the location of the XubunTOS iso image into the field below it. Make sure
the rest of the options are as seen below and then click on 'OK'.
How to get started with WSN
Page 12
Now its time to power on the virtual machine and install XubunTOS. Just click on 'Power on
this virtual machine'
How to get started with WSN
Page 13
Once you power on the virtual machine, it will automatically boot from the XubunTOS cd
image. Click on the Install icon on the desktop, otherwise you will not be able to save your
work under XubuntOS for the next session.
How to get started with WSN
Page 14
Next, just follow the onscreen instructions to install XubunTOS into the virtual machine.
Installation may take a while, but once it is finished, you will want to turn off the virtual
machine and proceed to the next step below.
Once the virtual machine has been powered down, you will need to add configurations to
allow it to access your serial and USB devices in order to communicate with the motes. First
go to 'Edit Virtual Machine Settings' and click on it.
How to get started with WSN
Page 15
Then choose 'Add...'
How to get started with WSN
Page 16
Select 'USB Controller' and press 'Next'
How to get started with WSN
Page 17
Now go ahead and click 'Finish'
How to get started with WSN
Page 18
Now select 'Add..." again
How to get started with WSN
Page 19
And this time choose "Serial Port' and click 'Next'
How to get started with WSN
Page 20
You will want to use the physical serial port on your host, so go ahead a leave it as the
default value and click 'Next'
How to get started with WSN
Page 21
Choose 'Auto Select' from the pop down menu and then click ‘Finish’
How to get started with WSN
Page 22
Verify that both the USB controller and the Serial Port now appear in the menu on the left
and press 'OK'
How to get started with WSN
Page 23
Now go ahead and power on the virtual machine again to start using XubunTOS in VMware.
If you ever close VMware, you can always open the XubunTOS virtual machine again by
choosing to connect from a local host and selecting the XubunTOS virtual machine from the
menu bar on the left.
Note:
To access motes connected over the USB port you will need to manually select each device
for connection after powering up your XubunTOS virtual machine. To do this go to VM-
>Removable Devices->USB Devices and select each USB connected mote you would like to
access.
After this go ahead and log in and you should be good to go!!!!
How to get started with WSN
Page 24
Java JDK Update
Then you must update a Java package called Java Development Kit or “JDK”. These packages
are necessary for the java GUI, used in several applications.
The method for installing is the following one:
Click on « Application/Système/Gestionnaire de parquets Synaptic »
Enter your password and click OK.
How to get started with WSN
Page 25
Then you have the following screen:
Click on “reload”.
How to get started with WSN
Page 26
Click on “search” and type “sun”:
How to get started with WSN
Page 27
Find “sun-java6-jdk” in the list and make a right click on. Choose the option “Mark for
installation”, and “Mark”.
How to get started with WSN
Page 28
Then:
Then click on “Apply” twice. The application downloads and installs the packages. When it’s
done, close the windows “Changes applied”.
Your system is now ready.
How to get started with WSN
Page 29
Connect the MIB600 interface to your computer
MICAz mote
MIB600 Board
How to get started with WSN
Page 30
A MICAz mote plug on a MIB600 interface boar, with a rj45 connection and power supply
Link the MIB600 to your computer (or to your local network) with a classical RJ45 cable.
Switch off the MICAz power supply (black switch on the MICAz board) and power on the
MIB600 board.
For using the MIB600 gateway, you must know its IP. To find this, use the software “Device
Installer”, created by Lantronix.
You can find it on the Lantronix website : http://ltxfaq.custhelp.com/cgi-
bin/ltxfaq.cfg/php/enduser/std_adp.php?p_faqid=644
Download it and install it on Windows.
MICAz Mote
5V Power Supply
RJ45 cable
MIB 600 Board
How to get started with WSN
Page 31
Then, launch Device Installer and click on the icon “Search”:
The software will find the MIB600 under the name UDS-10/Cobox 5.X:
As you can see on the example, the UDS-10/Cobox 5.X must be Online.
How to get started with WSN
Page 32
Then you should take note of this IP.
How to get started with WSN
Page 33
Now, open Firefox and type the MIB600’s IP in the Firefox address bar:
How to get started with WSN
Page 34
Now you can test the connection between your computer and the MIB600 board by using
Firefox under XubuntOS. It may have some trouble with the RJ45 connection and this
operation is a way to verify the good functioning of the system.
So, open Firefox and type the MIB600 IP in the address bar:
If you are able to see as above the configuration page of the device, it means that the
connection between the computer and the MIB600 is successful.
(Else check if the IP address of the MIB600 is correct (e.g. try ping “IP address) and reboot
XubuntOS. )
How to get started with WSN
Page 35
Using XubuntOS Terminal
Start XubuntOS, and loggin.
How to get started with WSN
Page 36
When you are logged, launch the Terminal.
There is two TinyOS version installed on XubuntOS. You can choose both by using the
command “tos1” for use tinyOS 1.x or “tos2” for use tinyOS 2.x.
For this example, we are using tinyOS 2.x and a test program called “Blink”.
How to get started with WSN
Page 37
So type in the terminal:
tos2
Then go to opt/tinyos-2.x/apps/Blink by typing:
cd /opt/tinyos-2.x/apps/Blink
Now you can type the charging command to program the MICAz mote with the Blink NesC
code:
make micaz install eprb,160.98.21.198
Note: Make sure you are using the IP of your “eprb” MIB600.
“eprb” : Ethernet Programming board
How to get started with WSN
Page 38
So you can see:
Now you can see your MICAz mote leds blinking. The Blink code is now charging on your
mote.
How to get started with WSN
Page 39
Why choose TinyOS 2.x?
We have decided to use TinyOS 2.x for a simple reason: the development of TinyOS 1.x is
stopped, so, there is no support for this version nowadays.
Moreover the TinyOS 1.x graphical visualization tool called TinyViz is really nonfunctional,
it’s probably the reason why we won’t able to use it and surely why it isn’t be present on the
second version of TinyOS. Another reason is the relative incompatibility between the NesC
codes for TinyOS 1.x and 2.x and the real optimization realized with TinyOS 2.x.
If you want more precisions on these evolutions, see:
http://www.tinyos.net/tinyos-2.x/doc/html/overview.html
How to get started with WSN
Page 40
Some tips for XubuntOS
• The first thing you must do is to read all the lessons available at this address: :
http://docs.tinyos.net/index.php/TinyOS_Tutorials
• Once you are in the window XubuntOS of VMWare, you can come back under
Windows by using keys “Ctrl + Alt” (look in the down corner on the left).
• You can also use the keys “Ctrl + Alt + Enter” to switch between the VMWare
interface on Windows and the full screen of XunbuntOS.
• When you want to exit from XubuntOS, use the classical method (Quit icon> Shut
down) to avoid some problems like the loss of peripherals in the next session. Never stop XubuntOS by using the red square of VMWare.
How to get started with WSN
Page 41
Some links:
http://www.tinyos.net/
All the documentation you need is on the XubuntOS desktop when its installation is
completed.