|
Sensor network development using stargate and motes from
Crossbow. In developing the sensor network, we needed to be
capable of acquiring sensor data from the motes at the stargate.
The process for setting up the nodes for a simple data
acquisition is listed below.
Initial setup
- Install TinyOS on a host PC
Programming the radio motes
-
Programming board
used : MIB510
-
Radio mote used :
MICA2 MPR400
-
Connect the mica2
to the programming board, connect power to the programming
board and connect the programming board to a PC using a
serial cable (a USB to serial may be used).
-
Program motes
with SurgeReliable
-
Open Cygwin
-
change to
surge reliable source directory
cd
/opt/tinyos-1.x/contrib/xbow/apps/Surge_Reliable
-
open the
Makefile and make sure that the line under 'For MICA2
and MICA2DOT' is uncommented, and make sure that the
line below 'For MICAZ' is commented by placing a # at
the front of the line
-
the syntax to
build applications is
make
<platform> [re]install,<ID> <prorammer>,<port>
-
the ID is
the unique node ID to give each mote
-
the port
is the port of serial connection (for me, com4)
-
program base
station mote, enter
make mica2
install,0 mib510,com4 (substitute com port)
-
program other
motes, enter
make mica2
reinstall,<ID> mib510,com4
-
SurgeReliable
will program the motes to transmit sensor board data
every 4 seconds. The data packets will be
forwarded to the base node (ID 0).
Collecting Data
-
Connect the base
radio mote (ID 0) to a stargate, connect sensor boards to
the other radio motes and turn them on. (Information
from this point forward will be based on connection of
MTS300CA/310CA sensor boards to the radios)
-
Collect data on
stargate
The data coming
into the stargate from the base radio over the serial
connection is a raw data packet. This packet must be
decoded to extract the desired data. Each type of
message can have a different format, the messages that we
are interested in for this project are Surge Messages.
There are four levels of hierarchy to the header format for
this message. They are:
1. Raw packet
header
2. TinyOS
message header
3. Multi-hop
message header
4. Surge
message header
- The sync byte is always 0x7E
- Any byte in the packet with value 0x7E or 0x7D is
encoded by inserting 0x7D prior to the byte and XORing
the byte with 0x20 (i.e. 0x7E will be represented by
0x7D5E)
- Multi-byte fields in the raw packet are in Little
Endian notation
- Battery voltage/sequence # field is a combination of
the two values. The nine most significant bits are
the battery level, and the 23 least significant bits are
the sequence #. (Convert to Big Endian notation
before trying to divide)
- The fields that should be checked to verify a surge
message are:
|
Packet type |
0x42 |
P_PACKET_NO_ACK |
|
Message type |
0x11 |
AMTYPE_SURGE_MSG |
|
Type |
0x00 |
SURGE_TYPE_SENSORREADING |
- For more information and manuals on the sensor
boards of the crossbow motes,
visit here.
- For more information and manuals on the mica2
radios
visit here.
- For a tutorial on TinyOS
visit here.
|
|
|