Straw – Reliable Data Collection

Last updated 30 November 2006

 

Straw (Scalable Thin and Rapid Amassment Without loss) collects data reliably from a mote to PC over multi-hop network. When command is submitted to JAVA code in PC, it interacts with TinyOS code in a mote, and collects data without loss.

 

Usage

Command to JAVA code is

int read(int dest, short portId, long start, long size, byte[] bffr)

Buffer space needs be provided by JAVA application using Straw. And Straw interface of TinyOS code

event result_t read(uint32_t start, uint32_t size, uint8_t* bffr)

needs be implemented. TinyOS Application will fill up buffer, and call readDone(). Size of reading will be smaller than packet size. And that’s it. Data can reside either in RAM or FLASH. As long as address space is properly defined so that start and size can be interpreted, Straw works.

Straw is tested on tinyos-1.1.11 with nesc-1.2alpha11.

 

Location

You can download the package from:

http://www.cs.berkeley.edu/~binetude/ggb/code/GGB.tgz

Put GGB directory under /opt/tinyos-1.x/contrib

TinyOS code

/opt/tinyos-1.x/contrib/GGB/tos/lib/Straw

JAVA code

/opt/tinyos-1.x/contrib/GGB/tools/java/net/tinyos/straw

 

Examples

Two nodes are needed. Program them with application at:

/opt/tinyos-1.x/contrib/GGB/apps/TestStraw

One node with node number 0 is a base station. The other node with node number 1 is a target node to collect data.

binetude@pilsner /opt/tinyos-1.x/contrib/GGB/tools/java
$ java net/tinyos/straw/TestStraw readData 1
********  readData  ********
****  Straw  ****
  1:SRSRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
msgSent = 2, msgRcvd = 51, successRate = 1.0 (50 / 50)
checksum = 0, tmpCheckSum = 0
Ni = 5578, Td = -1164951354355, Rr = 0, Ec = 0, total = -1164951348777
 
SR
Bandwidth = 43.536941094518696 (B/s)
Latency = 22.969 (s)
 
msgSent = 3, msgRcvd = 52, successRate = 1.0 (50 / 50)
checksum = 59180, tmpCheckSum = 59180
Ni = 5578, Td = 6328, Rr = 5500, Ec = 5563, total = 22969
 
Straw Success

This is a simple example reading RAM. The result is shown above. At first there is a sequence of “R” and “S”. “S” means one packet is sent, and “R” means one packet is received. At the end, statistics are printed. “msgSent” is the total number of messages sent, “msgRcvd” is the total number of messages received, and “successRate” is the raw success rate provided by the low layer. “Ni” is the time taken to gather network information, which is used to tune parameters. “Td” is the time taken to transfer the entire data once. “Rd” is the time taken to fill holes (to retransmit missing packets). “Ec” is the time taken to check whether there is an error in the data. Finally “total” is the total time taken (sum of the previous four).

 

Known Problems

With MintRoute, after sending large number of packets at high speed, some link blacks out. But link revives after some time.