On Sun, Nov 25, 2012 at 10:16 PM, HARIKRISHNAN V S <
[email protected]> wrote:

> 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,
>

there probably isn't much you'll be able to do about this because it is
intermittent.

Most likely it is corrupted packets.   You've got telosb motes talking via
radio to the gateway which talks to the Host.

The message you are getting is coming from the Java library that is trying
to decode the packets being sent by the gateway and it is detecting a
problem   (Would be nice if it actually told you something about what it is
bitching about, but alas I'm not into Java).

The problem most likely is some corruption occuring between the gateway and
 the host (via the serial line) but it may also be happening on the radio
path.   The error detection should detect this but the base TinyOS system
is very lightly instrumented.



> I am unable to identify the problem.
>

It may also be a bug, I'm not convinced that these code paths have been
reasonably well wrung out.   The way that code is behaving as described in
the post from January implies it is somekind of bug in the serial
transmission path.

The way to debug this kind of thing is via a JTAG debugger and the GDB
debugger and then start poking around.

So if you are serious about figuring this out, that is the path you would
need to take.

eric



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
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to