Updated documentation for new APIs.
This commit is contained in:
parent
27d5e2338a
commit
a6c6522548
4 changed files with 71 additions and 63 deletions
|
@ -5,7 +5,7 @@
|
|||
\defgroup esb The ESB Embedded Sensor Board
|
||||
|
||||
The ESB (Embedded Sensor Board) is a prototype wireless sensor network
|
||||
device developed at Freie Universität Berlin.
|
||||
device developed at FU Berlin.
|
||||
|
||||
<img src="img/esb/esb.jpg" align="right">
|
||||
|
||||
|
@ -99,21 +99,21 @@ Adam Dunkels, SICS, which is very well suited when programming small
|
|||
embedded systems.
|
||||
|
||||
The Contiki OS can be found at:
|
||||
http://www.sics.se/~adam/contiki/
|
||||
http://www.sics.se/contiki/
|
||||
|
||||
Unzip the Contiki OS at (for example) C:\\
|
||||
and you will get the following directories among others:
|
||||
|
||||
- contiki-2.x/core - the contiki operating system
|
||||
- contiki-2.x/platform/esb - the contiki operating system drivers, etc for the ESB
|
||||
- contiki-2.x/platform/esb/apps/ - example applications for the ESB
|
||||
- contiki-2.x/examples/esb/ - example applications for the ESB
|
||||
|
||||
\subsection winintro-testing Testing the tools
|
||||
|
||||
Now everything necessary to start developing Contiki-based sensor net
|
||||
applications should be installed. Start cygwin and change to the
|
||||
directory <tt>contiki-2.x/platform/esb/</tt>. Then call <tt>make
|
||||
beeper.co</tt>.
|
||||
directory <tt>contiki-2.x/examples/esb/</tt>. Then call <tt>make
|
||||
beeper.esb</tt>.
|
||||
|
||||
If you get an error about multiple cygwin dlls when compiling, you
|
||||
need to delete <tt>cygwin1.dll</tt> from the MSP430 GCC toolchain
|
||||
|
@ -129,7 +129,7 @@ for sending to the ESB nodes. Depending on the \c SPEC it might even
|
|||
startup the application that sends the executable to the
|
||||
node. Typically you would write things like <tt>"make beeper.u"</tt>
|
||||
to get the file <tt>beeper.c</tt> compiled, linked and sent out to the
|
||||
ESB node
|
||||
ESB node.
|
||||
|
||||
\subsection winintro-testing-shell Some basic shell commands
|
||||
|
||||
|
@ -158,9 +158,9 @@ directory and run
|
|||
|
||||
<tt>make burn-nodeid.u nodeid=X</tt>
|
||||
|
||||
Where <tt>X</tt> is the node ID that will be burned into EEPROM. The
|
||||
where <tt>X</tt> is the node ID that will be burned into EEPROM. The
|
||||
<tt>burn-nodeid</tt> program stores the node ID in EEPROM, reads it
|
||||
back, and writes the output
|
||||
back, and writes the output to the serial port.
|
||||
|
||||
@{
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ The ESB is equipped with an MSP430 microcontroller. The first step to
|
|||
getting started with Contiki for the ESB is to install the development
|
||||
tools for compiling Contiki for the MSP430.
|
||||
|
||||
For Windows users, see \ref esb-winintro
|
||||
For Windows users, see \ref esb-win-setup
|
||||
|
||||
|
||||
@{
|
||||
|
|
|
@ -4,29 +4,32 @@
|
|||
|
||||
\section sensors Sensor functions
|
||||
|
||||
Some sensors generate events when the sensors change. It is always
|
||||
possible to query the state of a sensor through a set of query functions.
|
||||
Each sensor has a set of functions for controlling it and query it for
|
||||
its state. Some sensors also generate an events when the sensors
|
||||
change. A sensor must be activated before it generates events or
|
||||
relevant values.
|
||||
|
||||
\subsection quickref-sensors-events Sensor events
|
||||
- SENSORS_ACTIVATE(sensor) - activate the sensor
|
||||
- SENSORS_DEACTIVATE(sensor) - deactivate the sensor
|
||||
- sensor.value(0) - query the sensor for its last value
|
||||
|
||||
- \ref sensors_event_button_down - the button has been pressed
|
||||
- \ref sensors_event_button_up - the button has been depressed
|
||||
- \ref sensors_event_humidity - a change in humidity has been detected
|
||||
- \ref sensors_event_light - a change in light has been detected
|
||||
- \ref sensors_event_motion - motion has been detected
|
||||
- \ref sensors_event_sound - sound has been detected
|
||||
- \ref sensors_event_temperature - temperature has changed
|
||||
- \ref sensors_event_vibration - vibration has been detected
|
||||
- \ref sensors_event - event sent when a sensor has changed (the data
|
||||
argument will referer to the actual sensor)
|
||||
|
||||
\subsection quickref-sensors-query Sensor query functions
|
||||
Example for querying the button:
|
||||
|
||||
- sensors_battery() - query the battery voltage level
|
||||
- sensors_button() - query the on-board button
|
||||
- sensors_mic() - query the microphone
|
||||
- sensors_pir() - query the passive IR sensor (motion detector)
|
||||
- sensors_radiosignal() - query the radio signal strength
|
||||
- sensors_temp() - query the temperature sensor
|
||||
- sensors_vib() - query the vibration sensor
|
||||
- \ref SENSORS_ACTIVATE(button_sensor) - activate the button sensor
|
||||
- \ref button_sensor.value(0) - the button has been pressed or not
|
||||
|
||||
\subsection quickref-sensors Sensor on the ESB platform
|
||||
|
||||
- \ref battery_sensor - query the battery voltage level
|
||||
- \ref button_sensor - query the on-board button
|
||||
- \ref pir_sensor - query the passive IR sensor (motion detector)
|
||||
- \ref radio_sensor - query the radio signal strength
|
||||
- \ref sound_sensor - query the microphone
|
||||
- \ref temperature_sensor - query the temperature sensor
|
||||
- \ref vib_sensor - query the vibration sensor
|
||||
|
||||
\section quickref-leds LED functions
|
||||
|
||||
|
@ -45,10 +48,10 @@ possible to query the state of a sensor through a set of query functions.
|
|||
|
||||
\section quickref-timers Timer functions
|
||||
|
||||
Contiki supports two types of timers: event timers and simple
|
||||
timers. Event timers generates an event when the timer expires,
|
||||
whereas the simple timer has to be actively queried to check when it
|
||||
has expired.
|
||||
Contiki provides a set of timer libraries. Event timers generates an
|
||||
event when the timer expires and callback timers call a function when
|
||||
the timer expires. The simple timers on the other hand have to be
|
||||
actively queried to check when they have expired.
|
||||
|
||||
\subsection quickref-etimer Event timers
|
||||
|
||||
|
@ -57,6 +60,13 @@ has expired.
|
|||
- etimer_reset() - set an expired event timer to the next interval
|
||||
- etimer_restart() - restart an event timer from the current point in time
|
||||
|
||||
\subsection quickref-ctimer Callback timers
|
||||
|
||||
- ctimer_expired() - check if a callback timer has expired
|
||||
- ctimer_set() - set a callback timer
|
||||
- ctimer_reset() - set an expired callback timer to the next interval
|
||||
- ctimer_restart() - restart a callback timer from the current point in time
|
||||
|
||||
\subsection quickref-timer Simple timers
|
||||
|
||||
- timer_expired() - check if a simple timer has expired
|
||||
|
|
|
@ -64,12 +64,29 @@ TCP/IP'.
|
|||
|
||||
\section slipintro-setup Setup ESB for over the air programming
|
||||
|
||||
-# Make sure you have the latest version of contiki (older versions of
|
||||
contiki might not work with SLIP under Windows)
|
||||
-# Install the contiki kernel by running
|
||||
Make sure you have the latest version of Contiki (older versions of
|
||||
Contiki might not work with SLIP under Windows).
|
||||
|
||||
-# Each node needs an IP address for OTA to work. The node id
|
||||
is used to construct an IP address for the node. If you specify 2 as
|
||||
node id, the node will have the IP address 172.16.1.2. Each node
|
||||
should have its own unique node id. To set the node id move to the
|
||||
directory '<tt>contiki-2.x/examples/esb</tt>' and run
|
||||
\code
|
||||
make core.u
|
||||
make burn-nodeid.u nodeid=X
|
||||
\endcode
|
||||
Use the number 1, 2, 3, etc, as the node id (\c X) for the nodes. This
|
||||
will give the nodes the IP addresses 172.16.1.1, 172.16.1.2, etc. The
|
||||
node id only needs to be set once for each node and it will remain
|
||||
even when new applications are uploaded onto the node.
|
||||
-# You need to compile a core and upload it onto the nodes. All nodes
|
||||
must run the same core. Move to the directory
|
||||
'<tt>contiki-2.x/examples/esb</tt>' and run
|
||||
\code
|
||||
make WITH_CODEPROP=1 core
|
||||
make WITH_CODEPROP=1 core.u
|
||||
\endcode
|
||||
to upload the core to your nodes.
|
||||
-# Attach the ESB node to the serial port and make sure it is
|
||||
turned on. Select your ESB SLIP connection in your 'Network
|
||||
Connections' and choose 'Connect' (or double click on it). If
|
||||
|
@ -84,37 +101,18 @@ ping 172.16.1.1
|
|||
|
||||
If everything works the node should click and reply to the pings.
|
||||
|
||||
\section slipintro-send Send programs over the air
|
||||
|
||||
Contiki applications to be installed via radio are compiled somewhat
|
||||
different compared to normal applications.
|
||||
|
||||
Each node needs an IP address for OTA to work. A node id can be
|
||||
specified when you upload the contiki kernel to a node and this is
|
||||
used to construct an IP address for the node. If you specify 2 as
|
||||
node id, the node will have the IP address 172.16.1.2. Each node
|
||||
should have its own unique node id.
|
||||
|
||||
You need to compile a core and upload it onto the nodes. All nodes
|
||||
must run the same core. Move to the directory
|
||||
'<tt>contiki-2.x/platform/esb</tt>' and run
|
||||
|
||||
\code
|
||||
make
|
||||
make core.u nodeid=X
|
||||
\endcode
|
||||
|
||||
to upload the core to your nodes. Use the number 1, 2, 3, etc,
|
||||
as the node id (\c X) for the nodes. This will give the nodes the IP
|
||||
addresses 172.16.1.1, 172.16.1.2, etc.
|
||||
|
||||
Then you need a program to send the application to connected
|
||||
You also need a program to send the application to connected
|
||||
nodes. Compile it by running
|
||||
|
||||
\code
|
||||
make send
|
||||
\endcode
|
||||
|
||||
\section slipintro-send Send programs over the air
|
||||
|
||||
Contiki applications to be installed via radio are compiled somewhat
|
||||
different compared to normal applications.
|
||||
|
||||
Make sure you have a node with IP address 172.16.1.1 connected to your
|
||||
serial port and have SLIP activated. Then compile and send a
|
||||
testprogram by running
|
||||
|
|
Loading…
Reference in a new issue