Hi, I have the same problem. Event receive doesn't work. How can I execute TestSerial succesfully without modifying internally the bytes sended within the frame?
Thanks for any help. J Mario Riesner wrote: > > Hi Urs, > > you are right! Now my TestSerialC.nc code receives the signaled event. > Inserting the 0x00 byte nr. 4 (TOS_SERIAL_ACTIVE_MESSAGE_ID) solved my > problem. > Thanks for your help. > > Cheers, > Mario > > > -----Ursprüngliche Nachricht----- > Von: Urs Hunkeler [mailto:[email protected]] > Gesendet: Freitag, 22. Oktober 2010 14:10 > An: [email protected] > Cc: [email protected] > Betreff: Re: AW: AW: AW: AW: [Tinyos-help] unable to receive UART frame > > Hi Mario, > > The default event is indeed only called if no wiring has been specified. > This could have two reasons: (1) you have a wiring problem (as you > suggested), or (2) or the type of the message (the value in the square > brackets [] before the function parameters) is not the expected value. > > Personally, since this is not a value that you specify yourself in the > code, I'd go with option (2). In SerialActiveMessageC the > SerialDispatcherC.Receive is wired for TOS_SERIAL_ACTIVE_MESSAGE_ID, > which is defined in Serial.h as 0. Without spending more time analyzing > the code I think this means the following. The framing protocol used by > the serial connection supports multiplexing different types of messages > (why ever they would need this). The ID of the messages used for TinyOS > communication is 0, your PC-based code could be sending a frame type > different from 0. > > Ok, I looked a bit more into it: > > Byte 2 (Framer-level dispatch) is set to 0x45 = 69 = > SERIAL_PROTO_PACKET_ACK, which is the only frame type that is handled > (see SerialP.nc). > > Byte 3 (as expected in SerialP.nc) seems to be a sequence number (so > make sure to increment it :-) ). > > (here you seem to miss a byte in your list) > > Byte 4 is the frame data type If my reading of the source code is > correct, this value would need to be 0 (TOS_SERIAL_ACTIVE_MESSAGE_ID). > > Byte 5-6: destination address (see Serial.h, serial_header) > > Byte 7-8: source address (see Serial.h, serial_header) > > Byte 9: length (see Serial.h, serial_header) > > Byte 10 would be the group ID (see serial_header in Serial.h). The group > ID is used to logically separate different sensor networks sharing the > same radio channel. > > Byte 11: AM type (see Serial.h, serial_header) > > > Let me know whether inserting the missing Byte 4 (frame data type) with > a value of 0 solves your problems (you might need to update the checksum). > > Cheers, > Urs > > > On 10/22/2010 12:40 PM, Mario Riesner wrote: >> Hi Urs, >> >> the official baud rate is 57600 but the AVR ATMega1281 on my platform >> (Meshbean) should use double rate for the UART but the controller does >> not use double rate even though the flag is set (should be set??). I >> think the accuracy at 57600 is not high enough. Using the baud rate 38400 >> the error (jitter) is less and it works. The modules uses a RC oscillator >> instead of a crystal this circumstances affects less clock accuracy. >> >> Now the received data and the signaled event ends in the >> default event message_t *Receive.received[uart_id_t idxxx](message_t >> *msg, void *payload, unit8_t len) >> in the file: SerialDispacherP.nc >> >> I expected an signaled event in my testSerialC.nc at the line: >> event message_t *Receive.receive(message_t * bufPtr, void * payload, >> uint8_t len) >> >> How can I signal my Receive.receive event? Or should I use an other >> received event? >> Is it a wiring problem? >> >> Cheers, >> Mario > > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > -- View this message in context: http://old.nabble.com/unable-to-receive-UART-frame-tp29981905p30092597.html Sent from the TinyOS - Help mailing list archive at Nabble.com. _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
