Hi Sara,
you try made your aplication with BlinkToRadio and TestSerial
(C:\cygwin\opt\tinyos-2.x\apps\tests\TestSerial).
*
/////////////////////////////////////////////////////////////////////////////////////////
In the node remote (BlinkToRadio) modify BlinkToRadio.h:*
enum {
AM_BLINKTORADIOMSG = 6, //Remenber this number
TIMER_PERIOD_MILLI = 250 //Change to 1000. The units of parameters in
timers is in ms.
};
typedef nx_struct BlinkToRadioMsg {
//Add variables for hour...seconds
nx_uint8_t seconds, hour, minute;
nx_uint16_t nodeid;
nx_uint16_t counter;
} BlinkToRadioMsg;
Inside of BlinkToRadioC for get the time in event receive or update the time
in timer fired event is very easy. In timer before of send:
btrpkt->nodeid = TOS_NODE_ID;
btrpkt->counter = counter;
btrpkt->seconds = sec; //You must update this varible in your program
For get the value in event receive btrpkt->seconds
*
////////////////////////////////////////////////////////////////////////////////////////////
In the PC node.* Copy BlinkToRadio.h and paste inside of folder. Using code
of BlinkToRadio change the files TestSerialAppC (take care with names of
interfaces, you not can use the same, you can see configuration BaseStation
of example also) and TestSerialC to when receive the message by serie send
to radio and when recive the message by radio send to serie. Remove the
timer, you not need. Add variables for time in the struct of the file
TestSerial.h. Open Makefile, you can see the line java mig ...this line
generatte the code of file TestSerialMsg when you type make plattform
automatically. Finally you only need modify file TestSerial.java for the new
variables using methods of TestSerialMsg.java. See the other for variable
counter of before:
payload.set_counter(counter); //update counter
msg.get_counter() //get counter value
Remenber run TestSerial program in cygwin. The same with in tutorial.
Tutorial 3 y 4 can help you very much also.
It is a long, but you understand all finally.
I wait that help you.
A greeting,
Juan Antonio.
2007/4/29, sara Khad <[EMAIL PROTECTED]>:
Hi Juan,
Thank you very much for your help. but
what I am trying to do is to measure the jitter within 5 tmote sky. So
I have to connect 3 nodes to the basestation (ie: the mote connected
to the pc) . The first node send a packet to the second node and the
second node forward it to the 3rd and so on till it hit the basestain.
So I have to measure the packet arriving time. I do no have to measure
end to end but just the jitter.
So as I am new in this area I decided to begin with 2 nodes. One node
send a packet each second (1024- BlinkToRadio version ) and the second
node is a BaseStation which receives the packet from the radio and
send it to the serial.
I want to modify the BaseStation program so that when I get a packet I
can modify the packet and add the time and send it!??? how to do
that??
I have two question?
When the BaseStation receives a packet from BlinkToRadio program, does
the packet contains a timestamp field, if yes how to extract it? if
not how to add it ?
Can you help me with this problem. at least till me how to add
something to the receiving packet? do you have any simple example.
note i am using tinyos2.
Best,
Sara
On 4/27/07, Juan Antonio López Riquelme <[EMAIL PROTECTED]>
wrote:
> Hi Sara,
>
> tutorial 3 can help you
> http://www.tinyos.net/tinyos-2.x/doc/html/tutorial/lesson3.html,
> you can add all variables thay you need in the struct for send the time:
>
> typedef nx_struct BlinkToRadioMsg {
> nx_uint16_t nodeid;
> nx_uint16_t counter;
> } BlinkToRadioMsg;
>
> For update the value of variables before of send the message you can see
> inside of source code of lesson 3.
>
> For get the time, you can have three variables (hour, ..., seconds) and
one
> time of 1 second. Since second add 1 to variable seconds, if second ==
60,
> add 1 to minutes, ...problem the time of start, you can made that when
you
> reset the mote the hour start in the time that you wish.
>
> I wait that help you.
>
> A greeting,
> Juan Antonio.
>
>
> 2007/4/27, sara Khad <[EMAIL PROTECTED]>:
> >
> > Hi all,
> > I am new in tinyos and hope that someone can help me.
> > I am using tinyos2 and tmote sky. How to add the time to the packet
> > before sending it???
> > Anyone have a simple example ??
> > thanks
> > sara
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> >
>
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help