[Tinyos-help] Writing to UART/Serial from .NET
Michael Schippling
schip at santafe.edu
Fri Dec 1 04:50:14 PST 2006
are you calculating the CRC correctly?
the devil may be in those delicious
> //details omitted...
MS
Brian Parfitt wrote:
> I'm having some trouble getting an application I am writing to speak
> with a mica2 mote over the UART interface. I am using MS .NET and can
> read data packets from the mote just fine... When I send a packet to the
> mote, I am not able to get the mote to respond.
>
> I have confirmed that the application running on the mote is working by
> sending messages with the SerialForwarder... Very simply, I turn on an
> LED when a UART message is received on the mote.
>
> Using some c# code as below, I'm not able to get the same response...
> Any thoughts or ideas? I have torn apart the SerialForwarder app looking
> for some special flow or control data I may have mised, but when it gets
> down to the byte level I am sending the same packet as SF...
>
>
> com =
>
> new SerialPort();
> com.ReadTimeout = 3000;
> com.WriteTimeout = 3000;
> com.BaudRate = 57600;
> com.DataBits = 8;
> com.StopBits = System.IO.Ports.StopBits.One;
> com.Parity = Parity .None;
>
> //load the iPacket objec with some message data...
> //details omitted...
>
> //Now write the data to the com port.
> com.Write(iPacket.RawPacketData,0,iPacket.RawPacketData.Length);
> //Note, I have checked to make sure that iPacket has an appropriate
> length and data paylod.. i.e. I have not done something /really really
> /dumb like send an empty object.
>
> I'm using the same SerialPort object to read from so I suspect that my
> properties on the port are correct as I am able to do some things with
> the connection... Any hep or tips from people who have hadd success
> doing tis would be great!
>
> Thanks and regards,
> Brian
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
More information about the Tinyos-help
mailing list