Packetizer.java throws a "bad packet" exception when it gets a message
with a bad CRC. I poked into UARTComm a bit but can't be sure that it
is/not generating the CRC. There's just too many overlays to follow...
I have not observed this problem when using GenericComm as the UART
i'face on the mote side, you might want to try that as an experiment.
Another possibility is that you are walking on the CRC in your TOS code
somehow.
You could modify the receive end of your Java program to dump the actual
packet contents (or just debug into it...) when you get bad data and see
what is actually coming over the wire. I was going to say use ListenRaw,
but you would have to modify it to send the request messages...
MS
Joseph Lutz wrote:
I am having an interesting problem with serial communication on the
MICAz motes. The problem is that certain packets will not be received
correctly. I have been unable to tell why a packet us unable to be
received from the error message: "serial@/dev/ttyUSB1:57600: bad packet".
This is my current setup:
I wrote a mote program that will recieve a packet with a 16 bit number.
It will then send back that number along with the data: "FF AA FF 55 FF
AA FF 55 FF AA FF 55 FF AA FF 55". I use the "UARTComm" module to send
and receive the packets. The AM number for the request packet is 8 and
the data response packet is 9. The address I send the data response
packet to is TOS_UART_ADDR.
I also wrote a Java program. It sends the packet to the mote with the 16
bit number. It waits for one second to receive the data response packet.
Once the packet is received, it will increment the 16 bit number and
request the new data line. This loop starts with line number
EEPROM_LOGGER_APPEND_START and ends before EEPROM_LOGGER_APPEND_END. If
the packet was not received in the timeout period then the request for
the data line is sent again. The re-request will happen up to 25 times
before it gives up and goes to the next number.
I am expecting the packet should be received before 25 retries but this
is not happening all the time. Most of the data lines I am able to
receive without a problem. These are the first few numbers I am unable
to receive: 120, 266, 269, 355, 522, 525, 590, 680, 683, 685, 686, 778,
781, 793, 794, 796, 799. If I change the data in the responce the bad
packets will happen on different 16 bit numbers.
I am requesting help in finding why this problem is occurring.
Suggestions to narrow down the problem would be much appreciated.
--
Joseph A. Lutz
Computer Science Major
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
------------------------------------------------------------------------
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help