Tracking Using RSSI: application in tinyos2.10+ubuntu+java

This small project was done as part of our OpenHouse event during Tech Fest Shaastra2008 atIIT Madras. It's the first application of its kind I have written.
Please read my previous posts to understand basics, if you are not familiar with basic terms

Project : Target tracking using RSSI with TelosB
Types of nodes: Mobile node, Static nodes and base station
Tools: Java serialforwarder and customized extension of listen class
Routing protocol used: Collection
Tracking scenario: 1 Dimensional

The details
Mobile node will send a blank packet with specific interval while moving. The static nodes will catch that signal and measure the RSSI value. It will be transmitted to BaseStation. Base station is the multihoposcilloscope base. The value received by base station node can be read using java serialforwarder and Listen class.
However the Listen class gives only raw information. So the program is modified and customized to get values. RSSI values are scaled to a positive value. Value we have got are between 0 and 89 using telosb motes.
The GUI is having 10 grids with 6 static nodes, but can scale to any number of nodes.

Code can be downloaded from here

111 comments:

Aditya said...

Gireesh, your post last week... your post last week... too good... tooooo good... ek dum number 1... funtasstic... mindblasting... no, not mindblowing... anything can blow your mind... it was mindblasting... it blasted my mind...

Gireesh said...

@Aditya
Thanks for your support!!!!!
If this blog helped you/any1 ..please reply with your contributions and suggestions..........
That can be of great help for somebody else who is a beginner in learning TinyOS and sensor networks
Thanks a lot for the support.........

Ashwin said...

Hi, great post! It was pretty much what I was looking for... thanks a lot...

But I have a few doubts. For one thing, I didn't understand why you used a multihop oscilloscope in your effort

Gireesh said...

It was easy for me to use multihop osci BASE program coz thats already there
else i have 2 write my own base station program

Ashwin said...

What modifications would I have to make in this to make it work with micaz?

Gireesh said...

@aswin
I guess nothing much. See the compilation for micaz in next post "hands on"
That will be enough
If an error comes, please ping me

Ashwin said...

Hi, I got a few errors during while compiling. I don't have the error log with me right now, but the error are mainly to do with the components in the .nc programs

Aditya said...

Hi .. aditya here ... here's the error log we got while compiling.

Command: make micaz
Cygwin: C:\Crossbow\cygwin\bin
Directory: C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\tinyos - rssi\final\SendingMote\
"/opt/MoteWorks/tools/bin/ide.pl 'make micaz' 'C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\tinyos - rssi\final\SendingMote\'"
#############################
ide.pl Ver:$Id: ide.pl,v 1.1.2.1 2006/05/29 07:22:52 lwei Exp $
Executing: /opt/MoteWorks/apps/tutorials/tinyos - rssi/final/SendingMote/ bash -c "make micaz"
mkdir -p build/micaz
compiling SendingMoteAppC to a micaz binary
ncc -o build/micaz/main.exe -Os -finline-limit=100000 -I%T/platform/micaz -I%T/lib/Queue -I%T/sensorboards/micasb -I%T/lib/Broadcast -I%T/lib/XLib -I.. -DROUTE_PROTOCOL=0x90 -I%T/radio/cc2420 -I%T/lib/internal/XMesh -DMULTIHOPROUTER=XMeshRouter -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -I.. -DIDENT_PROGRAM_NAME="SendingMoteAppC" -DIDENT_PROGRAM_NAME_BYTES="83,101,110,100,105,110,103,77,111,116,101,65,112,112,67,0" -DIDENT_USER_ID="Aditya_10" -DIDENT_USER_ID_BYTES="65,100,105,116,121,97,95,49,48,0" -DIDENT_HOSTNAME="roman-189bc14a6" -DIDENT_HOSTNAME_BYTES="114,111,109,97,110,45,49,56,57,98,99,49,52,97,54,0" -DIDENT_USER_HASH=0xd7c64cefL -DIDENT_UNIX_TIME=0x4933926eL -DCC2420_DEF_CHANNEL=11 -DCC2420_TXPOWER=TXPOWER_MAX SendingMoteAppC.nc -lm
In component `SendingMoteAppC':
SendingMoteAppC.nc:40: component ActiveMessageC not found
SendingMoteAppC.nc:40: component MainC not found
SendingMoteAppC.nc:41: component AMSenderC not found
SendingMoteAppC.nc:41: component `AMSenderC' is not generic
SendingMoteAppC.nc:42: component TimerMilliC not found
SendingMoteAppC.nc:42: component `TimerMilliC' is not generic
In file included from SendingMoteAppC.nc:44:
In component `SendingMoteC':
SendingMoteC.nc:40: interface Boot not found
In file included from SendingMoteAppC.nc:44:
SendingMoteC.nc:41: syntax error before `TMilli'
SendingMoteC.nc:43: interface AMSend not found
In file included from SendingMoteAppC.nc:44:
SendingMoteC.nc:47: syntax error before `msg'
SendingMoteC.nc:49: `booted' is not in interface `Boot'
SendingMoteC.nc: In function `Boot.booted':
SendingMoteC.nc:51: interface has no command or event named `led1Toggle'
SendingMoteC.nc: At top level:
SendingMoteC.nc:54: syntax error before `result'
SendingMoteC.nc:54: conflicting types for `RadioControl.startDone'
/opt/MoteWorks/tos/interfaces/SplitControl.nc:63: previous declaration of `RadioControl.startDone'
SendingMoteC.nc: In function `RadioControl.startDone':
SendingMoteC.nc:55: `SendTimer' undeclared (first use in this function)
SendingMoteC.nc:55: (Each undeclared identifier is reported only once
SendingMoteC.nc:55: for each function it appears in.)
SendingMoteC.nc: At top level:
SendingMoteC.nc:58: syntax error before `result'
SendingMoteC.nc:58: conflicting types for `RadioControl.stopDone'
/opt/MoteWorks/tos/interfaces/SplitControl.nc:77: previous declaration of `RadioControl.stopDone'
SendingMoteC.nc:61: unknown interface `SendTimer'
SendingMoteC.nc: In function `SendTimer.fired':
SendingMoteC.nc:62: interface has no command or event named `send'
SendingMoteC.nc:62: `AM_BROADCAST_ADDR' undeclared (first use in this function)
SendingMoteC.nc:62: `msg' undeclared (first use in this function)
SendingMoteC.nc:63: interface has no command or event named `led0Toggle'
SendingMoteC.nc:64: interface has no command or event named `led1Toggle'
SendingMoteC.nc: At top level:
SendingMoteC.nc:67: syntax error before `*'
SendingMoteC.nc:67: `sendDone' is not in interface `RssiMsgSend'
SendingMoteC.nc:46: `RadioControl.initDone' not implemented
In component `SendingMoteAppC':
SendingMoteAppC.nc:46: no match
SendingMoteAppC.nc:47: cannot find `SendTimer'
SendingMoteAppC.nc:49: no match
SendingMoteAppC.nc:50: no match
make: *** [exe0] Error 1

> Process Exit Code: 0
> Time Taken: 00:03

---------------------------

One more thing ... the folder of the rssi-demo program doesnt have Makefile.component ... does it make any difference ??

Gireesh said...

Tracking using rssi has 3 different programs
program1 is base station which i used the multihoposci base station : fuse it to one node connected 2 computer

Program2: sending mote: used with 1 mote which is mounted on car

program3: static nodes: all static nodes in the linear path will run this code
each folder should have a makefile
else it will not work
Also, it wont work for Avrora, you need real motes
It is compiling without problem for micaz but wont work with mica2

Aditya said...

we r using micaz motes .. however it is giving us the aforementioned error. At the moment we r only working with one node connected to the pc nd the other static nodes ... all the folders have a 'makefile' but not a 'makefile.component' ... plus is this demo compatible with previous versions of TinyOS ?? We are using TinyOS 1.x ...

Gireesh said...

Please read my assumption: the program is written specifically in tinyos2.x
My entire program set is based on this assumption

Aditya said...

hey gireesh .. sorry to bother with u such trivial doubts ... bt we r facing a lot of problems ...

can u give us details about the compilation part ?? As in is it important to have atleast 3 nodes working simultaneously ... is it why we r getting the error ???

Aditya said...

ohhh !!
thts y !! .. i get it now .. we'll get tinyOS 2.x running nd get back to u ...
thanks a tonne again !!

Gireesh said...

Dear Aditya
the title itself says ts for 2.10. This is specific to the environment settings
Run it in 2.10 only
Dont use the xbow tinyos installation
IT WILL NOT WORK in that
Any queries with 2.10+ubuntu am happy 2 reply... rest you ppl please figure out

Aditya said...
This comment has been removed by the author.
Aditya said...

oh k .. thanks again!

Gireesh said...

"Cygwin: C:\Crossbow\cygwin\bin
Directory: C:\Crossbow\cygwin"

Xbow s still living in 2003 shipping tinyos1.x
not updated anything from that time
the motes we have is something they mite have dumped .....
lol
Use my post on ubuntu tinyos installation to get t workng properly

Ashwin said...

Hi, I'm currently using Xubuntu + tinyOS 2.1... for compiling the Oscilloscope.java file, I used the javac command in the terminal and got 9 errors... I'm not sure how to go about programming the mote, now and obtaining the graph as output... do I simply program saying "cd /home/test/apps/myapp make micaz" or is there something else that must be done?

Sorry again for bothering you, but as you can very well see, I don't have a computer science background... :D

Gireesh said...

It's not in Osciloscope/Java
Its tracking/java u shld compile
If you have JDK1.5 or later installed in ubuntu (not jre) you can compile t

Ashwin said...

Hi, the following is the error I'm getting while attempting to compile the InterceptBase in the RSSI Demo program:

>>'aditya10@aditya10-desktop:/opt/tinyos-2.1.0/apps/tutorials/RssiDemo/InterceptBase$ make micaz
mkdir -p build/micaz
compiling BaseStationC to a micaz binary
ncc -o build/micaz/main.exe -Os -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb -DCC2420_NO_ACKNOWLEDGEMENTS -DCC2420_NO_ADDRESS_RECOGNITION -DIDENT_PROGRAM_NAME=\"BaseStationC\" -DIDENT_USER_ID=\"aditya10\" -DIDENT_HOSTNAME=\"aditya10-deskto\" -DIDENT_USER_HASH=0xd85abf27L -DIDENT_UNIX_TIME=0x49349ae7L -DIDENT_UID_HASH=0x30e5ba56L -fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())' -fnesc-dump='referenced(interfacedefs, components)' -fnesc-dumpfile=build/micaz/wiring-check.xml BaseStationC.nc -lm
In file included from BaseStationC.nc:71:
In component `BaseStationP':
BaseStationP.nc:47: unknown attribute `safe'
BaseStationP.nc:47: empty scalar initializer
BaseStationP.nc:47: (near initialization for `@safe')
In file included from BaseStationC.nc:71:
BaseStationP.nc:306: conflicting types for `RadioIntercept.forward'
/opt/tinyos-2.x/tos/interfaces/Intercept.nc:31: previous declaration of `RadioIntercept.forward'
BaseStationP.nc:313: conflicting types for `SerialIntercept.forward'
/opt/tinyos-2.x/tos/interfaces/Intercept.nc:31: previous declaration of `SerialIntercept.forward'
make: *** [exe0] Error 1'

So, how do we go about programming the mote now?

Ashwin said...

After installing JDK, I tried compiling the java files and got the following error:

'aditya10@aditya10-desktop:/opt/tinyos-2.1.0/apps/tutorials/RssiDemo/java$ javac RssiDemo.java
RssiDemo.java:50: cannot find symbol
symbol : class RssiMsg
location: class RssiDemo
this.moteIF.registerListener(new RssiMsg(), this);
^
RssiDemo.java:54: cannot find symbol
symbol : class RssiMsg
location: class RssiDemo
RssiMsg msg = (RssiMsg) message;
^
RssiDemo.java:54: cannot find symbol
symbol : class RssiMsg
location: class RssiDemo
RssiMsg msg = (RssiMsg) message;
^
3 errors'

Ashwin said...

I guess in the above, it doesn't recognize "RssiMssg"... so, what is to be done for successfully executing this program?

Thanks

Xabier said...

Hi
Great blog! I have been playing around with motes for some weeks and trying to get Rssi readings. I found this post really interesting, but I haven't been able to run properly the java application (the motes code compiled and loaded fine).

When I tried to compile the downloaded code I get erros coming from the get id and get version methods from the Oscilloscope.java file. I found that some fields on the oscilloscope structure used on the basic MultiHopOscilloscope app are no longer declared on yours through the MultiHopOscilloscope.h file (where you introduced the rssi field), so I put them there and the compilation errors went away. However after running the app, only the old oscilloscope window is displayed (showing no data) and I get this errors in the terminal:

receive error for OscilloscopeMsg (AM type 238): invalid lenght message received (too short)

I guess is related to the fields I re-introduced, but I am really newbie on this to put all together.

Do you have any clues about why is this not working for me? I am using tinyos 2.1 and telosb motes (3 at the moment, one playing each role).

Thanks!

Gireesh said...

you can not use the osciloscope java app
I have written my own gui for that.
I have used base station to get data to serialforwarder interface.
From that, extended the tinyos listen class and did my calculation.
It has nothing to do with oscilloscope

Jan Neumayr said...

Hi,
first of all, thanks for that little programm, its great work. I have one little question, why did you use in the "node1" code two receice events. I do not understand what the sense of the first one "creceive.receive" is?!

Regards Jan

Rayao said...

thanks !it's tooooo good.

the value of getRssi() function is 0-89?? but it is DB or only a integer??

and how i get the reality strength of the signal?

thanks.

Rayao said...

thanks! it's tooooo good!and i have test it on micaz mote!

But i have two qeustions:
1.you say the value of GetRssi() function is 0-89?? it's DB or only a integer?
2.how i get the real value of the signal from the RSSI?
expecting your reply...thanks too much

Gireesh said...

@Rayao
I just scaled it to start from 0
den max value came was 89.
( -90dbM is the sensitivity of the receiver. May be this is the reason why it gave 89. I am not sure why the maximum value was 89)
I have tested the same in telosb motes. I do not have much MicaZ 2 play around
pls do post your results and further queries

Rayao said...

@Gireesh :thanks for your reply.
1.i use your program to test.but i don't kown the ctp protocol data structor.so,i can't read the RSSI .could you tell me which two Byte is RSSI or tell me the structor of the data ?

2.Now i have little modify your program.I made the receiver connect PC through serial ports,once it recevie the signal,calling the getRssi() function ,and send the RSSI to the serial ports,then i read the data . but the result is minus .eg,-40DB .

thanks ..
could you tell me the data structor of your program?
for example ..
2 byte frame head+????+2 Byte
CRC+1 byte frame end..
thanks a lot ..

Gireesh said...

if u just want 2 get rssi
dont go for all dese things
1) include uses interface CC2420Packet; in the program
2) when a msg is received using Receive.receive( ) event, call
getRssi() using that msg pointer

uint16_t getRssi(message_t *msg)
{
return (uint16_t) call CC2420Packet.getRssi(msg);
}

that will give you negative values
i scaled it to get +ve values for comparison

Rayao said...

@Gireesh
glad to interact with u for long .
could i have your maibox?

3X...

Gireesh said...

@Rayao
pls leave your mail id,
i will mail you
after that i will delete the comment

Rayao said...
This comment has been removed by a blog administrator.
danny said...

Hi

I have an error on tour code I can't understand: in the file ListenGrid.java you declare an object of type Grid. My Eclipse can't recognize it. Did you implement such class? or used an Java API's one?

Thanx!

Gireesh said...

@ danny
Yes I have an implementation of Grid.java
http://sites.google.com/site/sahyagiri/Home/Grid.java?attredirects=0

I guess it was missing in the package I provided
Thanks for the feedback

danny said...

Hi

sorry to bother you...

I tried to compile the java code
in base1 directory and it exit with errors.

some methods in class OsciloscopeMsg are missing:
get_version()
get_interval()
get_count()
get_readings()
set_version()
set_interval()

that Osciloscope.java needs

help

Danny

Gireesh said...

i ddnt use oscilloscope java
pls c the same comment above

danny said...

Hi

I have a problem running your code.

I will detail my process, if something I did is wrong tell me what to do instead.

I installed base1 on one mote and plugged it to a USB port

I installed SendingMote on one mote to be the mote that moves

I installed node1 on 4 motes to be the static motes.

I run serial forwarder with this command:
java net.tinyos.sf.SerialForwarder -comm serial@COM9:115200

I run ListenGrid.java as java application (from eclipse)

the result:

the serial forwarder starts and reports for packets received

a gray window pops up and nothing happens.

when trying to debug I noticed that in the infinite for there is a condition that lets only msg of length 24 to enter but all the messages it receives are 34 length
and counts in hex:

msg length: 34
msg : 00FFFF000009007233FFFF00000000069A
msg length: 34
msg : 00FFFF000009007233FFFF00000000069B

and so on.

I also noticed that the base station should toggle if a packet was send or received but it really doesn't

what is wrong?

I'm very enthusiastic seeing this works

Thank you very much for your patience

Danny

Gireesh said...

@ danny
I guess the sending mote is not working!!!
if sending mote is working, it will blink led0 and led1 alternatively
Also, which ever node captures that, will blink led2 to indicate sending 2 base station
Base station will blink its tx led showing packet transmission
Gray screen is the tracking position screen which primarily meant for 6 stationary nodes.

danny said...

Yes all that you said happens

except that the nodes only toggles led1 it means that he has received a packet from sending mote

but it doesn't toggles led2 to confirm that the sending message to base station was complete successfully

have any clue?

Thanx!

Gireesh said...

@danny
nope :(

Rabiya said...

Your post is very helpful..i want to get RSSI values and i am using Telos notes.i got some problem while running "ListenGrid.java" in "eclipse".when i use "import net.tinyos.packet" it give me error that "the import net cannot be resolved"...plzz help me out

danny said...

add java SDK from tinyos as a external library

my path is:

C:\cygwin\opt\tinyos-2.x\support\sdk\java

Rabiya said...

Kindly tell me how to add java SDK from tinyOS as a external library..
Actually i am new in Eclipse
Thanx

naveen said...

hi,
great post!!!
I have tried to implement ur application.listen and Serial forwarder are working fine.But,i dont understand how to run ur main GUI and where to put this ListenGrid.java and Grid.java,
even the oscilloscope is not working.......

there r some errors in ur code!!

i hope ny help me.....

Gireesh said...

@ naveen
please read all the comments before asking a question.

naveen said...

hi again,
i have done the following
1.installed sending mote appli.
2.installed static node appliation.
3.base station application
after this what i have 2 do to get the gui(using ListenGrid).

danny said...

make sure you install the base station with ID=0

$ make telosb install.0 bsl,[COM-1]

plug base on the computer and run the SerialForwarder (see README.txt)

then compile the two java files
and run.

javac *.java

java ListenGrid

Wireless Sensor Networks said...
This comment has been removed by the author.
chung-sfc said...

I'm using Iris motes.Do you know the minimum and maximum value of RSSI values?(raw values)
I will feel happy if you can explain for me how to convert the raw values to dBm values.
Thanks for this post and your kindness!

Gireesh said...

i have scaled the values.
So it may give anything from 0 to 89 mostly
that is what I got during experiments

Anonymous said...

Hello,
Great project !And i could run it to without any hassles.
I dont not follow the rationale behind the calculate location code.
Actually why is it
if(iid<iid2)
{
distance=108-108*rssi1/(rssi1+rssi2);
System.out.println(distance);
distance+=108*(iid-1);
System.out.println("IID"+iid+" "+rssi1+" "+rssi2);;

}
else
{
distance=108-108*rssi2/(rssi1+rssi2);
distance+=108*(iid2-1);
System.out.println("IID"+iid2+" "+rssi1+" "+rssi2);

}
Thanks,
Ananya

Gireesh said...

@Ananya
As far as I remember this is one dimensional tracking
Assume that ids are listed as 1 2 3 4 5 6
You basically subtract an approximate location from closest point. To make it positive in both direction, the if else is used
(as far as i remember)

Jum said...

Hi Gireesh
Really Good Post. Very interest in it,but can't find the codes u talked as above. Can I have the codes and have a try. Thanks so much:)

Jum

Jum said...

@Gireesh

I found it. Thanks for ur post. so so so helpful!!!!

Jum said...

hi Gireesh,

I don't know why u use two receive (CReceive and RssiReceive)in your node1 coding. Can u explain that for me? Thanks a million.

Gireesh said...

@Jum,
Does it ring a bell if I say Routing and Application?

Jum said...

@Gireesh
Ya,I got it. Do u use fixed nodes or mobile node for sending signal?

Gireesh said...

@jum
easy one .......... figure out dude!!!

Jum said...

@Gireesh

Sorry, man. I'm new for Tinyos coding,so have some stupid question. In the Node1 folder, u defined uint16_t rssi=0. Can u tell me what does it mean? If rssi=0, how can I send the different rss values what I get? Maybe that's a stupid question again, but can u explain that to me. Thanks for ur patient. :)

Gireesh said...

@Jum,
If you could recollect RSSI as Receiver Strength Indicator, you will also recollect that it is not set, but calculated by the h/w. I have used the system call to get the value. rssi=0 is just initialisation

Jum said...

@Gireesh

I'm using 3 fixed nodes to send message, and my mobileNode used for collecting message and rssi then send these information to my basestation. So can I coding like this as following:

rssi1=0;
rssi2=0;
rssi3=0;

void SendTimer.fired() {
uint32_t destinationMote=0x00000003; //define the receiver node address is 0x00000003
Msg* hmpkt =(Msg*)(call AMSend.getPayload(&pkt, sizeof(Msg)));
if(TOS_NODE_ID == 1){
hmpkt-> rssi_1 = rssi_1;
}
if(TOS_NODE_ID == 2){
hmpkt-> rssi_2 = rssi_2;
}
if(TOS_NODE_ID == 3){
hmpkt-> rssi_3 = rssi_3;
}
hmpkt-> rssi[3] = (rssi_1,rssi_2,rssi_3);
hmpkt-> nodeid = TOS_NODE_ID;
if (call AMSend.send(destinationMote,&pkt, sizeof(Msg))== SUCCESS)
call Leds.led0Toggle()
else
SendBusy = TRUE;
}

Thanks bro.

Gireesh said...

@Jum,
Am afraid you made a silly mistake.
Mobile node's position is being tracked by static nodes, not the other way

Jum said...

@Gireesh

I know that. I just want to do another way. fixed nodes send message to the mobilenode.Rssi are measured by the mobilenode and send all of them to basestation. I think it could be done.

Jum said...

@Gireesh

Generally, we use CC2420Packet to collect rssi, but how to send this value as an message to basestation without using collection layer? I have tried many ways but can't make it. Can you give an idea to achieve it? Thanks so much.

Jum said...

@Gireesh

Can I hava your Email address? I think the problem is the java file.Tinyos coding should be fine.
Thanks

Fazlullah said...

Hi Gireesh G!
I downloaded the code and run it on Windows it was successful but when i run it on Fedora 7, it prompt me ERROR........
[root@localhost base1]# make micaz
mkdir -p build/micaz
compiling MultihopOscilloscopeAppC to a micaz binary
ncc -o build/micaz/main.exe -Os -..................
In file included from MultihopOscilloscopeAppC.nc:21:
MultihopOscilloscopeAppC.nc:35:
In component `CtpP':
/opt/tinyos-2.x/tos/lib/net/ctp/CtpP.nc: At top level:
/opt/tinyos-2.x/tos/lib/net/ctp/CtpForwardingEngineP.nc:602: interface has no command or event named `txAck'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpForwardingEngineP.nc:617: interface has no command or event named `txAck'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpForwardingEngineP.nc: At top level:
/opt/tinyos-2.x/tos/lib/net/ctp/CtpForwardingEngineP.nc:975: `evicted' is not in interface `LinkEstimator'
In file included from /opt/tinyos-2.x/tos/lib/net/ctp/CollectionC.nc:69,
from MultihopOscilloscopeAppC.nc:35:
In component `CtpP':
/opt/tinyos-2.x/tos/lib/net/ctp/CtpP.nc:127: component LinkEstimatorP not found
In file included from /opt/tinyos-2.x/tos/lib/net/ctp/CtpP.nc:134,
from /opt/tinyos-2.x/tos/lib/net/ctp/CollectionC.nc:69,
from MultihopOscilloscopeAppC.nc:35:
In component `CtpRoutingEngineP':
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc: In function `updateRouteTask.runTask':
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:298: interface has no command or event named `getLinkQuality'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:354: interface has no command or event named `unpinNeighbor'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:355: interface has no command or event named `pinNeighbor'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:356: interface has no command or event named `clearDLQ'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc: In function `sendBeaconTask.runTask':
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:407: interface has no command or event named `getLinkQuality'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc: In function `BeaconReceive.receive':
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:496: interface has no command or event named `insertNeighbor'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:497: interface has no command or event named `pinNeighbor'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc: At top level:
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:514: `evicted' is not in interface `LinkEstimator'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc: In function `routingTableUpdateEntry':
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:675: interface has no command or event named `getLinkQuality'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc: In function `CtpInfo.getNeighborLinkQuality':
/opt/tinyos-2.x/tos/lib/net/ctp/CtpRoutingEngineP.nc:783:
/opt/tinyos-2.x/tos/lib/net/ctp/CtpP.nc:182: cannot find `SubAMPacket'
/opt/tinyos-2.x/tos/lib/net/ctp/CtpP.nc:183: no match
make: *** [exe0] Error 1


What should I do and similarly, node also gives Error while Sending mote file is running successfuly,
Fazlullah Khan

Hossein said...

I have problem with installing node1 and SendingMote applications on telosb motes.
By running this command "make telosb install,1 bsl,COM11" I get the following error:

An error occurred:
could not open port: (2, 'Createfile', 'The system cannot find the file specified.')
maake: *** [program] Error 1

I have to mention that I am using Tinyos-2.x with cygwin.

Thanks,
Hossein

Gireesh said...

@hos
no idea .. not worked in cygwin or windows..can you pls post your experience in that and keep a link here

Wissam said...

Hello
Thank you for this blog.

I have a big problem:( i am trying to do a program to localize an object(that has no mote on it).

my problem is that for ex:
i want mote 1 to send msg to mote 3 and 4. and then mote 3 and 4 would send to the base station that they have recieved a msg from mote 1.

can you PLEASE help me in this?? in my program, mote 1 sends msgs as BCAST but i cant make mote 3 and 4 recognize that it is from 1 and send it to the station.

Thank u VERY MUCH in advance.

Gireesh said...

@wissam
if you want to send it like it, either write your own routing protocol (which is the cheapest, if you are not scaling)
or go for collection/dissemination

Wissam said...

it didnt work with me. in fact:

first i tried:

if (TOS_LOCAL_ADDRESS==1) {


call SendMsg.send(3,sizeof(XDataMsg),&packet);
call SendMsg.send(4,sizeof(XDataMsg),&packet);


}

but this ONLY sends msgs (from mote1) to mote 3!!(do u know a solution for that PLEASE??)

so now i am using:

if (TOS_LOCAL_ADDRESS==1) {

call SendMsg.send(TOS_BCAST_ADDR,sizeof(XDataMsg),&packet);


}

but the problem here is that when mote 3 and 4 recieve msgs from mote 1, i dont know how to make these motes recognize the ORIGIN of this bcast msg ( which is mote 1). so that to send to the base station this origin.

i am doing all this becoz i need to a mote 3 and 4 to confirm that they have recieved a msg from mote 1. this means that there is no barrier between them. do u have an idea for an alternative ?Thank YOU VERY MUCH.

Gireesh said...

@wisam
first of all, if u r using tinyos 1.x i cant help much
if not, that is you r using 2.1.0, there is no TOS_LOCAL_ADDRESS
It is TOS_NODE_ID

Ali Murtaza said...

Hi

I am new in this field. Can you elaborate how to run your code. Please i need this.. step by step
cause i run make commands first but it is giving me error.. Can you tell me!

Ali Murtaza said...

Hi

I am using this code. But i when i run the code, the list of motes in ossiloscope is empty and no error comes.

Please let me know what is the reason i have attached one base, one simple node and one object node.

Gireesh said...

@ali
am not using Oscilloscope application. You might have to read the things once more and do it from scratch

Anonymous said...

Hey Gireesh,
Me completely new to TinyOS and also to this field. I have learnt some basics from one tutorial and run some sample codes provided in /apps/ directory.
But its not clear to me how to run this one as it has got some java codes as well. :(

I would be really grateful to you if you could help me with that.

Looking forward to ur reply...
Shriti

Gireesh said...

hi shriti
i can help only if i know ur basics in java and nesc, how gd u r n using eclipse etc..
if u know basics of c and java, u can start from installation of tinyos 2.1 and follow the tutorials n my blog and go back 2 tinyos tutorials

anyway, u r welcome with ur doubts
(if urgent, find my gmail)

Shriti said...

Hey Gireesh,

First of all thanks a lot for your prompt reply. I have just learnt some basics of nesc..that is I have understood the concept of components, modules, configuration etc which enables me to comprehend given a program of nesc.
And Java I dont have any idea as of now, but I am going through the basics and will catch up more as and when required.
Actually its kind of urgent for me to understand the code and implement it.
So any help will be much appreciated.

Thanks and Regards
Shriti

Gireesh said...

@shriti
am glad that ppl find this code interesting.
but pl remember that hurrying may end up in a mess
ask ur supervisor to give enough time since the learning curve for nesc is slightly higher because its style and concepts differ from traditional pgm languages.
don't worry :D

Shriti said...

Hey Gireesh,
Ya agree its different from other programming languages and little bit tricky to learn.
But actually I am stuck at this very first step, like I can compile and program a mote from d codes given in example but when I try to run the same code by writing it myself, it gives lots of errors. :(

And secondly when I thought of implementing the code you have posted I just could not figure out how the java code and nesc fit together.

If you could just give me an overview of how to put all these things together that will also suffice.
Well it will also help me to get the startup and rest I will try to figure out on my own without troubling you much.:P

Thanks in advance
Shriti

Gireesh said...

@shriti
dats y i suggested 2 start from installation post..
java code u will understand once you read and run Oscilloscope application in /opt/tinyosXXX/apps/tutorials/Oscilloscope

if u r sure u wont eat up much time from me, u can catch me n my gchat!!!!

Shriti said...
This comment has been removed by a blog administrator.
Gireesh said...

@shriti
pl check ur mail!!!

PRADHAP said...

Hi thanks For providing your source code..........
I am doing master thesis using Tinyos..... please can you give me any reference link to learn about TOSSIM (tinyos-2.1.0)... is tr any GUI avalable in Tinyos-2.1.0 (Tossim)

Thanks & Regards
Prathap mathiyalagan

li said...
This comment has been removed by the author.
li said...

Hello!Glad to see your blog.But I cannot download your code from the blog.Can you send the code to my email:muxiang625@yahoo.cn?I am busy with my undergraduate thesis about a routing algorithm based on minimu spanning tree in WSN.Your code will give me much useful information.

vipin said...

sir i am using telosb mote and successfully dumped and tested the RssiDemo code provided but i am unable to interpret the packet format recieved, in this only last 2 hexavalues were changing in which also second last hexavalue flipped between 00 and FF also instead of getting static nodes id i am getting node id of sending node.Here is the o/p which i got
00 FF FF 00 01 02 3F 0A FF FA
00 FF FF 00 01 02 3F 0A FF FB
00 FF FF 00 01 02 3F 0A FF FA
00 FF FF 00 01 02 3F 0A FF FA
00 FF FF 00 01 02 3F 0A FF F9
00 FF FF 00 01 02 3F 0A FF F9
00 FF FF 00 01 02 3F 0A FF F8
00 FF FF 00 01 02 3F 0A FF F8
00 FF FF 00 01 02 3F 0A FF F7
00 FF FF 00 01 02 3F 0A FF F8
00 FF FF 00 01 02 3F 0A FF F9
00 FF FF 00 01 02 3F 0A FF F8
00 FF FF 00 01 02 3F 0A FF FA
00 FF FF 00 01 02 3F 0A FF FB
00 FF FF 00 01 02 3F 0A FF FE
00 FF FF 00 01 02 3F 0A FF FC
00 FF FF 00 01 02 3F 0A FF F7
00 FF FF 00 01 02 3F 0A 00 24
00 FF FF 00 01 02 3F 0A 00 20
00 FF FF 00 01 02 3F 0A 00 20
00 FF FF 00 01 02 3F 0A 00 20
00 FF FF 00 01 02 3F 0A 00 20
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1E
00 FF FF 00 01 02 3F 0A 00 20
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1F
00 FF FF 00 01 02 3F 0A 00 1E
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 19
00 FF FF 00 01 02 3F 0A 00 1A
00 FF FF 00 01 02 3F 0A 00 1A
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 19
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 14
00 FF FF 00 01 02 3F 0A 00 0E
00 FF FF 00 01 02 3F 0A 00 12
00 FF FF 00 01 02 3F 0A 00 04
00 FF FF 00 01 02 3F 0A 00 04
00 FF FF 00 01 02 3F 0A 00 0D
00 FF FF 00 01 02 3F 0A 00 10
00 FF FF 00 01 02 3F 0A 00 0E
00 FF FF 00 01 02 3F 0A 00 0D
00 FF FF 00 01 02 3F 0A 00 0E
00 FF FF 00 01 02 3F 0A 00 06
00 FF FF 00 01 02 3F 0A 00 06
00 FF FF 00 01 02 3F 0A 00 05
00 FF FF 00 01 02 3F 0A 00 03
00 FF FF 00 01 02 3F 0A 00 03
00 FF FF 00 01 02 3F 0A 00 08
00 FF FF 00 01 02 3F 0A 00 04
00 FF FF 00 01 02 3F 0A 00 06
00 FF FF 00 01 02 3F 0A 00 08
00 FF FF 00 01 02 3F 0A 00 10
00 FF FF 00 01 02 3F 0A 00 18
00 FF FF 00 01 02 3F 0A 00 1A
00 FF FF 00 01 02 3F 0A 00 1A
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1A
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1B
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1C
00 FF FF 00 01 02 3F 0A 00 1D
00 FF FF 00 01 02 3F 0A 00 1C

Anonymous said...

This is clearly photoshopped

Omar said...

Hey Gireesh,

That's really nice work!!!

I have a question though, which localization/tracking technique are you using?

Gireesh said...

@omar
it is the simplest program in linear movement
just approximation and averaging

Omar said...
This comment has been removed by the author.
Omar said...
This comment has been removed by the author.
Omar said...
This comment has been removed by the author.
Omar said...
This comment has been removed by the author.
vinod G.S said...
This comment has been removed by the author.
vinod G.S said...

thank you for sharing

sharryagrawal said...

Hii Gireesh..

Great Initiative by you through this blog..Actually I am trying to make the same application like this. My project is also to track Moving Robot's position. Thus I need to play with Rssi values.I knw what I have to do but not how to do it..:)
I am very new to TinyOs and nesc language. I am working on Crossbow's Micaz mote and uptill now I have been learning tinyos installed under cygwin only under this path.
C:\Crossbow\cygwin\opt\MoteWorks\tos\interfaces.

But I coul'nt find CC2420Packet Interface in this folder so that I can use any of Rssi function.

Can you pls help me how should I proceed with this.
Also If I have to run your code, cant I do it in my environment?

Thanks,

vinod G.S said...

can you please help me to get the transmission power using java

Gireesh said...

@ sharryagrawal
I doubt the crossbow installation will work
please read my posts on setting up the environment. I do not support anything on windows

@vinod G.S
You may need to figure out from CC2420 Packet structure and corresponding header generation

vinod G.S said...

Thank you i modified RssiDemo application to get transmission power using getpower() function but it is showing power is zero after calling setpower() also and please give your email address i have some doubts

sharryagrawal said...

Hii Gireesh..

Ya there is problem of TinyOs version supported by crossbow.
So I have installed xubuntos in my system which has tinyos 2.1.0 in it through VMware workstation.

What my doubt now is that- for the base station node, if I only need to read its serial port, Can I run the java program which is containing the GUI part on my windows OS ? As I am having some problem in installing JDK for ubuntu.. SO I was thinking to have better option to run it in windows itself.. Will that work?

your guidance will help me to sail me through the difficulties i am facing it in my project..I have very less to complete it..:-(.
Thanks

Gireesh said...

@sharryagrawal
I doubt it.
You need TinyOS environment to read and interpret the data.
Wondering if the xubuntos comes with Java. It should.
Only thing you may try is to share the USB to VM

sharryagrawal said...

Thanks Gireesh..Ya xubuntu is supported with java.I upload your code on my moving node and static nodes.They uploaded well with no errors.
I then upload your MultihopOscilloscopeC.nc file on my base station node by using following command after going to path /opt/tinyos2.1.0/apps/final/base1

$ make micaz install,0 mib520,/dev/ttyUSB0.
It Uploaded successfully.
Now I dont understand which java program to run next to showcase GUI?
I tried to compile all the java files which is in java folder inside base1 folder by issuing $javac Node.java command in terminal, but all of them is giving me many errors.Some of them are:

Oscilloscope.java- cannot find symbol
symbol-class OscilloscopeMsg
Location-class Oscilloscope and

Node.java-cannot find symbol
symbol- variable constants
Location-class Node

sharryagrawal said...

hey hii..

I was able to run the SerialForwarder interface which reports me for the packet received. I installed netbeans in xubuntos and compile and run your two files i.e
ListenGrid.java and Grid.java.
All went well and a gray tracking screen opened which is basically meant for 6 nodes.

My only doubt is what about all those java file which are under my folder
/opt/tinyos2.1.0/apps/final/base1/java.

When I try to compile those Node.java and Window.java files, it gives me errors as stated in my previous msg..

My project is just on verge of ending if I come up with this solution and its not possible without your help. so pls help me.
you can mail me your id on-
sharry.agrawal@gmail.com

sharryagrawal said...

Sorry to bother u much..:(

sharryagrawal said...

hey hi...
I resolved the errors which I was facing in oscilloscope.java file.Its now running properly. I understand you are not using Oscilloscope for your gui. But today to get the Rssivalues and distance using Listen class.
I dont understand the code properly in your calculateLocation(). Can u just give me a glimpse of it?

Also in function setpos() where u have set position of nodes for ex:- setpos(13,21,1). what does this 21 means in Y position? Aren't the nodes linearly aligned? And are these values 13 and 21 in meter or centimeter?

Thanks a lot for your support uptill now. kindly ans.

sharryagrawal said...
This comment has been removed by the author.
Gireesh said...

@sharryagrawal
Well, you see this was done 5 years back. I do not remember what was exactly 21 means.

Idea was to isolate the one node which is closer to the car.

A closer look at the basestation code which calculate the position, may help you.

Anyways, this post was just to inspire people that we have done it.

Peter Casey said...
This comment has been removed by the author.
Ch said...

Hello,
Can someone please tell me that why I am getting an error of

Component CC2420 not found
Interface CC2420 not found

when I am installing node1 code on my iris motes.