I used the applications which are in tinyos-2.x/support/sdk/c  and packets
are sent correctly.
But micaz receive nothing.
I paste for you the answer i give to Michael:
---
I use
 event message_t *UartReceive.receive[am_id_t id](message_t *msg, void
*payload, uint8_t len) {..}
where UartReceive is an alias for a Recevie interface.
Is possible that my problem is in using this kind of interface?
---
I considered, for my application, the example Basestation which is in
/opt/tinyos-2.x/apps/BaseStation/
I used sf and serial_send applications to send data to my mote.
Thanks very much for your time


2007/9/27, David Gay <[EMAIL PROTECTED]>:
>
> I would also suggest using (at least as a starting point) the C code
> for packet transmission in
> tinyos-2.x/support/sdk/c (for T2) or tinyos-1.x/tools/src/sf (T1).
>
> On 9/27/07, Michael Schippling < [EMAIL PROTECTED]> wrote:
> > 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è <[EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED] >>:
> > >
> > >     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 < [EMAIL PROTECTED] <mailto:
> [EMAIL PROTECTED]>>:
> > >
> > >         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
> > >>
> > >>
> > >>         [email protected] <mailto:
> [email protected]>
> > >>
> 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
> > > [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
> >
>



-- 
Platform: Linux Fedora
TinyOS version: 2.x
Programmer: MIB510
Device(s): Micaz, Stargate
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to