Hi all!

I'm trying to use MultihopRouting for make an application that sends sensor
information of each node to a PC. I try to use the component
EWMAMultiHopRouter for do this, but i can't do it. I'm using mica2 motes at
900 MHz with TinyOS 1.1. The code i use is the next:

Log.nc:

....
implementation{
  ...
  Main.StdControl -> Multihop.StdControl;

  LogM.StatusSend -> Multihop.Send[AM_STATEMSG];
  Multihop.ReceiveMsg[AM_STATEMSG] -> Comm.ReceiveMsg[AM_STATEMSG];
  ...
}


LogM.nc:

...
implementation{
  ...
  task void sendLog{
    StatusMsg_t *m;
    uint16_t len;



    if(m = (StatusMsg_t *)call StatusSend.getBuffer(&msg, &len)){
      atomic{
        m->nodeID = TOS_LOCAL_ADDRESS;
        m->state = state;
      }

      call Leds.yellowToggle();

      if( (call StatusSend.send(&msg, sizeof(StatusMsg_t))) != SUCCESS){
        call TimerSend.start(TIMER_ONE_SHOT, 2048);
        call Leds.redToggle();
        busy = FALSE;
      }
    }
  }
...
}

On this way, when i post the task sendLog, it should send the message "m" to
the node 0 through a multihop tree. Have I got any error?

When I program a mote, yellow led must to toggle when i send a message and
if there are any error red led must to toggle. I have program sendDone event
toggling green led. When i execute it, yellow led toggle, red led don't
toggle and green led don't toggle. Where is the problem? StatusSend.send(...)
is FAUL then red led must to toggle, but it doesn't. I don't understand.

Any idea???

Thanks!!!

-- 
José Manuel Sánchez-Matamoros Pérez
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to