roy liu ^-^ | 1 Jan 2007 07:29
Picon

clock but in tossim?

hi ,everyone:
  My tinyos version is 1.1.15.I want to have a timer with the period of 1 ms in tossim simulator.
However it seems the timer module could not provide such short period, so I directly use HPLClock module of
HPLclock.nc and call the command Clock.setRate(interval,scale).The parameters are interval=32,scale=1.
  It did fired every time,but the interval of tos_time was not a constant.It has several different interval
time(converting into tos_time): 28182 ,9272,5368 and some others.
  What's the problem with my disposal? Any advice will be apprecaited.

  ps:
 my code segment:
command result_t MACControl.init()
{
       .......
      // initialize and start clock
      call Clock.setRate(32,1) ;
 }

uint_32t clocktime;
event result_t clock.fire(){
   clocktime++; 
   dbg(DBG_USR1,"clock.fire has been called at
clocktime=%i,tos_state.tos_time=%i\n",clocktime,tos_state.tos_time);  
  }

DBG information:
0: clock.fire has been called at clockttime=1 .  tos_state.tos_time=19160787..
0: clock.fire has been called at clockttime=2 .  tos_state.tos_time=19188969..
0: clock.fire has been called at clockttime=3 .  tos_state.tos_time=19217151..
0: clock.fire has been called at clockttime=4 .  tos_state.tos_time=19245333..
0: clock.fire has been called at clockttime=5 .  tos_state.tos_time=19273515..
(Continue reading)

Kamal Gakhar | 1 Jan 2007 12:21
Picon

make mica2/micaz sim compilation problem

Hi,
I installed TinyOS as explained on the webpage for TinyOS 2.0. I am using a debian 2.6.8-2-386. When I try to run "make micaz sim" at "/opt/tiny~/apps/Blink/" as explained on online tutorial, I get the following error. I think there is some installation problem but being totally novice to TinyOS I am not able to figure it out alone.
I am including a small part of error that I get. Please go through the following and suggest some help !!!

*********************************************************************
(Also make mica2 sim didn't work.. it gives something like...
 make mica2 sim
mkdir -p build/mica2
  placing object files in build/mica2
  writing XML schema to app.xml
  compiling BlinkAppC to object file sim.o
ncc -c -shared -fPIC -o build/mica2/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\)   -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=mica2 -fnesc-cfile=build/mica2/app.c -board=micasb  -Wno-nesc-data-race BlinkAppC.nc   -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml
Unknown target mica2
Known targets for TinyOS directory /opt/tinyos- 2.x/tos
and the specified include directories are:
  intelmote2 eyesIFXv1 eyesIFXv2 mica2dot mica2 tinynode micaz null telosb
make: *** [sim-exe] Error 2

************************************************************
make micaz sim
mkdir -p build/micaz
  placing object files in build/micaz
  writing XML schema to app.xml
  compiling BlinkAppC to object file sim.o
ncc -c -shared -fPIC -o build/micaz/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\)   -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb  -Wno-nesc-data-race BlinkAppC.nc   -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml
  compiling Python support and C libraries into pytossim.o, tossim.o, and c-support.o
g++ -c  -shared -fPIC -o build/micaz/pytossim.o -g -O0  /opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx -I/usr/include/python2.3 -I/opt/tinyos-2.x/tos/lib/tossim -DHAVE_CONFIG_H
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:129:20: Python.h: No such file or directory
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:718:20: Python.h: No such file or directory
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:736: error: syntax error before
   `*' token
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:741: error: `ap' was not
   declared in this scope
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:741: error: `fmt' was not
   declared in this scope
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:741: error: ISO C++ forbids
   declaration of `va_start' with no type
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:741: error: initializer list
   being treated as compound expression
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: ISO C++ forbids
   declaration of `res' with no type
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: redefinition of `int
   res'
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:740: error: `int res' previously
   declared here
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: `fmt' was not
   declared in this scope
/opt/tinyos- 2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: `ap' was not
   declared in this scope
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: `vsnprintf' was not
   declared in this scope
/opt/tinyos- 2.x/tos/lib/tossim/tossim_wrap.cxx:743: error: `ap' was not
   declared in this scope
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:743: error: ISO C++ forbids
   declaration of `va_end' with no type
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:744: error: parse error before `
   return'
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:791: error: syntax error before
   `*' token
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:794: error: `result' was not
   declared in this scope
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:794: error: ISO C++ forbids
   declaration of `Py_INCREF' with no type
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:795: error: parse error before `
   return'
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:804: error: syntax error before
   `*' token
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx: In function `void
   SWIG_Python_AddErrorMsg(const char*)':
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:851: error: `PyObject'

<div><p>Hi,<br>I installed TinyOS as explained on the webpage for TinyOS 2.0. I am using a debian 2.6.8-2-386. When I try to run "make micaz sim" at "/opt/tiny~/apps/Blink/" as explained on online tutorial, I get the following error. I think there is some installation problem but being totally novice to TinyOS I am not able to figure it out alone.
<br>I am including a small part of error that I get. Please go through the following and suggest some help !!!<br><br>*********************************************************************<br>(Also make mica2 sim didn't work.. it gives something like...
<br>&nbsp;make mica2 sim<br>mkdir -p build/mica2<br>&nbsp; placing object files in build/mica2<br>&nbsp; writing XML schema to app.xml<br>&nbsp; compiling BlinkAppC to object file sim.o<br>ncc -c -shared -fPIC -o build/mica2/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\)&nbsp;&nbsp; -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=mica2 -fnesc-cfile=build/mica2/app.c -board=micasb&nbsp; -Wno-nesc-data-race 
BlinkAppC.nc&nbsp;&nbsp; -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml<br>Unknown target mica2<br>Known targets for TinyOS directory /opt/tinyos-
2.x/tos<br>and the specified include directories are:<br>&nbsp; intelmote2 eyesIFXv1 eyesIFXv2 mica2dot mica2 tinynode micaz null telosb<br>make: *** [sim-exe] Error 2<br><br>************************************************************
<br>make micaz sim<br>mkdir -p build/micaz<br>&nbsp; placing object files in build/micaz<br>&nbsp; writing XML schema to app.xml<br>&nbsp; compiling BlinkAppC to object file sim.o<br>ncc -c -shared -fPIC -o build/micaz/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\)&nbsp;&nbsp; -finline-limit=100000 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=micasb&nbsp; -Wno-nesc-data-race 
BlinkAppC.nc&nbsp;&nbsp; -fnesc-dump=components -fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs -fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml<br>&nbsp; compiling Python support and C libraries into 
pytossim.o, tossim.o, and c-support.o<br>g++ -c&nbsp; -shared -fPIC -o build/micaz/pytossim.o -g -O0&nbsp; /opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx -I/usr/include/python2.3 -I/opt/tinyos-2.x/tos/lib/tossim -DHAVE_CONFIG_H<br>
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:129:20: Python.h: No such file or directory<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:718:20: Python.h: No such file or directory<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:736: error: syntax error before
<br>&nbsp;&nbsp; `*' token<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:741: error: `ap' was not<br>&nbsp;&nbsp; declared in this scope<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:741: error: `fmt' was not<br>&nbsp;&nbsp; declared in this scope
<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:741: error: ISO C++ forbids<br>&nbsp;&nbsp; declaration of `va_start' with no type<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:741: error: initializer list<br>&nbsp;&nbsp; being treated as compound expression
<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: ISO C++ forbids<br>&nbsp;&nbsp; declaration of `res' with no type<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: redefinition of `int<br>&nbsp;&nbsp; res'<br>
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:740: error: `int res' previously<br>&nbsp;&nbsp; declared here<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: `fmt' was not<br>&nbsp;&nbsp; declared in this scope<br>/opt/tinyos-
2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: `ap' was not<br>&nbsp;&nbsp; declared in this scope<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:742: error: `vsnprintf' was not<br>&nbsp;&nbsp; declared in this scope<br>/opt/tinyos-
2.x/tos/lib/tossim/tossim_wrap.cxx:743: error: `ap' was not<br>&nbsp;&nbsp; declared in this scope<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:743: error: ISO C++ forbids<br>&nbsp;&nbsp; declaration of `va_end' with no type<br>
/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:744: error: parse error before `<br>&nbsp;&nbsp; return'<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:791: error: syntax error before<br>&nbsp;&nbsp; `*' token<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:794: error: `result' was not
<br>&nbsp;&nbsp; declared in this scope<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:794: error: ISO C++ forbids<br>&nbsp;&nbsp; declaration of `Py_INCREF' with no type<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:795: error: parse error before `
<br>&nbsp;&nbsp; return'<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:804: error: syntax error before<br>&nbsp;&nbsp; `*' token<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx: In function `void<br>&nbsp;&nbsp; SWIG_Python_AddErrorMsg(const char*)':
<br>/opt/tinyos-2.x/tos/lib/tossim/tossim_wrap.cxx:851: error: `PyObject'<br><br></p></div>
muflacek | 1 Jan 2007 16:55
Picon
Favicon

Tmote sky serial comunication


Hello, 

Pleas I need a help with the serial communication. I have a Tmote sky and
I also have some GPS board. I need to comunicate with these two devices over
the serial line and I am not very successfull. My TinyOs version is
Boomerang 2.0.4.
I need to send a special packet [ NMEA message - for example
$PSRF100,9600,8,1,0*0C(CRLF) ] from the Tmote, so I send it as an array of
bytes with HPLUSARTControl interface like this:

event void ResourceSend.granted(uint8_t rh) 
  {  
    Uint8_t i;
    //-- Make any necessary UART changes
      //call UartControl.disableSPI();
      //call UartControl.enableUART();
    call UartControl.enableUART();
      //call UartControl.disableUARTRx();
    call UartControl.setModeUART();
    call UartControl.setClockSource(SSEL_SMCLK);
    call UartControl.setClockRate(UBR_SMCLK_38400, UMCTL_SMCLK_38400);
    call UartControl.disableRxIntr();
    call UartControl.enableTxIntr();

  //-- Send data 

    for (i = 0; i < sizeof(setUart)-1; i++) // setUart = array of chars of the NMEA message
    {
        call UartControl.tx( setUart[i] );  // message transmission
        while ( !(call UartControl.isTxEmpty()) ) ;
    };

//-- Release the resource
      ....

The problem is that I need to send 20 characters, but sometimes I send 5
chars, sometimes 10 chars, sometimes 12 and so on. 
But when I make a short delay after sending each byte, it works quite
fine. But It's not very effective. I also tried to work with event TxDone() from
HPLUSARTFeedback, but it's the same problem. Pleas can you give me some advice
how to send serial data?
I am also not very shure how to recive bytes. How do I know, when a byte is
comming? What if another byte comes before I read the previous one? 

 Thanks a lot for any help.
Bye, Jan

Mr. Jonathan A. Gomez | 1 Jan 2007 19:53
Favicon

Message Formats for Basestation


Okay, I've been re-reading some of the TEP documents.  I am a bit abashed to find them more 
informative than I remembered.  But then, it took me a while to realize exactly what to look 
for, I guess.

I happened on the following in section 3 of TEP 116: "A platform MUST provide ActiveMessageC as 
a basic HIL to packet-level communication.".  Section 5 requires AM* interfaces also.  As I 
understand it, then, there is a guarantee that the Active Message message type is always 
available.

If I understand correctly, individual platforms may provide their own message types.  In the 
serial protocol, the particular message type being employed is indicated by the dispatch id, and 
the following enumeration, if I understand, is a mapping of id to type:

enum {
  TOS_SERIAL_ACTIVE_MESSAGE_ID = 0,
  TOS_SERIAL_CC1000_ID = 1,
  TOS_SERIAL_802_15_4_ID = 2,
  TOS_SERIAL_UNKNOWN_ID = 255,
};

Well, then, I still have a problem.  Are message types still broken up the way they were in 
TinyOS-1.x, as briefly alluded to by the Octave Technology Brief?  I took the guess from 
Tutorial Lesson 4 that they were specific to app loaded into the mote.

I glanced over the standard for active messages, which I shall have to presumably look at in 
more depth, and it seems that there is a certain amount of leeway to define what handlers are 
for what.

Can anyone clarify this a bit more.  I will continue to research it on my own, but I would 
appreciate some verification ... and correction.

Jon.
Philip Levis | 1 Jan 2007 19:57
Picon

Re: make mica2/micaz sim compilation problem

On Jan 1, 2007, at 3:21 AM, Kamal Gakhar wrote:

> Hi,
> I installed TinyOS as explained on the webpage for TinyOS 2.0. I am  
> using a debian 2.6.8-2-386. When I try to run "make micaz sim" at "/ 
> opt/tiny~/apps/Blink/" as explained on online tutorial, I get the  
> following error. I think there is some installation problem but  
> being totally novice to TinyOS I am not able to figure it out alone.
> I am including a small part of error that I get. Please go through  
> the following and suggest some help !!!
>

I recently added an appendix to the tutorial:

"Depending on what OS you are using and what packages are installed,  
TOSSIM may not properly compile on the first try. Appendix A  
addresses some of the common causes and gives possible solutions."

There's a link to appendix A.

Phil

Philip Levis | 1 Jan 2007 20:14
Picon

Re: Message Formats for Basestation

On Jan 1, 2007, at 10:53 AM, Mr. Jonathan A. Gomez wrote:

>
> Okay, I've been re-reading some of the TEP documents.  I am a bit  
> abashed to find them more
> informative than I remembered.  But then, it took me a while to  
> realize exactly what to look
> for, I guess.
>
> I happened on the following in section 3 of TEP 116: "A platform  
> MUST provide ActiveMessageC as
> a basic HIL to packet-level communication.".  Section 5 requires  
> AM* interfaces also.  As I
> understand it, then, there is a guarantee that the Active Message  
> message type is always
> available.
>
> If I understand correctly, individual platforms may provide their  
> own message types.  In the
> serial protocol, the particular message type being employed is  
> indicated by the dispatch id, and
> the following enumeration, if I understand, is a mapping of id to  
> type:
>
> enum {
>   TOS_SERIAL_ACTIVE_MESSAGE_ID = 0,
>   TOS_SERIAL_CC1000_ID = 1,
>   TOS_SERIAL_802_15_4_ID = 2,
>   TOS_SERIAL_UNKNOWN_ID = 255,
> };
>
>
> Well, then, I still have a problem.  Are message types still broken  
> up the way they were in
> TinyOS-1.x, as briefly alluded to by the Octave Technology Brief?   
> I took the guess from
> Tutorial Lesson 4 that they were specific to app loaded into the mote.
>
> I glanced over the standard for active messages, which I shall have  
> to presumably look at in
> more depth, and it seems that there is a certain amount of leeway  
> to define what handlers are
> for what.
>
> Can anyone clarify this a bit more.  I will continue to research it  
> on my own, but I would
> appreciate some verification ... and correction.

There are two separate forms of dispatch at play here, which is  
probably the source of the confusion. AM ids specify the format of  
the AM packet payload, while serial ids specify the format of the AM  
packet.

Applications define AM handlers. That is, they define which AM packet  
types they receive and send by wiring to particular AM ids. The AM id  
therefore specifies what the format of the AM payload is. In TinyOS 1.x:

components App, GenericComm;
App.Receive -> GenericComm.Receive[AM_SOMETHING];

In  TinyOS 2.x:

components App, new AMReceiverC(AM_SOMETHING);
App.Receive -> AMReceiverC;

The values in the serial stack are not AM ids. They specify the  
format of the AM packet, such as its headers. For example, CC2420  
active messages have a different packet format than CC1000 or the  
default, platform-independent serial active messages. In order to be  
parse the packets, the serial stack needs to know what the packet  
format is.

This additional layer of dispatch exists to remove the TinyOS 1.x  
problem of having platform-specific serial packet formats. The  
default packet format, which is platform independent, is a basic AM  
packet. But if you want to send/receive platform-specific packets  
(e.g., see all the fields of a CC2420-specific AM packet), you can  
still do so.

Phil

Mr. Jonathan A. Gomez | 2 Jan 2007 01:15
Favicon

Re: Message Formats for Basestation

(Sorry for sending it to you again, and not to the list.  I wasn't attending to the return 
address!)

Thank you for the prompt response!

I'd like to make sure I understood properly, and I have some further questions.

> There are two separate forms of dispatch at play here, which is  
> probably the source of the confusion. AM ids specify the format of  
> the AM packet payload, while serial ids specify the format of the 
> AM packet.

Suppose this were the packet being sent over serial:

7e 44 01 00 ff ff 04 22 06 00 00 01 00 95 91 7e

Then the 44 is the serial protocol type, indicating a request for acknowledgment, the leftmost 
instance of 00 is the id of the format of the AM packet, and the 06 is the am_id_t payload 
format identifier?  This payload format identifier is also the "AM packet type" you mention 
below?

> Applications define AM handlers. That is, they define which AM 
> packet types they receive and send by wiring to particular AM ids. 
> The AM id therefore specifies what the format of the AM payload is. 

Makes sense.  I'd like to know more about how BaseStation does this, since that is the 
application in which I vest a particular interest?  

Does BaseStation ever filter out packets based on am_id_t, that is, the payload format, or does 
it merely pass them all on, no matter which ids are employed?  This latter seems to make the 
most intuitive sense.

Also, I'm looking into the code, but I'd like to ask too, if I may:  Does the 
SerialActiveMessage mechanism always send platform independent messages?  And it is always 
capable of receiving them?

[SNIP]

> This additional layer of dispatch exists to remove the TinyOS 1.x  
> problem of having platform-specific serial packet formats. The  
> default packet format, which is platform independent, is a basic AM  
> packet. But if you want to send/receive platform-specific packets  
> (e.g., see all the fields of a CC2420-specific AM packet), you can  
> still do so.

Hmmm... Depending again on the apps, or is it more transparent?

Thanks,

-- Jon.

Philip Levis | 2 Jan 2007 02:57
Picon

Re: Message Formats for Basestation

On Jan 1, 2007, at 4:15 PM, Mr. Jonathan A. Gomez wrote:

> (Sorry for sending it to you again, and not to the list.  I wasn't  
> attending to the return
> address!)
>
> Thank you for the prompt response!
>
> I'd like to make sure I understood properly, and I have some  
> further questions.
>
>
>> There are two separate forms of dispatch at play here, which is
>> probably the source of the confusion. AM ids specify the format of
>> the AM packet payload, while serial ids specify the format of the
>> AM packet.
>
>
> Suppose this were the packet being sent over serial:
>
> 7e 44 01 00 ff ff 04 22 06 00 00 01 00 95 91 7e
>
> Then the 44 is the serial protocol type, indicating a request for  
> acknowledgment,

Yes.

> the leftmost
> instance of 00 is the id of the format of the AM packet,

Yes. 00 is the platform independent serial format.

> and the 06 is the am_id_t payload
> format identifier?

Yes.

> This payload format identifier is also the "AM packet type" you  
> mention
> below?

Yes. But don't confuse format identifier with am_id_t; that's  
generally what it means, but it doesn't always. The active message  
type or AM packet type is the AM id. This specifies a protocol.  
Different protocols can have different packet formats, but do not  
always do so.

>
>> Applications define AM handlers. That is, they define which AM
>> packet types they receive and send by wiring to particular AM ids.
>> The AM id therefore specifies what the format of the AM payload is.
>
> Makes sense.  I'd like to know more about how BaseStation does  
> this, since that is the
> application in which I vest a particular interest?
>
> Does BaseStation ever filter out packets based on am_id_t, that is,  
> the payload format, or does
> it merely pass them all on, no matter which ids are employed?  This  
> latter seems to make the
> most intuitive sense.

It doesn't filter; that would defeat its purpose. I'd suggest reading  
the code.

>
> Also, I'm looking into the code, but I'd like to ask too, if I  
> may:  Does the
> SerialActiveMessage mechanism always send platform independent  
> messages?  And it is always
> capable of receiving them?
>

Yes. I'm not sure what "always capable of receiving them" means. If  
you instantiate a SerialAMReceiverC, then it will be signaled when  
the node receives AM packets that:

1) follow the framing and format of the serial layer
2) follow the serial AM packet format
3) have the right AM id

> [SNIP]
>
>> This additional layer of dispatch exists to remove the TinyOS 1.x
>> problem of having platform-specific serial packet formats. The
>> default packet format, which is platform independent, is a basic AM
>> packet. But if you want to send/receive platform-specific packets
>> (e.g., see all the fields of a CC2420-specific AM packet), you can
>> still do so.
>
> Hmmm... Depending again on the apps, or is it more transparent?

If you wanted to send/receive packet formats besides the platform  
independent serial one, then you need to write components which do  
so. You would instantiate different sender/receiver components. I  
think there's some degree of support for 802.15.4, but as far as I  
know no-one has ever used it, so it might not work very well.

Phil
roy liu ^-^ | 2 Jan 2007 07:02
Picon

Re: clock bug in tossim?

 hi ,everyone:
      I have found that the problem was caused because I used ADC module which also uses TimerM
for sampling data. So both the TimerM and myself Module use Hplclock as timer. This caused collision
because they both want to set the rate of Compare2 timer ,and unfortunately, their frequency is different.
    Now can anyono give me some advise on how to solve that problem?
    Thx.
    
 
------------------  
roy  liu 
2007-01-02
 
-------------------------------------------------------------
From:roy  liu ^-^
Data:2007-01-01 14:29:49
To:tinyos-help <at> Millennium.Berkeley.
Copy:
Subject:[Tinyos-help] clock bug in tossim?
 
hi ,everyone:
  My tinyos version is 1.1.15.I want to have a timer with the period of 1 ms in tossim simulator.
However it seems the timer module could not provide such short period, so I directly use HPLClock 
module of HPLclock.nc and call the command Clock.setRate(interval,scale).The parameters are 
interval=32,scale=1.
  It did fired every time,but the interval of tos_time was not a constant.It has several different 
interval time(converting into tos_time): 28182 ,9272,5368 and some others.
  What's the problem with my disposal? Any advice will be apprecaited.
 
  ps:
 my code segment:
command result_t MACControl.init()
{
       .......
      // initialize and start clock
      call Clock.setRate(32,1) ;
 }
 
uint_32t clocktime;
event result_t clock.fire(){
   clocktime++; 
   dbg(DBG_USR1,"clock.fire has been called at 
clocktime=%i,tos_state.tos_time=%i\n",clocktime,tos_state.tos_time);  
  }
 
DBG information:
0: clock.fire has been called at clockttime=1 .  tos_state.tos_time=19160787..
0: clock.fire has been called at clockttime=2 .  tos_state.tos_time=19188969..
0: clock.fire has been called at clockttime=3 .  tos_state.tos_time=19217151..
0: clock.fire has been called at clockttime=4 .  tos_state.tos_time=19245333..
0: clock.fire has been called at clockttime=5 .  tos_state.tos_time=19273515..
0: clock.fire has been called at clockttime=6 .  tos_state.tos_time=19278883..
                                                             ~~~~~~~~~~~~~~~~the interval became 5368
0: clock.fire has been called at clockttime=7 .  tos_state.tos_time=19280225..
0: clock.fire has been called at clockttime=8 .  tos_state.tos_time=19308407..
0: clock.fire has been called at clockttime=9 .  tos_state.tos_time=19336589..
0: clock.fire has been called at clockttime=10 . tos_state.tos_time=19364771..
0: clock.fire has been called at clockttime=11 . tos_state.tos_time=19392953..
0: clock.fire has been called at clockttime=12 . tos_state.tos_time=19400883..
0: clock.fire has been called at clockttime=13 . tos_state.tos_time=19429065..
0: clock.fire has been called at clockttime=14 . tos_state.tos_time=19457247..
0: clock.fire has been called at clockttime=15 . tos_state.tos_time=19485429..
0: clock.fire has been called at clockttime=16 . tos_state.tos_time=19513611..
 
 
 
 
   
 
--------------
roy  liu 
2007-01-01
<div>
<div>&nbsp;hi&nbsp;,everyone:</div>
<div>&nbsp;&nbsp;&nbsp; &nbsp; I have found that the problem was 
caused because I used ADC module which also uses TimerM</div>
<div>for sampling data. So both the TimerM and myself Module 
use&nbsp;Hplclock as timer.&nbsp;This caused collision</div>
<div>because they both want to 
set the rate of Compare2 timer ,and unfortunately, their frequency is 
different.</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;Now can anyono give me some advise on how to 
solve that problem?</div>
<div>&nbsp;&nbsp;&nbsp; Thx.</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; 
</div>
<div>&nbsp;</div>
<div>------------------&nbsp;&nbsp;</div>
<div>roy&nbsp;&nbsp;liu&nbsp;</div>
<div>2007-01-02</div>
<div>&nbsp;</div>
<div>-------------------------------------------------------------</div>
<div>From&#65306;roy&nbsp;&nbsp;liu&nbsp;^-^</div>
<div>Data&#65306;2007-01-01&nbsp;14:29:49</div>
<div>To&#65306;tinyos-help <at> Millennium.Berkeley.</div>
<div>Copy&#65306;</div>
<div>Subject&#65306;[Tinyos-help]&nbsp;clock&nbsp;bug&nbsp;in&nbsp;tossim?</div>
<div>&nbsp;</div>
<div>hi&nbsp;,everyone:</div>
<div>&nbsp;&nbsp;My&nbsp;tinyos&nbsp;version&nbsp;is&nbsp;1.1.15.I&nbsp;want&nbsp;to&nbsp;have&nbsp;a&nbsp;timer&nbsp;with&nbsp;the&nbsp;period&nbsp;of&nbsp;1&nbsp;ms&nbsp;in&nbsp;tossim&nbsp;simulator.</div>
<div>However&nbsp;it&nbsp;seems&nbsp;the&nbsp;timer&nbsp;module&nbsp;could&nbsp;not&nbsp;provide&nbsp;such&nbsp;short&nbsp;period,&nbsp;so&nbsp;I&nbsp;directly&nbsp;use&nbsp;HPLClock&nbsp;</div>
<div>module&nbsp;of&nbsp;HPLclock.nc&nbsp;and&nbsp;call&nbsp;the&nbsp;command&nbsp;Clock.setRate(interval,scale).The&nbsp;parameters&nbsp;are&nbsp;</div>
<div>interval=32,scale=1.</div>
<div>&nbsp;&nbsp;It&nbsp;did&nbsp;fired&nbsp;every&nbsp;time,but&nbsp;the&nbsp;interval&nbsp;of&nbsp;tos_time&nbsp;was&nbsp;not&nbsp;a&nbsp;constant.It&nbsp;has&nbsp;several&nbsp;different&nbsp;</div>
<div>interval&nbsp;time(converting&nbsp;into&nbsp;tos_time):&nbsp;28182&nbsp;,9272,5368&nbsp;and&nbsp;some&nbsp;others.</div>
<div>&nbsp;&nbsp;What's&nbsp;the&nbsp;problem&nbsp;with&nbsp;my&nbsp;disposal?&nbsp;Any&nbsp;advice&nbsp;will&nbsp;be&nbsp;apprecaited.</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;ps:</div>
<div>&nbsp;my&nbsp;code&nbsp;segment:</div>
<div>command&nbsp;result_t&nbsp;MACControl.init()</div>
<div>{</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.......</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;initialize&nbsp;and&nbsp;start&nbsp;clock</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call&nbsp;Clock.setRate(32,1)&nbsp;;</div>
<div>&nbsp;}</div>
<div>&nbsp;</div>
<div>uint_32t&nbsp;clocktime;</div>
<div>event&nbsp;result_t&nbsp;clock.fire(){</div>
<div>&nbsp;&nbsp;&nbsp;clocktime++;&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;dbg(DBG_USR1,"clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;</div>
<div>clocktime=%i,tos_state.tos_time=%i\n",clocktime,tos_state.tos_time);&nbsp;&nbsp;</div>
<div>&nbsp;&nbsp;}</div>
<div>&nbsp;</div>
<div>DBG&nbsp;information:</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=1&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19160787..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=2&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19188969..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=3&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19217151..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=4&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19245333..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=5&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19273515..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=6&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19278883..</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;~~~~~~~~~~~~~~~~the&nbsp;interval&nbsp;became&nbsp;5368</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=7&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19280225..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=8&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19308407..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=9&nbsp;.&nbsp;&nbsp;tos_state.tos_time=19336589..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=10&nbsp;.&nbsp;tos_state.tos_time=19364771..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=11&nbsp;.&nbsp;tos_state.tos_time=19392953..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=12&nbsp;.&nbsp;tos_state.tos_time=19400883..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=13&nbsp;.&nbsp;tos_state.tos_time=19429065..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=14&nbsp;.&nbsp;tos_state.tos_time=19457247..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=15&nbsp;.&nbsp;tos_state.tos_time=19485429..</div>
<div>0:&nbsp;clock.fire&nbsp;has&nbsp;been&nbsp;called&nbsp;at&nbsp;clockttime=16&nbsp;.&nbsp;tos_state.tos_time=19513611..</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;</div>
<div>&nbsp;</div>
<div>--------------</div>
<div>roy&nbsp;&nbsp;liu&nbsp;</div>
<div>2007-01-01</div>
</div>
preeti k | 2 Jan 2007 08:12
Picon

Re: Problem with tossim/python: Segmentation fault (core dumped)

Hi,
I added one more flag (-shared) in PLATFORM_BUILD_FLAGS like this

PLATFORM_BUILD_FLAGS= -fpic -shared -W1,--enabled-auto-image-base
 
And the segmentation fault was gone..
 
-Preeti

 
On 1/1/07, Philip Levis <pal <at> cs.stanford.edu> wrote:
On Dec 31, 2006, at 9:06 AM, Mohamed Ahmed wrote:

> Hi,
>
> When I run the command
> >>> from TOSSIM import *
> I got the error "Segmentation fault (core dumped)".
>
> I also tried other options already tested by Preeti K. (according
> to one of his previous
> emails) and got the following outputs:
>
> >>> from tinyos.TOSSIM import *
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: No module named tinyos.TOSSIM
> >>> from tinyos.tossim import *
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: No module named tinyos.tossim
> >>> from tossim import *
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: No module named tossim

I have yet to be able to reproduce this error. I think it must be due
to either incorrect compilation or a strange Cygwin conflict. The
best way to trace this down is to run python in gdb:

$ gdb /usr/bin/python

and send the stack traceback to the list.

Phil
_______________________________________________
Tinyos-help mailing list
Tinyos-help <at> Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

<div>
<div>Hi,</div>
<div>I added one more flag (-shared) in PLATFORM_BUILD_FLAGS like this<br><br>PLATFORM_BUILD_FLAGS= -fpic <span>-shared</span> -W1,--enabled-auto-image-base </div>
<div>&nbsp;</div>
<div>And the segmentation fault was gone..</div>
<div>&nbsp;</div>
<div>-Preeti<br><br>&nbsp;</div>
<div>
<span class="gmail_quote">On 1/1/07, Philip Levis &lt;<a href="mailto:pal <at> cs.stanford.edu">pal <at> cs.stanford.edu</a>&gt; wrote:</span>
<blockquote class="gmail_quote">On Dec 31, 2006, at 9:06 AM, Mohamed Ahmed wrote:<br><br>&gt; Hi,<br>&gt;<br>&gt; When I run the command<br>
&gt; &gt;&gt;&gt; from TOSSIM import *<br>&gt; I got the error "Segmentation fault (core dumped)".<br>&gt;<br>&gt; I also tried other options already tested by Preeti K. (according<br>&gt; to one of his previous
<br>&gt; emails) and got the following outputs:<br>&gt;<br>&gt; &gt;&gt;&gt; from tinyos.TOSSIM import *<br>&gt; Traceback (most recent call last):<br>&gt;&nbsp;&nbsp; File "&lt;stdin&gt;", line 1, in ?<br>&gt; ImportError: No module named 
tinyos.TOSSIM<br>&gt; &gt;&gt;&gt; from tinyos.tossim import *<br>&gt; Traceback (most recent call last):<br>&gt;&nbsp;&nbsp; File "&lt;stdin&gt;", line 1, in ?<br>&gt; ImportError: No module named tinyos.tossim<br>&gt; &gt;&gt;&gt; from tossim import *
<br>&gt; Traceback (most recent call last):<br>&gt;&nbsp;&nbsp; File "&lt;stdin&gt;", line 1, in ?<br>&gt; ImportError: No module named tossim<br><br>I have yet to be able to reproduce this error. I think it must be due<br>
to either incorrect compilation or a strange Cygwin conflict. The<br>best way to trace this down is to run python in gdb:<br><br>$ gdb /usr/bin/python<br><br>and send the stack traceback to the list.<br><br>Phil<br>_______________________________________________
<br>Tinyos-help mailing list<br><a href="mailto:Tinyos-help <at> Millennium.Berkeley.EDU">Tinyos-help <at> Millennium.Berkeley.EDU</a><br><a href="https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help">https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
</a><br>
</blockquote>
</div>
<br>
</div>

Gmane