Hi,

Sorry but I have no experience with TinyOS 1.1 and MoteWorks but...

>>  I couldn't install TinyOS 2.1.1 on my Ubuntu OS, and hence I'm stuck 
>> programming it on MoteWorks.
Micaz is one of the best supported platform in TinyOS 2.1.1 and there
are existing packages and/or possible manual install steps to get
TinyOS 2.1.1 on Ubuntu. I think it would be worth to work on the
latest code base.

> The code i used to get the raw data is attached. It's based on 
> arduino-serial.c that i found online. This was the only option i had, as i 
> needed a program to read and write to USB without the java packages coming 
> in, as it does in SerialForwarder. Also, My mote doesn't react when i send 
> back the same string through the USB.

With your code, you can apparently get the messages from your mote.
This already works (even if the format is most probably the one I
described in my last email). To manually send packets to your mote,
you'll have to know more precisely what is the format of the packets
to build them correctly and to check that the application running on
your mote is effectively listening to incoming packets. For this, you
have to go through the code of your "MoteWorks flavor" of TinyOS and
understand how packets are built. You must also have a look at the
application code to see if it listens to incoming packets.

By simply sending back the same string I can imagine following issues
(only suppositions):
1. Dest and Source address should be exchanged otherwise the
destination won't recognize the packet as a valid one (dest address !=
mote address)$
2. If some fields are changed in the packet the CRC must be computed
again on the new data and cannot be copied "as is" from the incoming
packet otherwise the target will detect a wrong CRC.

Hope this helps,
    Romain

On Wed, Jul 13, 2011 at 11:11 AM, TJ <tjman.h...@gmail.com> wrote:
> Hey
> Thanks for the quick reply.
>
> The raw data is from MicaZ running a program written in MoteWorks. It is
> based on TinyOS-1.x I think.
> I couldn't install TinyOS 2.1.1 on my Ubuntu OS, and hence I'm stuck
> programming it on MoteWorks.
>
> The code i used to get the raw data is attached. It's based on
> arduino-serial.c that i found online.
> This was the only option i had, as i needed a program to read and write to
> USB without the java packages coming in, as it does in SerialForwarder.
> Also, My mote doesn't react when i send back the same string through the
> USB. And i'm clueless as to why. Can you help??
>
>
> And I will go through the TEP, thank you.
>
>
> Always Yours
> Tejovanth
> Tj n Spook
>
>
> On Wed, Jul 13, 2011 at 1:28 PM, Romain Bornet <bornet.r...@gmail.com>
> wrote:
>>
>> Hi,
>>
>> Have a look at TEP 113: Serial Communication
>> In section 3.6 Packet Format the layout of the bytes is explained.
>>
>> What you see is the "raw" frame at the lowest level of the serial
>> stack. It is encoded in a HDLC-like way.
>> In your case the frame 7e 42 7d 5e 00 00 7d 5d 04 01 00 96 00 1c 32 7e
>> can be split into:
>>
>> -- HDLC header
>> 7e HDLC framing byte (start of frame)
>> 42 Protocol byte (0x42 = 66 -> )
>> 7d HDLC escape character because next byte should be '7e'
>> 5e Sequence number
>>
>> -- Payload = Active Message
>> 00 00 7d 5d 04 01 00 96 00  (here again there is an HDLC escape
>> character 7d....)
>>
>> Payload "HDLC decoded" = 00 00 7d 04 01 00 96 00
>> According to the serial_header_t in Serial.h of the latest TinyOS this
>> would correspond to:
>> 00 00 dest
>> 7d 04 source
>> 01 length
>> 00 AM group
>> 96  AM Type
>> 00  1 byte Data
>>
>> -- HDLC footer
>> 1c 16 bits CRC high byte
>> 32 16 bits CRC low byte
>> 7e HDLC framing byte (end of frame)
>>
>> The Payload seems strange to me... Which version of TinyOS are you
>> using ? How do you test ? With a standard application or one you wrote
>> yourself ?
>>
>> I suggest you to have a look at the TEPs mentioned above and in
>> sources found in your TinyOS source tree under lib/serial .
>>
>> Regards
>>    Romain
>>
>> On Wed, Jul 13, 2011 at 7:32 AM, TJ <tjman.h...@gmail.com> wrote:
>> > Hey.
>> >
>> > I get the following line in hex (similar to this) when i receive a
>> > packet
>> > from the MicaZ mote on Ubuntu.
>> > 7e 42 7d 5e 00 00 7d 5d 04 01 00 96 00 1c 32 7e
>> >
>> > I'm not really sure on what the all the numbers are, except that the one
>> > in
>> > red is the node id, and one in green is a count. This I know because of
>> > the
>> > structure i put in.
>> >
>> > If my program sends the same line from the PC to the mote, will the mote
>> > understand it??
>> >
>> > Always Yours
>> > Tejovanth
>> > Tj n Spook
>> >
>> > _______________________________________________
>> > Tinyos-help mailing list
>> > Tinyos-help@millennium.berkeley.edu
>> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>> >
>
>

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

Reply via email to