[Tinyos-help] Create a serial packet

Michael Schippling schip at santafe.edu
Thu Sep 27 09:57:49 PDT 2007


Most likely you have not calculated the CRC correctly...
danielw just sent a message about how to do this in T2:
http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2007-September/028109.html
MS

Roberto wrote:
> I forgot an important (in my opinion) detail:
> at the mica side, I would like recevie packet send by serial port (UART) 
> using these followuing statements:
> 
>   event message_t *UartReceive.receive[am_id_t id](message_t *msg, void 
> *payload, uint8_t len) {...}
> 
> Help me, please
>    
> 
> 2007/9/27, Roberto Gioè <roberto.gioe at gmail.com 
> <mailto:roberto.gioe at gmail.com>>:
> 
>     Hi,
>     yes I'm italian.
>     I'm still looking for a solution to my problem: send data from a pc
>     (or a stargate) to a mote using the serial port.
>     I hope someone help me to found a solution very soon
>     good luck
> 
>     RG
> 
>     2007/9/27, Leonardo <leosayan4 at gmail.com <mailto:leosayan4 at gmail.com>>:
> 
>         Ciao sei Italiano?? se si mi daresti delle guide per mandare
>         pacchetti tramite serial? io devo fare un programma in C# e devo
>         madare dati al sensore...
> 
>         If you are not italian :D
>         Can you send me tutorial, guidelines or any documents to create
>         and a packet for send it by serial?
>         thanks
>         Leonardo
> 
>         Roberto Gioè ha scritto:
>>         Hi all.
>>         I would like create a packet to send to a micaz by a serial port.
>>         The creation ot the packet must be done in a pc using an
>>         application written in C.
>>         I use TinyOs-2.x
>>         I create the packet with the following statements:
>>         ----------
>>         char output_buffer[TOS_PACKET_LENGTH];    //TOS_PACKET_LENGTH=41
>>                                                                             
>>         //output_buffer is initialized to zero
>>         void create_packet() {
>>
>>           /* Setup packet header information */
>>           output_buffer[0] = 0x7e;     //Frame
>>           output_buffer[1] = 69;     //SERIAL_PROTO_PACKET_NOACK
>>           output_buffer[2] = 0x00;     //Sequence number byte: SerialP
>>           output_buffer[3] = 0xff;     //Destination Address
>>           output_buffer[4] = 0xff;      //Destination Address
>>           output_buffer[5] = 0x00;      //Source Address
>>           output_buffer[6] = 0x00;      //Source Address
>>           output_buffer[7] = 28;        //Payload length
>>           output_buffer[8] = 0;         //Group ID
>>           output_buffer[9] = 6;         //AMType
>>           
>>           /* Payload */
>>           output_buffer[10]='c';
>>           output_buffer[11]='i';
>>           output_buffer[12]='a';
>>           output_buffer[13]='o';
>>          
>>           /* CRC bytes and end frame */
>>           output_buffer[TOS_PACKET_LENGTH-3] = 200;
>>           output_buffer[TOS_PACKET_LENGTH-2] = 197;
>>           output_buffer[TOS_PACKET_LENGTH-1] = 0x7e;
>>         --------------
>>          When I send this packet to the micaz mote no leds fire!
>>         Is the packet format correct? I read more times the guidelines
>>         to create a packet and I read the Serial.h file too.
>>         Thanks for your answer
>>
>>         Roberto
>>          
>>
>>         ------------------------------------------------------------------------
>>
>>         _______________________________________________
>>         Tinyos-help mailing list
>>
>>
>>         Tinyos-help at Millennium.Berkeley.EDU <mailto:Tinyos-help at Millennium.Berkeley.EDU>
>>         https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>>          <https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help>
> 
> 
> 
> 
> 
> -- 
> Platform: Linux Fedora
> TinyOS version: 2.x
> Programmer: MIB510
> Device(s): Micaz, Stargate
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


More information about the Tinyos-help mailing list