RE: [Tinyos-help] help, strange automatic fired timer!!
Please, correct me if this is nonsense, but try with unique("Timer") instead of unique("MSPSensing"). campbell gao <[EMAIL PROTECTED]> escribió: hi all, i encounter a strange problem: the time auto to fire without any "call timer.fire();". In my configuration Sensing.nc,3 timers are configured like following: //timer MSPSensingM.LedsTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SyncTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SendTimer -> TimerC.Timer[unique("MSPSensing")]; in my Stdcontrol part of SensingM.nc, i don't fire any timer: command result_t StdControl.init() { call Leds.init(); call PIRControl.init(); return SUCCESS; } command result_t StdControl.start() { call PIRControl.start(); return SUCCESS; } command result_t StdControl.stop() { call PIRControl.stop(); return SUCCESS; } and if i want to start the sampling, i will send a message to nodes .The receive code is like following: . event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr message) { if(message->type==0x0c){//reset mote msg if(message->data[0] == ALL_MOTES||message->data[0] == TOS_LOCAL_ADDRESS){ if(message->data[1] == MSG_START) { call SyncTimer.start(TIMER_REPEAT,timeSlot); . But how strange it is!! The sampling start up when i turn on the node's switch!! And sampling data is sent back!! Who could tell me that is why??-- best wishes campbellSNARC~~:nihao~~:hi~~:ciao~~ ___Tinyos-help mailing listTinyos-help@Millennium.Berkeley.EDUhttps://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help LLama Gratis a cualquier PC del Mundo.Llamadas a fijos y móviles desde 1 céntimo por minuto.http://es.voice.yahoo.com___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] help, strange automatic fired timer!!
Hi, I do know the problem, but I think you can write any word (Timer o anything) if you have defined it corretly. I am sorry I can help you with your previous question. Andres From: Pablo Gil Montaño <[EMAIL PROTECTED]> To: campbell gao <[EMAIL PROTECTED]>,"hi,all tinyosbuddies" Subject: RE: [Tinyos-help] help, strange automatic fired timer!! Date: Wed, 13 Sep 2006 12:34:53 +0200 (CEST) Please, correct me if this is nonsense, but try with unique("Timer") instead of unique("MSPSensing"). campbell gao <[EMAIL PROTECTED]> escribió: hi all, i encounter a strange problem: the time auto to fire without any "call timer.fire();". In my configuration Sensing.nc,3 timers are configured like following: //timer MSPSensingM.LedsTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SyncTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SendTimer -> TimerC.Timer[unique("MSPSensing")]; in my Stdcontrol part of SensingM.nc, i don't fire any timer: command result_t StdControl.init() { call Leds.init(); call PIRControl.init(); return SUCCESS; } command result_t StdControl.start() { call PIRControl.start(); return SUCCESS; } command result_t StdControl.stop() { call PIRControl.stop(); return SUCCESS; } and if i want to start the sampling, i will send a message to nodes .The receive code is like following: . event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr message) { if(message->type==0x0c){//reset mote msg if(message->data[0] == ALL_MOTES||message->data[0] == TOS_LOCAL_ADDRESS){ if(message->data[1] == MSG_START) { call SyncTimer.start(TIMER_REPEAT,timeSlot); . But how strange it is!! The sampling start up when i turn on the node's switch!! And sampling data is sent back!! Who could tell me that is why?? -- best wishes campbell SNARC ~~:nihao~~:hi~~:ciao~~ ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help - LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help _ Acepta el reto MSN Premium: Correos más divertidos con fotos y textos increíbles en MSN Premium. Descárgalo y pruébalo 2 meses gratis. http://join.msn.com?XAPID=1697&DI=1055&HL=Footer_mailsenviados_correosmasdivertidos ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] help, strange automatic fired timer!!
Perhaps you need to pass different strings to unique() in order to get different values out of it? What I am implying is that all three of the timers you wire below may resolve to the same timer because you give them all the same name. ...not that I have any idea how unique() works, of course. - ConorOn 9/13/06, campbell gao < [EMAIL PROTECTED]> wrote:hi all, i encounter a strange problem: the time auto to fire without any "call timer.fire();". In my configuration Sensing.nc,3 timers are configured like following: //timer MSPSensingM.LedsTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SyncTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SendTimer -> TimerC.Timer[unique("MSPSensing")]; in my Stdcontrol part of SensingM.nc, i don't fire any timer: command result_t StdControl.init() { call Leds.init(); call PIRControl.init(); return SUCCESS; } command result_t StdControl.start() { call PIRControl.start(); return SUCCESS; } command result_t StdControl.stop() { call PIRControl.stop(); return SUCCESS; } and if i want to start the sampling, i will send a message to nodes .The receive code is like following: . event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr message) { if(message->type==0x0c){//reset mote msg if(message->data[0] == ALL_MOTES||message->data[0] == TOS_LOCAL_ADDRESS){ if(message->data[1] == MSG_START) { call SyncTimer.start(TIMER_REPEAT,timeSlot); . But how strange it is!! The sampling start up when i turn on the node's switch!! And sampling data is sent back!! Who could tell me that is why??-- best wishes campbell SNARC~~:nihao~~:hi~~:ciao~~ ___Tinyos-help mailing listTinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- "Thought is only a flash in the middle of a long night, but the flash that means everything."- Poincaré-=-=-=-=-=-=-=-=-I'm going to run the Houston Marathon, but finishing's not my only goal: help me raise money for cancer research! http://www.active.com/donate/tnttxgc/tnttxgcCToddThanks! ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] help, strange automatic fired timer!!
campbell gao <[EMAIL PROTECTED]> escribió: hi all, [...] But how strange it is!! The sampling start up when i turn on the node's switch!! And sampling data is sent back!! Who could tell me that is why?? Probably there is some part of your code which is executing when it shouldn't. Use the toggle leds commands to check what is running and what isn't. Regards, - J. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] help, strange automatic fired timer!!
I think that it's exactly the other way around. You have to use the same string in very instance so that the compiler knows that they must have different numeric values. At least, that's what I understand from the documentation [1].[1]: http://www.tinyos.net/tinyos-1.x/doc/tutorial/lesson2.htmlConor Todd <[EMAIL PROTECTED]> escribió: Perhaps you need to pass different strings to unique() in order to get different values out of it? What I am implying is that all three of the timers you wire below may resolve to the same timer because you give them all the same name. ...not that I have any idea how unique() works, of course. - ConorOn 9/13/06, campbell gao < [EMAIL PROTECTED]> wrote:hi all, i encounter a strange problem: the time auto to fire without any "call timer.fire();". In my configuration Sensing.nc,3 timers are configured like following: //timer MSPSensingM.LedsTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SyncTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SendTimer -> TimerC.Timer[unique("MSPSensing")]; in my Stdcontrol part of SensingM.nc, i don't fire any timer: command result_t StdControl.init() { call Leds.init(); call PIRControl.init(); return SUCCESS; } command result_t StdControl.start() { call PIRControl.start(); return SUCCESS; } command result_t StdControl.stop() { call PIRControl.stop(); return SUCCESS; } and if i want to start the sampling, i will send a message to nodes .The receive code is like following: . event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr message) { if(message->type==0x0c){//reset mote msg if(message->data[0] == ALL_MOTES||message->data[0] == TOS_LOCAL_ADDRESS){ if(message->data[1] == MSG_START) { call SyncTimer.start(TIMER_REPEAT,timeSlot); . But how strange it is!! The sampling start up when i turn on the node's switch!! And sampling data is sent back!! Who could tell me that is why??-- best wishes campbell SNARC~~:nihao~~:hi~~:ciao~~ ___Tinyos-help mailing listTinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- "Thought is only a flash in the middle of a long night, but the flash that means everything."- Poincaré-=-=-=-=-=-=-=-=-I'm going to run the Houston Marathon, but finishing's not my only goal: help me raise money for cancer research! http://www.active.com/donate/tnttxgc/tnttxgcCToddThanks! ___Tinyos-help mailing listTinyos-help@Millennium.Berkeley.EDUhttps://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help LLama Gratis a cualquier PC del Mundo.Llamadas a fijos y móviles desde 1 céntimo por minuto.http://es.voice.yahoo.com___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] help, strange automatic fired timer!!
On Wednesday 13 September 2006 08:40 am, Conor Todd wrote: > On 9/13/06, campbell gao <[EMAIL PROTECTED]> wrote: > > //timer > > MSPSensingM.LedsTimer -> TimerC.Timer[unique("MSPSensing")]; > > MSPSensingM.SyncTimer -> TimerC.Timer[unique("MSPSensing")]; > > MSPSensingM.SendTimer -> TimerC.Timer[unique("MSPSensing")]; > > Perhaps you need to pass different strings to unique() in order to get > different values out of it? What I am implying is that all three of the > timers you wire below may resolve to the same timer because you give them > all the same name. unique() is very cool. From Philip Levis' "TinyOS Programming" v1.0, section 6.2: "The unique function takes a string key as an argument, and promises that every instance of the function with the same key will return a unique value. Two calls to unique with different keys can return the same value. So, instead of writing: MSPSensingM.LedsTimer -> TimerC.Timer[0]; MSPSensingM.SyncTimer -> TimerC.Timer[1]; MSPSensingM.SendTimer -> TimerC.Timer[2]; you do: MSPSensingM.LedsTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SyncTimer -> TimerC.Timer[unique("MSPSensing")]; MSPSensingM.SendTimer -> TimerC.Timer[unique("MSPSensing")]; If you haven't read it, I highly recommend Philip Levis' manual. I believe the 'official' URL for it is: http://csl.stanford.edu/~pal/pubs/tinyos-programming.pdf Steve ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] help, strange automatic fired timer!!
On Sep 13, 2006, at 5:06 AM, Andres Aberasturi wrote: Hi, I do know the problem, but I think you can write any word (Timer o anything) if you have defined it corretly. For TimerC, you cannot. You have to use the same string that is used in the component to compute the uniqueCount. This is "Timer". Other components might use different strings. Inside TimerC: uint8_t queue[NUM_TIMERS]; interfaces/Timer.h: #define NTIMERS uniqueCount("Timer") and NUM_TIMERS = NTIMERS (the #define is in case you are using a version of nesC which does not support unique/uniqueCount). Phil ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] help, strange automatic fired timer!!
On Sep 13, 2006, at 3:34 AM, Pablo Gil Montaño wrote: Please, correct me if this is nonsense, but try with unique ("Timer") instead of unique("MSPSensing"). You are completely correct. You MUST pass the string "Timer" to unique() when wiring to TimerC. If you pass another string, then two components will both wire to the same timer. When it fires, they will both handle the event. This is what is happening. Phil ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help