SlideShare a Scribd company logo
TinyOS Manual For Beginners in Linux
(Ubuntu)
Ankit Singh
FH Frankfurt am Main
February 10, 2011
Contents
1 TinyOS Installation Guide for Beginners 2
1.1 Procedure for Installation and configuring TinyOS . . . . . . 2
1.1.1 Installation of TinyOS (Source tinyos.net) . . . . . . . 2
1.1.2 Configuration of TinyOS . . . . . . . . . . . . . . . . . 3
1.1.3 Confirming the correct configuration of the Tinyos . . 4
1.1.4 Connecting Motes & pushing modules to Motes . . . . 4
1.1.5 Setting Up Environment for Mote Listener . . . . . . 6
1.2 Compiling and Pushing Sensor board specific Application . . 7
1.2.1 Compile Module . . . . . . . . . . . . . . . . . . . . . 7
1.2.2 To Push it to the Motes . . . . . . . . . . . . . . . . . 7
1.2.3 Running GUI in For Base Station . . . . . . . . . . . 7
1
Chapter 1
TinyOS Installation Guide
for Beginners
1.1 Procedure for Installation and configuring TinyOS
1.1.1 Installation of TinyOS (Source tinyos.net)
In Ubuntu operating system open following file:
System → Administration → Synaptic Package Manager
After Synaptic Package Manager get open goto:
Settings → Repositories → Other software → (Press) Add
After pressing Add button, Please enter the following line to add the tinyOS
repositories:
deb http://tinyos.stanford.edu/tinyos/dists/ubuntu <distribution> main
Distribution is the distribution name of the Ubuntu. If you do not know
the distribution name then please follow the steps to know your Ubuntu
Distribution:
Type the the folllowing command on your linux command line:
ankit@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1
LTS Release: 10.04
Codename: lucid
You will get some output like the above. The Codename: lucid is my dis-
tribution name. So, Just use the name which shows to you.
2
After you inserted the above line in the add pop-up then press close. The
linux will ask your permission to update the repositories. Just close it and
it will automatically do it.
Now, there is a option called Quick Search: Please enter tinyos as search
key. You can see some result on it. Choose tinyos-2.1.1.
Then press Apply button in Synaptic Package Manager.
It will install tinyos for you.
1.1.2 Configuration of TinyOS
Open Terminal in Ubuntu
You need to source the tinyos.sh (shell script) in bashrc. Type the following
command:
ankit@ubuntu:~$ sudo gedit .bashrc
The .bashrc file will be open after hitting enter
Then copy & paste the following lines after the first syntax lines:
#Sourcing the tinyos environment variable setup script
source /opt/tinyos-2.1.1/tinyos.sh
After that, save & exit.
Change the owner ship of the tinyos directory
Change directory to: (use the following command)
ankit@ubuntu:~$cd /opt/
ankit@ubuntu:~$sudo Chown -R ankit:ankit tinyos-2.1.1/
Note: use your home folder name given before ’@’ sign - Add path to
tinyos.jar file in tinyos.sh
ankit@ubuntu:~$cd /opt/tinyos-2.1.1
ankit@ubuntu:/opt/tinyos-2.1.1$sudo gedit tinyos.sh
Add the following line just after the end of the CLASSPATH:
:$TOSROOT/support/sdk/java/tinyos.jar:.
The line should look like:
CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java:
$TOSROOT/support/sdk/java/tinyos.jar:.
3
1.1.3 Confirming the correct configuration of the Tinyos
Change directory to:
ankit@ubuntu:~$cd /opt/tinyos-2.1.1/apps/Blink
Type the make command for the module Blink
ankit@ubuntu:/opt/tinyos-2.1.1/apps/Blink$ make micaz
You should see the output like this:
mkdir -p build/micaz
compiling BlinkAppC to a micaz binary
ncc -o build/micaz/main.exe -Os -fnesc-separator=__ -Wall -Wshadow -Wnesc-all
-target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=
0x22 --param max-inline-insns-single=100000 -DIDENT_APPNAME="BlinkAppC" -
DIDENT_USERNAME="ankit" -DIDENT_HOSTNAME="ubuntu" -
DIDENT_USERHASH=0x1bba31edL
-DIDENT_TIMESTAMP=0x4cec121eL -DIDENT_UIDHASH=0x92b330deL -fnesc- dump=wiring -
fnesc-dump=’interfaces(!abstract())’ -fnesc- dump=’referenced(interfacedefs,
components)’ -fnesc- dumpfile=build/micaz/wiring-check.xml BlinkAppC.nc -lm
compiled BlinkAppC to build/micaz/main.exe
2052 bytes in ROM
51 bytes in RAM
avr-objcopy --output-target=srec build/micaz/main.exe
build/micaz/main.srec avr-objcopy --output-target=ihex
build/micaz/main.exe build/micaz/main.ihex
writing TOS image
If you are able to see ’writing TOS’ image at end then you have successfully
configured the Tinyos.
1.1.4 Connecting Motes & pushing modules to Motes
Every time you connect a new mote to the serial-based programming board
, you have to again setup & configure the network address of the program-
ming board and system. So, to make life easy, I wrote a shell script.
All SHELL SCRIPTS tools can be found in MicazXpl project repositories.
Following are the shell script for configuring network
ankit@ubuntu:~$sudo gedit /bin/runMoteSetup.sh
#!/bin/sh
sudo ifconfig eth0 10.5.5.1
4
sudo arp -s 10.5.5.5 00204A13E829
netcat 10.5.5.5 1
netcat 10.5.5.5 9999
NOTE: 00204A13E829 is the MAC address of my serial-based programming
board. You need to put your own MAC address finding on the board.
This will save the shell script in /bin folder which will make this shell script
accessible from any folder or path. Don’t forget to make the shell script to
executable file by using the following command.
ankit@ubuntu:~$sudo chmod +x /bin/runMoteSetup.sh
ankit@ubuntu:~$ runMoteSetup.sh
??#??#
*** Lantronix Universal Device Server ***
Serial Number 1359433 MAC address 00204A13E829
Software version V5.8.0.1 (041112) LTX
Press Enter for Setup Mode
Now, The shell script to push the modules to the Motes:
ankit@ubuntu:~$sudo gedit /bin/pushToMotes.sh
#!/bin/sh
## For comiling Data And pushing it in the Mote
make micaz install eprb,10.5.5.5
For making the above shell script executable.
ankit@ubuntu:~$sudo chmod +x /bin/pushToMotes.sh
ankit@ubuntu:/opt/tinyos-2.1.1/apps/Blink$ pushToMotes.sh mkdir -p build/micaz
compiling BlinkAppC to a micaz binary ncc -o build/micaz/main.exe -Os
-fnesc-separator=__ -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=
build/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=0x22
--param max-inline-insns-single=100000 -DIDENT_APPNAME="BlinkAppC" -
DIDENT_USERNAME="ankit" -DIDENT_HOSTNAME="ubuntu" -
DIDENT_USERHASH=0x1bba31edL -DIDENT_TIMESTAMP=0x4ceef6c4L -
DIDENT_UIDHASH=0x44161342L -fnesc- dump=wiring -fnesc-dump=’interfaces(!abstract())’
fnesc- dump=’referenced(interfacedefs, components)’ -fnesc- dumpfile=build/
micaz/wiring-check.xml BlinkAppC.nc -lm
compiled BlinkAppC to build/micaz/main.exe
2052 bytes in ROM
51 bytes in RAM
5
avr-objcopy --output-target=srec build/micaz/main.exe
build/micaz/main.srec avr-objcopy --output-target=ihex build/micaz/main.exe
build/micaz/main.ihex
writing TOS image
cp build/micaz/main.srec build/micaz/main.srec.out
installing micaz binary using eprb uisp -dprog=stk500 -dhost=10.5.5.5
--wr_fuse_h=0xd9 -
dpart=ATmega128 --wr_fuse_e=ff --erase --upload if=build/micaz/main.srec.out
--verify Firmware Version: 1.7 Atmel AVR ATmega128 is found.
Uploading: flash
Verifying: flash
Fuse High Byte set to 0xd9
Fuse Extended Byte set to 0xff 
rm -f build/micaz/main.exe.out build/micaz/main.srec.out
1.1.5 Setting Up Environment for Mote Listener
Mote Listner is used to read the data broadcasted by motes in the network
and saves to the output file. Following are the commands for listening:
java net.tinyos.tools.Listen -comm network@10.5.5.5:10002
It is supposed to be serial communication but in our case, we are us-
ing TCP/IP connection. That is why we are using ”network@IP:PORT” in
above command.
You can also go through the java source for getting more details on number
of options available for your type of connection to your PC:
ankit@ubuntu:/opt/tinyos-2.1.1/support/sdk/java/net/tinyos$
vim packet/BuildSource.java
You can export the MOTECOM for not always passing option -comm
export MOTECOM=network@10.5.5.5:10002
Then run java listner without -comm parameter
ankit@ubuntu:/opt/tinyos-2.1.1/apps/tests/TestSerial$
java net.tinyos.tools.Listen
6
1.2 Compiling and Pushing Sensor board specific
Application
We are going to take example of Oscilloscope application given with TinyOS
package.
Application Path is :
/opt/tinyos-2.1.1/apps/Oscilloscope/
1.2.1 Compile Module
To Compile this Module, You need to provide Sensor board type. In our
Case its: mts300.
Type the following command on your linux console.
SENSORBOARD=mts300 make micaz
1.2.2 To Push it to the Motes
Type the following command on your linux console using your variables into
the syntax bracket.
make micaz reinstall eprb,<Node-ID> <IP-Adr>
Node-ID: Mote ID you want to set like Mode ID 1 or 2 or anything
IP-Adr: IP address of the Motes
1.2.3 Running GUI in For Base Station
Goto to Java folder of Oscilloscope:
/opt/tinyos-2.1.1/apps/Oscilloscope/java/
Setting Environment variable for motes communication:
export MOTECOM=network@10.5.5.5:10002
Then RUN the Java Application:
ankit@ubuntu:/opt/tinyos-2.1.1/apps/Oscilloscope-Mic/java$./run
Hope it will be helpful for you to get started!!! Thank You!!
7

More Related Content

PDF
Intoduction to TinyOS, nesC and TOSSIM
PPT
cellular automata as a test pattern generator and output response compactor f...
PDF
Energy Efficient Wireless Communications
PDF
SOC Application Studies: Image Compression
PPSX
System on chip architectures
PDF
NGFI (Next Generation Fronthaul Interface) native RoE (Radio over Ethernet)
 
PPTX
Energy consumption of wsn
PPTX
VLSI Design-Lecture2 introduction to ic technology
Intoduction to TinyOS, nesC and TOSSIM
cellular automata as a test pattern generator and output response compactor f...
Energy Efficient Wireless Communications
SOC Application Studies: Image Compression
System on chip architectures
NGFI (Next Generation Fronthaul Interface) native RoE (Radio over Ethernet)
 
Energy consumption of wsn
VLSI Design-Lecture2 introduction to ic technology

What's hot (20)

PDF
VoLTE optimization.pdf
PPTX
pptudsy.pptx
PPTX
2 g data performance dimensioning ,planning & optimization
PPT
Wcdma umts wireless networks
PDF
3g umts-terminating-call
PPT
Gb over ip
PPT
Abis Over IP/Abis Optimization on-site Workshop
PPT
Redes de Computadores - Modulo 1
PPT
Multiple acces techniques
PDF
Généralité sur le bassin de berkine
 
PDF
Mobile Networks Architecture and Security (2G to 5G)
PPT
Tiny os
PDF
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
PPTX
RISC-V Introduction
PDF
Wireless communication theodore rappaport
PDF
IC Technology
PDF
SPINS: Security Protocols for Sensor Networks
PDF
communication interfaces-Embedded real time systems
PPTX
PPTX
Using Tiny OS in Wireless Sensor Network
VoLTE optimization.pdf
pptudsy.pptx
2 g data performance dimensioning ,planning & optimization
Wcdma umts wireless networks
3g umts-terminating-call
Gb over ip
Abis Over IP/Abis Optimization on-site Workshop
Redes de Computadores - Modulo 1
Multiple acces techniques
Généralité sur le bassin de berkine
 
Mobile Networks Architecture and Security (2G to 5G)
Tiny os
Notes: Verilog Part 1 - Overview - Hierarchical Modeling Concepts - Basics
RISC-V Introduction
Wireless communication theodore rappaport
IC Technology
SPINS: Security Protocols for Sensor Networks
communication interfaces-Embedded real time systems
Using Tiny OS in Wireless Sensor Network
Ad

Viewers also liked (20)

PPTX
Security Vision for Software on Wheels (Autonomous Vehicles)
PDF
201004 - brain computer interaction
PPT
2009 04 москва, совазс
PPTX
Séptimo Básico.Pp
PPT
Mobile Social Media, Sept. 2010, Do You Want To Be Visible?, Marketing Club K...
PDF
201505 CSE340 Lecture 06
PDF
201505 CSE340 Lecture 03
PPT
Diego Ernesto Leal
PDF
201506 CSE340 Lecture 21
PPTX
How new technologies affect the art of contesting
PDF
Week10
PDF
Week7
ZIP
Eurowerks 2009 Slideshow
PDF
Week11 Presentation Group-C
PPT
Eprotect Complan Ver 4
PPTX
A73A CQWW 2012 Contest operation from the Desert of Qatar
PPT
LiveOffice Email Archiving & Compliance 201
PDF
Angeiologie 4 2013 - 1-2014 livre des resumes
PDF
Object Flow Analysis
Security Vision for Software on Wheels (Autonomous Vehicles)
201004 - brain computer interaction
2009 04 москва, совазс
Séptimo Básico.Pp
Mobile Social Media, Sept. 2010, Do You Want To Be Visible?, Marketing Club K...
201505 CSE340 Lecture 06
201505 CSE340 Lecture 03
Diego Ernesto Leal
201506 CSE340 Lecture 21
How new technologies affect the art of contesting
Week10
Week7
Eurowerks 2009 Slideshow
Week11 Presentation Group-C
Eprotect Complan Ver 4
A73A CQWW 2012 Contest operation from the Desert of Qatar
LiveOffice Email Archiving & Compliance 201
Angeiologie 4 2013 - 1-2014 livre des resumes
Object Flow Analysis
Ad

Similar to TinyOS installation Guide And Manual (20)

PDF
BeagleBone Black: Platform Bring-Up with Upstream Components
PPTX
How To Add System Call In Ubuntu OS
PPTX
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
PDF
IoT: Internet of Things with Python
PDF
snortinstallguide
DOCX
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
PDF
LIGGGHTS installation-guide
PDF
MicroPython for LEGO Spike - introduction
PDF
Install guide
PDF
Install guide
PDF
Nccp Presentation Ubuntu
PDF
Ubuntu Practice and Configuration
PPT
PDF
2 how to-build_document_management_system
DOCX
Adding System Call to Kernel
PPT
Linux Conf Admin
PPT
Linux conf-admin
PPT
Linux conf-admin
PPT
BeagleBone Black: Platform Bring-Up with Upstream Components
How To Add System Call In Ubuntu OS
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
IoT: Internet of Things with Python
snortinstallguide
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
LIGGGHTS installation-guide
MicroPython for LEGO Spike - introduction
Install guide
Install guide
Nccp Presentation Ubuntu
Ubuntu Practice and Configuration
2 how to-build_document_management_system
Adding System Call to Kernel
Linux Conf Admin
Linux conf-admin
Linux conf-admin

More from Ankit Singh (19)

PPTX
IoT in Mining for Sensing, Monitoring and Prediction of Underground Mines Roo...
PDF
Parallex - The Supercomputer
PDF
Cooperative Linux
PPT
Design Alternative for Parallel Systems
PDF
Restricted Usage of Anonymous Credentials in VANET for Misbehaviour Detection
PDF
The Security and Privacy Threats to Cloud Computing
PDF
The Security and Privacy Requirements in VANET
PDF
Master Teset Specification SRCP
PDF
MicazXpl Intelligent Sensors Network Project Presentation
PDF
Micazxpl - Intelligent Sensors Network project report
KEY
DO-178B/ED-12B Presentation
DOCX
Toilet etiquettes
DOCX
Indian German Unity
PPT
TINYOS Oscilloscope Application
PPS
Mote Mote Radio Communication
PPT
Simple Railroad Command Protocol
ODP
Dane presentation
PPT
Anti Collision Railways System
PPT
Software Fault Tolerance
IoT in Mining for Sensing, Monitoring and Prediction of Underground Mines Roo...
Parallex - The Supercomputer
Cooperative Linux
Design Alternative for Parallel Systems
Restricted Usage of Anonymous Credentials in VANET for Misbehaviour Detection
The Security and Privacy Threats to Cloud Computing
The Security and Privacy Requirements in VANET
Master Teset Specification SRCP
MicazXpl Intelligent Sensors Network Project Presentation
Micazxpl - Intelligent Sensors Network project report
DO-178B/ED-12B Presentation
Toilet etiquettes
Indian German Unity
TINYOS Oscilloscope Application
Mote Mote Radio Communication
Simple Railroad Command Protocol
Dane presentation
Anti Collision Railways System
Software Fault Tolerance

Recently uploaded (20)

PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Lesson notes of climatology university.
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Cell Structure & Organelles in detailed.
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
01-Introduction-to-Information-Management.pdf
PDF
Complications of Minimal Access Surgery at WLH
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPH.pptx obstetrics and gynecology in nursing
2.FourierTransform-ShortQuestionswithAnswers.pdf
Microbial diseases, their pathogenesis and prophylaxis
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
human mycosis Human fungal infections are called human mycosis..pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
RMMM.pdf make it easy to upload and study
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Supply Chain Operations Speaking Notes -ICLT Program
VCE English Exam - Section C Student Revision Booklet
Lesson notes of climatology university.
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
102 student loan defaulters named and shamed – Is someone you know on the list?
Cell Structure & Organelles in detailed.
Abdominal Access Techniques with Prof. Dr. R K Mishra
O5-L3 Freight Transport Ops (International) V1.pdf
Computing-Curriculum for Schools in Ghana
01-Introduction-to-Information-Management.pdf
Complications of Minimal Access Surgery at WLH
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...

TinyOS installation Guide And Manual

  • 1. TinyOS Manual For Beginners in Linux (Ubuntu) Ankit Singh FH Frankfurt am Main February 10, 2011
  • 2. Contents 1 TinyOS Installation Guide for Beginners 2 1.1 Procedure for Installation and configuring TinyOS . . . . . . 2 1.1.1 Installation of TinyOS (Source tinyos.net) . . . . . . . 2 1.1.2 Configuration of TinyOS . . . . . . . . . . . . . . . . . 3 1.1.3 Confirming the correct configuration of the Tinyos . . 4 1.1.4 Connecting Motes & pushing modules to Motes . . . . 4 1.1.5 Setting Up Environment for Mote Listener . . . . . . 6 1.2 Compiling and Pushing Sensor board specific Application . . 7 1.2.1 Compile Module . . . . . . . . . . . . . . . . . . . . . 7 1.2.2 To Push it to the Motes . . . . . . . . . . . . . . . . . 7 1.2.3 Running GUI in For Base Station . . . . . . . . . . . 7 1
  • 3. Chapter 1 TinyOS Installation Guide for Beginners 1.1 Procedure for Installation and configuring TinyOS 1.1.1 Installation of TinyOS (Source tinyos.net) In Ubuntu operating system open following file: System → Administration → Synaptic Package Manager After Synaptic Package Manager get open goto: Settings → Repositories → Other software → (Press) Add After pressing Add button, Please enter the following line to add the tinyOS repositories: deb http://tinyos.stanford.edu/tinyos/dists/ubuntu <distribution> main Distribution is the distribution name of the Ubuntu. If you do not know the distribution name then please follow the steps to know your Ubuntu Distribution: Type the the folllowing command on your linux command line: ankit@ubuntu:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 10.04.1 LTS Release: 10.04 Codename: lucid You will get some output like the above. The Codename: lucid is my dis- tribution name. So, Just use the name which shows to you. 2
  • 4. After you inserted the above line in the add pop-up then press close. The linux will ask your permission to update the repositories. Just close it and it will automatically do it. Now, there is a option called Quick Search: Please enter tinyos as search key. You can see some result on it. Choose tinyos-2.1.1. Then press Apply button in Synaptic Package Manager. It will install tinyos for you. 1.1.2 Configuration of TinyOS Open Terminal in Ubuntu You need to source the tinyos.sh (shell script) in bashrc. Type the following command: ankit@ubuntu:~$ sudo gedit .bashrc The .bashrc file will be open after hitting enter Then copy & paste the following lines after the first syntax lines: #Sourcing the tinyos environment variable setup script source /opt/tinyos-2.1.1/tinyos.sh After that, save & exit. Change the owner ship of the tinyos directory Change directory to: (use the following command) ankit@ubuntu:~$cd /opt/ ankit@ubuntu:~$sudo Chown -R ankit:ankit tinyos-2.1.1/ Note: use your home folder name given before ’@’ sign - Add path to tinyos.jar file in tinyos.sh ankit@ubuntu:~$cd /opt/tinyos-2.1.1 ankit@ubuntu:/opt/tinyos-2.1.1$sudo gedit tinyos.sh Add the following line just after the end of the CLASSPATH: :$TOSROOT/support/sdk/java/tinyos.jar:. The line should look like: CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java: $TOSROOT/support/sdk/java/tinyos.jar:. 3
  • 5. 1.1.3 Confirming the correct configuration of the Tinyos Change directory to: ankit@ubuntu:~$cd /opt/tinyos-2.1.1/apps/Blink Type the make command for the module Blink ankit@ubuntu:/opt/tinyos-2.1.1/apps/Blink$ make micaz You should see the output like this: mkdir -p build/micaz compiling BlinkAppC to a micaz binary ncc -o build/micaz/main.exe -Os -fnesc-separator=__ -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP= 0x22 --param max-inline-insns-single=100000 -DIDENT_APPNAME="BlinkAppC" - DIDENT_USERNAME="ankit" -DIDENT_HOSTNAME="ubuntu" - DIDENT_USERHASH=0x1bba31edL -DIDENT_TIMESTAMP=0x4cec121eL -DIDENT_UIDHASH=0x92b330deL -fnesc- dump=wiring - fnesc-dump=’interfaces(!abstract())’ -fnesc- dump=’referenced(interfacedefs, components)’ -fnesc- dumpfile=build/micaz/wiring-check.xml BlinkAppC.nc -lm compiled BlinkAppC to build/micaz/main.exe 2052 bytes in ROM 51 bytes in RAM avr-objcopy --output-target=srec build/micaz/main.exe build/micaz/main.srec avr-objcopy --output-target=ihex build/micaz/main.exe build/micaz/main.ihex writing TOS image If you are able to see ’writing TOS’ image at end then you have successfully configured the Tinyos. 1.1.4 Connecting Motes & pushing modules to Motes Every time you connect a new mote to the serial-based programming board , you have to again setup & configure the network address of the program- ming board and system. So, to make life easy, I wrote a shell script. All SHELL SCRIPTS tools can be found in MicazXpl project repositories. Following are the shell script for configuring network ankit@ubuntu:~$sudo gedit /bin/runMoteSetup.sh #!/bin/sh sudo ifconfig eth0 10.5.5.1 4
  • 6. sudo arp -s 10.5.5.5 00204A13E829 netcat 10.5.5.5 1 netcat 10.5.5.5 9999 NOTE: 00204A13E829 is the MAC address of my serial-based programming board. You need to put your own MAC address finding on the board. This will save the shell script in /bin folder which will make this shell script accessible from any folder or path. Don’t forget to make the shell script to executable file by using the following command. ankit@ubuntu:~$sudo chmod +x /bin/runMoteSetup.sh ankit@ubuntu:~$ runMoteSetup.sh ??#??# *** Lantronix Universal Device Server *** Serial Number 1359433 MAC address 00204A13E829 Software version V5.8.0.1 (041112) LTX Press Enter for Setup Mode Now, The shell script to push the modules to the Motes: ankit@ubuntu:~$sudo gedit /bin/pushToMotes.sh #!/bin/sh ## For comiling Data And pushing it in the Mote make micaz install eprb,10.5.5.5 For making the above shell script executable. ankit@ubuntu:~$sudo chmod +x /bin/pushToMotes.sh ankit@ubuntu:/opt/tinyos-2.1.1/apps/Blink$ pushToMotes.sh mkdir -p build/micaz compiling BlinkAppC to a micaz binary ncc -o build/micaz/main.exe -Os -fnesc-separator=__ -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile= build/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=0x22 --param max-inline-insns-single=100000 -DIDENT_APPNAME="BlinkAppC" - DIDENT_USERNAME="ankit" -DIDENT_HOSTNAME="ubuntu" - DIDENT_USERHASH=0x1bba31edL -DIDENT_TIMESTAMP=0x4ceef6c4L - DIDENT_UIDHASH=0x44161342L -fnesc- dump=wiring -fnesc-dump=’interfaces(!abstract())’ fnesc- dump=’referenced(interfacedefs, components)’ -fnesc- dumpfile=build/ micaz/wiring-check.xml BlinkAppC.nc -lm compiled BlinkAppC to build/micaz/main.exe 2052 bytes in ROM 51 bytes in RAM 5
  • 7. avr-objcopy --output-target=srec build/micaz/main.exe build/micaz/main.srec avr-objcopy --output-target=ihex build/micaz/main.exe build/micaz/main.ihex writing TOS image cp build/micaz/main.srec build/micaz/main.srec.out installing micaz binary using eprb uisp -dprog=stk500 -dhost=10.5.5.5 --wr_fuse_h=0xd9 - dpart=ATmega128 --wr_fuse_e=ff --erase --upload if=build/micaz/main.srec.out --verify Firmware Version: 1.7 Atmel AVR ATmega128 is found. Uploading: flash Verifying: flash Fuse High Byte set to 0xd9 Fuse Extended Byte set to 0xff rm -f build/micaz/main.exe.out build/micaz/main.srec.out 1.1.5 Setting Up Environment for Mote Listener Mote Listner is used to read the data broadcasted by motes in the network and saves to the output file. Following are the commands for listening: java net.tinyos.tools.Listen -comm network@10.5.5.5:10002 It is supposed to be serial communication but in our case, we are us- ing TCP/IP connection. That is why we are using ”network@IP:PORT” in above command. You can also go through the java source for getting more details on number of options available for your type of connection to your PC: ankit@ubuntu:/opt/tinyos-2.1.1/support/sdk/java/net/tinyos$ vim packet/BuildSource.java You can export the MOTECOM for not always passing option -comm export MOTECOM=network@10.5.5.5:10002 Then run java listner without -comm parameter ankit@ubuntu:/opt/tinyos-2.1.1/apps/tests/TestSerial$ java net.tinyos.tools.Listen 6
  • 8. 1.2 Compiling and Pushing Sensor board specific Application We are going to take example of Oscilloscope application given with TinyOS package. Application Path is : /opt/tinyos-2.1.1/apps/Oscilloscope/ 1.2.1 Compile Module To Compile this Module, You need to provide Sensor board type. In our Case its: mts300. Type the following command on your linux console. SENSORBOARD=mts300 make micaz 1.2.2 To Push it to the Motes Type the following command on your linux console using your variables into the syntax bracket. make micaz reinstall eprb,<Node-ID> <IP-Adr> Node-ID: Mote ID you want to set like Mode ID 1 or 2 or anything IP-Adr: IP address of the Motes 1.2.3 Running GUI in For Base Station Goto to Java folder of Oscilloscope: /opt/tinyos-2.1.1/apps/Oscilloscope/java/ Setting Environment variable for motes communication: export MOTECOM=network@10.5.5.5:10002 Then RUN the Java Application: ankit@ubuntu:/opt/tinyos-2.1.1/apps/Oscilloscope-Mic/java$./run Hope it will be helpful for you to get started!!! Thank You!! 7