Dear sir/madam
I am receving 'bad packet' message from my telosb Basestation mote for the 
following command
java net.tinyos.tools.Listen -comm serial@/dev/ttyUSB0:telosb
Since I am getting bad packet message at irregualar intervals unpredicted, I am 
unable to identify the problem.


I googled to see solutions on similar problems. The link of thread is as 
follows:

http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2012-January/053191.html

Forums tell, the issue may be beacuse of baud rate difference between micaz and 
telosb.  I am always working with Telosb motes.
115200 is the baud rate as per tinyos wiki documentation. And I see 
'serial@/dev/ttyUSB0:115200: bad packet' message. printed at command prompt for

'java net.tinyos.tools.Listen -comm
 serial@/dev/ttyUSB0:telosb' command.
So I assume it is not baud rate issue.


KINDLY HELP
What may be the possible issues for bad packet error?


Let
 me give you more information end device communicating with basesation.I
 have 1 basestation and 1 End Device mote with a PIR sensor.  The PIR 
sensor mote sends a packet to base station every time when a object is 
detected. 
If an object is not detected for 10 minutes, it sends a Alive packet to the 
basestation telling basestation that 
PIR sensor has not gone out of range of Basestation. I am using 2 timers in my 
End Device tinyos nesc program.  

When Timer1 gets fired, it calls PIR.read() function. If object is detected 
PIR.readDone is called.
PIR readDone sends packet to Basestation with status field 0x01.

when Timer2 gets fired, it sends alive packet with status =0x00.

I am using printf library to print data into Serial
 Port.


Following is my code at basestation.

#include "SenseToRadio.h"
#include "printf.h"

module SenseToRadioC
{
  uses {
    interface Boot;
    interface Leds;
    interface SplitControl as 
AMControl;                                         
    interface Receive;
    
  }
}


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

  event void AMControl.startDone(error_t err) {
  }

  event void AMControl.stopDone(error_t err) {
  }

  event message_t* Receive.receive(message_t* msg,
 void* payload, uint8_t len) {
    if (len == sizeof(SenseToRadioMsg)) {
      SenseToRadioMsg* btrpkt = (SenseToRadioMsg*)payload;
      call Leds.led1Toggle();

      printf("%d%d%d\n",(btrpkt->nodeid>>8),btrpkt->nodeid,btrpkt->data);
      printfflush();
    }
  return msg;
  }
}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to