Boomerang Serial Forwarder Tips

From TinyOS Wiki
Revision as of 12:02, 6 April 2011 by Martinvilu (talk | contribs) (Added to the "Boomerang" Category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Tips

MOTECOM environment variable

Instead of starting SerialForwarder every time you want to connect to your Tmote wireless network, the MOTECOM environment variable simplifies connecting to the network on a per-application basis.

The SerialForwarder method of readings from the network works as follows:

java net.tinyos.sf.SerialForwarder -comm serial@COMXX:tmote &
java net.tinyos.tools.Listen

Instead, with the MOTECOM variable, you can combine the two statements into one line:

MOTECOM=serial@COMXX:tmote java net.tinyos.tools.Listen

Protocol

Gilman Tolle has written an article about the SerialForwarder packet format for TinyOS 1.1.x. The same SerialForwarder 1.1.x protocol is used in Moteiv's Boomerang distribution.

Mote-side Packetizer (FramerM) Protocol

The Packetizer (FramerM) protocol is responsible for packing messages into a frame and transmitting those messages from a mote to the SerialForwarder application running on a PC.

TinyWiki: FramerM/Packetizer connection to SerialForwarder 1.1.x

IP Socket Connections

The protocol described in the document below is the information transmitted over a socket when connecting to SerialForwarder from another PC.

TinyWiki: SerialForwarder Protocol 1.1.x

Troubleshooting

TOS_Msg length is invalid: header_length

Problem:

I executed SerialForwarder with parameters -comm serial@COM5:57600 and I get a stream of data, which goes like this:

"Received message:1A 01 08......
TOS_Msg length is invalid: header_length=260, real length=36... modifying msg to fit" 

Solution:

Run SerialForwarder by entering the following command on a single line:

java net.tinyos.sf.SerialForwarder -comm serial@COM4:tmote

SerialForwarder needs to know which platform is connected. By specifying "tmote" instead of "57600", SerialForwarder understands the incoming packets and correctly parses them.

For more startup information, please see Moteiv's Tmote Sky Quick Start Guide.

Could not find a platform specific version of TOSMsg

The Telos java classes for parsing packets over the UART/USB has not been compiled. Compile the classes for Telos by going into your TinyOS directory and making the java classes in net.tinyos.message.telos by executing the following commands in a cygwin window:

cd /opt/tinyos-1.x
cd tools/java/net/tinyos/message/telos
make
cd ../../../../
java net.tinyos.sf.SerialForwarder -comm serial@COMx:tmote

SerialForwarder should now run properly without the error message.