[Tinyos-help] Radio communication not working on Mica2

Urs Hunkeler urs.hunkeler at epfl.ch
Wed Nov 24 06:42:27 PST 2010


Hi,

I have a couple of Mica2 (and Mica2Dot) motes and I wanted to use them 
for some experiments, but somehow radio communication doesn't seem to 
work. Is there anything special you need to do with the CC1000 radio?

Here's the simple test program I used. It works on TelosB and TinyNode, 
but somehow does not work on Mica2 (and Mica2Dot). The LED indicating a 
successful transmission blinks as expected. The LED indicating errors 
stays off. But the LED indicating a successful reception also stays off. 
So I assume that somehow the motes do not receive any messages (I don't 
know whether they are really sending anything). Any ideas?

Cheers,
Urs

---------------
// TestAppC.nc
configuration TestAppC {
}
implementation {
   components TestC;
   components ActiveMessageC;
   //components new AMSenderC(54);
   //components new AMReceiverC(54);
   components MainC;
   components LedsC as Leds;
   components new TimerMilliC() as Timer;

   TestC.Boot -> MainC;
   TestC.RadioControl -> ActiveMessageC;
   //TestC.Send -> AMSenderC;
   TestC.Send -> ActiveMessageC.AMSend[54];
   //TestC.Receive -> AMReceiverC;
   TestC.Receive -> ActiveMessageC.Receive[54];
   TestC.Leds -> Leds;
   TestC.Timer -> Timer;
}

--------------------------------
// TestC.nc
module TestC {
   uses {
     interface Boot;
     interface SplitControl as RadioControl;
     interface AMSend as Send;
     interface Receive;
     interface Timer<TMilli>;
     interface Leds;
   }
}
implementation {
   message_t rPacket;

   event void Boot.booted() {
     call RadioControl.start();
   }

   event void RadioControl.startDone(error_t error) {
     if(error == SUCCESS) {
       call Timer.startPeriodic(1024L);
     } else {
       call Leds.led2On();
       call RadioControl.start();
     }
   }

   event void RadioControl.stopDone(error_t error) {
   }

   event message_t* Receive.receive(message_t* msg, void* payload, 
uint8_t len) {
     call Leds.led0Toggle();
     return msg;
   }

   event void Timer.fired() {
     error_t error = call Send.send(AM_BROADCAST_ADDR, &rPacket, 5);
     if(error != SUCCESS) {
       call Leds.led2On();
     }
   }

   event void Send.sendDone(message_t* msg, error_t error) {
     if(error != SUCCESS) {
       call Leds.led2On();
     } else {
       call Leds.led1Toggle();
     }
   }
}



More information about the Tinyos-help mailing list