Hi again. First at all, thanks for your answer. And first at all again, I haven't give enough data. Sorry for this.
I'm a Spanish student working in a thesis about sensors networks. The hardware is a mote based on a ZigBit900 module from Atmel. You can find more technical specifications at: http://cv.uoc.edu/app/mediawiki14/wiki/P%C3%A0gina_principal http://cv.uoc.edu/app/mediawiki14/wiki/Inici http://cv.uoc.edu/app/mediawiki14/wiki/Hardware_COU_1_1 Trying to test Mote-PC communication and following the tutorial indications for TestSerial, I cannot see any leds blinking (like Mario initially). Then, when comment all lines of the event Receive.receive to ensure that only the red led gets on, still no blinking. So I concluded that this event doesn't execute. Communication mote --> PC is ok. I can see the received packets on a terminal. I cannot figure what's happen for the other way PC --> mote, and why this event doesn't work normally. Are the mote discarding packets because a CRC error, for example? It's a baudrate (57600) problem? May be a problem about USB port? I have seen that some people had this problem, but no solutions were revealed. I will appreciate any help. Regards, Joaquín Urs Hunkeler-2 wrote: > > Hi, > > Why do you think you have the same problem? It is very important to > clearly identify the problem before you can solve it. The problem > described below was that Mario wrote his own interface program on the PC > and he was not sure about the exact data format on the serial port. > > What are you trying to do? Which code are you using? What hardware are > you using? Do you get any error messages? (If you are using the MIB510 > programming board with mica or iris motes, make sure the switch on the > programming board is in the off position) > > Cheers, > Urs > > > On 10/30/10 1:26 PM, Joarod wrote: >> >> 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-tp29981905p30097910.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
