OK, I see. I don't use T2 and don't have the source to peruse convenient, but under T1 with Boomerang I can send and receive a 20 byte packet. If you see only the bytes listed with a raw cat then something is very screwy because the message structure, vis the length field, appears to be correct -- and the length is the usual indicator of how many bytes are transmitted. However your receiver is always calculating the position of the crc as if there is a 4 byte payload, or else as the last two bytes presumably minus the trailing 7e sync byte (I believe there should be one, I forget right now).
I suggest you try one of he Java based receivers just to double check since 'C' language utils are something of a poor step-child in TOS. Also then check that you are using the AM sending interfaces correctly. MS Dima Kogan wrote: > The listening program I'm using is seriallisten. This exists in the > standard TinyOS distribution in support/sdk/c in TinyOS 2.0.2 and in > support/sdk/c/sf in the newest CVS. Debug-enabled means replacing > "#undef DEBUG" with "#define DEBUG" in support/sdk/c/sf/serialsource.c > when building the seriallisten app. Further, the results I reported > below are 100% consistent with what I see when I directly cat the > serial device. I.e. the data physically coming across the wire IS what > is being reported by seriallisten. Sorry if anything wasn't clear. > > Can I get a confirmation that this is working for anyone? Is anybody > able to successfully transmit packets with larger payloads from an > MSP430-based mote to a computer? > > Thanks > > Dima > > On Mon, 23 Jun 2008 17:24:08 -0600 > Michael Schippling <[EMAIL PROTECTED]> wrote: > >> 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 _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
