I'm sorry but I don't know what "DEBUG-enabled seriallisten output" is...
What program are you using to receive the data that is printing this?
It appears that the receiver is using a hard coded 4 byte payload to
calculate where things should go. Do you get the same result with the
standard ListenRaw and Listen programs?

MS


Dima Kogan wrote:
> Hi all.
> 
> I am having an odd problem with basic serial communication in TinyOS 2
> using my MSP430-based motes. It seems that somewhere there exists a limit
> on the number of bytes in a serial packet (headers and all), and if a
> packet breaches this limit, the data at the end is cut off. It also seems
> like this limit corresponds to only 4 bytes of payload! For example,
> here's the DEBUG-enabled seriallisten output when I repeatedly send a
> serial packet with a 4-byte payload ASCII "1234":
> 
> 
> /opt/tinyos-2.x/support/sdk/c/sf$ ./seriallisten /dev/ttyS0 9600
> raw 7e 45 00 ff ff 00 00 04 00 0a 30 31 32 33 c2 f2
> Note: sync
> raw 7e 45 00 ff ff 00 00 04 00 0a 30 31 32 33 c2 f2
> received 45 00 ff ff 00 00 04 00 0a 30 31 32 33 c2 f2
>   crc f2c2 comp f2c2
> 00 ff ff 00 00 04 00 0a 30 31 32 33 
> raw 7e 45 00 ff ff 00 00 04 00 0a 30 31 32 33 c2 f2
> received 45 00 ff ff 00 00 04 00 0a 30 31 32 33 c2 f2
>   crc f2c2 comp f2c2
> ...
> 
> 
> This works as it's supposed to. The payload "30 31 32 33" is received
> along with the crc value "c2 f2". But here's the output when I increase
> the payload to a 5-byte value ASCII "12345":
> 
> raw 7e 45 00 ff ff 00 00 05 00 0a 30 31 32 33 34 59
> received 45 00 ff ff 00 00 05 00 0a 30 31 32 33 34 59
>   crc 5934 comp 4aa3
> Note: bad_crc
> raw 7e 45 00 ff ff 00 00 05 00 0a 30 31 32 33 34 59
> received 45 00 ff ff 00 00 05 00 0a 30 31 32 33 34 59
>   crc 5934 comp 4aa3
> Note: bad_crc
> ...
> 
> All of the data is received: "30 31 32 33 34", but only one of the crc
> bytes come through: 59. Naturally, the crc is incorrect. Similar results
> for larger payloads. Here's what happens with the 10-byte "0123456789":
> 
> raw 7e 45 00 ff ff 00 00 0a 00 0a 30 31 32 33 34 35
> received 45 00 ff ff 00 00 0a 00 0a 30 31 32 33 34 35
>   crc 3534 comp c04a
> Note: bad_crc
> raw 7e 45 00 ff ff 00 00 0a 00 0a 30 31 32 33 34 35
> received 45 00 ff ff 00 00 0a 00 0a 30 31 32 33 34 35
>   crc 3534 comp c04a
> Note: bad_crc
> raw 7e 45 00 ff ff 00 00 0a 00 0a 30 31 32 33 34 35
> received 45 00 ff ff 00 00 0a 00 0a 30 31 32 33 34 35
>   crc 3534 comp c04a
> Note: bad_crc
> ...
> 
> 
> My TinyOS code is very simple, essentially calling SerialAMSender.send in
> a loop. I'm observing this behavior with both the 2.0.2 release of TinyOS and 
> with
> the newest code from the CVS repo. Has anybody else seen this? Ideas?
> Thanks in advance
> 
> Dima
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to