I went through the mailing list, read TinyOS2 documentation, but couldn’t
get to the point, where everything works fine… I’m new to motes, so any help
would be very much appreciated. I need to send a message from PC to mote,
but just can’t get it right. I’m using TmoteSky platform. Mote is plugged to
USB port and recognized as serial port COM15 (I’m using FTDI USB to serial
drivers). On the PC, there is software written using C#. Everything works
fine, when I want to read information the mote is sending to serial port,
but I can’t write to it. Can anyone tell me exact packet format which is
needed to be sent to be recognized and accepted by mote? I tried various
formats according to google’d information, but neither of them worked.

On the mote side there’s:

uses interface Receive as SPReceive;
...
event *message_t SPReceive.receive(message_t* msg, void* payload, uint8_t
length) {
  Blink(0,100); //blinks red for 100ms
  return(msg);
} 

SPReceive is linked like this:

#define AM_SERIAL_MSG 103
...
components SerialActiveMessageC as SP;
...
AppC.SPReceive -> SP.Receive[AM_SERIAL_MSG];

On the PC side in Visual Studio:

SerialPort SP;
byte[] packet = { };
...
SP.PortName("COM15");
SP.Open();
SP.Write(packet, 0, packet.Length);
...


No matter what packets i send, i can't get the mote to blink...
Can anyone tell exact format of the packed whick is to be sent?
Something like this:

Frame byte (0x7e)
...
Payload
CRC 2 bytes
Frame byte(0x7e)

Thank You in advance.

Su pagarba, Vincas Benevičius
UAB "Baltec-CNC Technologies"
Raudondvario pl. 148, Kaunas LT 47157
Tel.: +370 684 02159
E-paštas: [EMAIL PROTECTED]
http://www.baltec-cnc.com




_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to