Show README syntax highlighted
$Id: README,v 1.2 2003/10/23 21:20:34 vladimir Exp $
The "New MoteNIC"
-----------------
21 Feb 2003
The "mote" directory contains the source for the New MoteNIC. This
README file describes its design, and how to extend it.
The first thing to remember is that "MoteNIC" is really a misnomer.
This software is a collection of daemons that give Linux-based
programs access to various functions of the Mote. Originally, the
only one of these functions was sending and receiving packets, hence
the name "MoteNIC". However, there are now other functions, such as
querying the mote for values of its sensors, and performing time
synchronization between the Linux clock and the Mote's clock.
Communication between the Linux host and the Mote is performed using
the "Host-Mote Protocol". This is a simple protocol with a
fixed-length header followed by variable length data, and is mainly
responsible for framing messages over the serial port. Host-Mote
protocol messages have a "type" associated with them, describing which
module (NIC, sensor, configuration, synchronization, etc.) should
process the packet.
The host-mote protocol is defined in the header file:
tos/tinyos-1.x/tos/system/host_mote.h
The contents of the variable-length data portion of a Host-Mote packet
depends on the module. For example:
-- For NIC-type packets, the data is either a flow-control packet
(request to send, clear to send...), or a TOS_Msg that was either
just received on the radio or which is being given to the mote to
send on the radio.
-- For Configuration-type packets, the data is a structure describing
the configuration of the mote (its POT value, Group ID, etc.)
-- For Sensor-type packets, the data is a series of sensor values from
the mote's ADC, or a request to configure the ADC.
The details of each of these "sub-protocols" that runs over the
Host-Mote protocol are documented in other README files in this
directory.
The Design of the Software
--------------------------
On the Linux side, the implementation of the mote software is now
distributed into multiple modules, each of which is responsible for
one function.
The "master" module, hostmoted, is the only daemon that deals directly
with the serial port. It is responsible for the low-level handling of
the host-mote protocol -- that is, framing and packetizing the
incoming serial stream. It then feeds the hostmote packets to other
daemons, each of which can open hostmoted's device file and tell it
what kind of hostmote packets it wants (e.g. NIC, Sensor, etc.).
Extending the Host-Mote protocol consists of the following steps:
1- Define a new "op type" in the host-mote protocol header.
2- Add code to the mote-side (transceiver) app that knows how to deal
with this op.
3- Create a new daemon to handle your protocol on the Linux sid,
similar to the "motenic" and "motesens" daemons (in the nic and sens
directories, respectively). Each of these daemons gets packets of a
particular op-type from hostmoted and does something useful with them.
See more files for this project here