EnviroLog Manual

Created 12 Jan 2005
Last updated 12 Jan 2005

Introduction

EnviroLog is a middleware used to enable environmental event recording and replay. Using its user interface, you can define one or multiple commands/ events to be recorded and replayed. You can also control the mode (RECORD or REPLAY) of the system at runtime. During RECORD mode, these commands/ events and their parameters will be recorded into flash at runtime. During REPLAY mode, these commands/events will be called/signaled with recorded parameters at their original time sequences.

Quick Start

  1. Install EnviroLog
        $ cp EnviroLog.tar.gz `ncc -print-tosdir`/../contrib/
        $ cd `ncc -print-tosdir`/../contrib/
        $ tar zxvf EnviroLog.tar.gz
  2. Use the new TinyOS Make System
        $ export MAKERULES=`ncc -print-tosdir`/../tools/make/Makerules
  3. Modify your application Makefile to contain the following lines:
        $ TOSMAKE_PATH += $(TOSDIR)/../contrib/EnviroLog/make
        $ include $(MAKERULES)
  4. Select commands/events to be recorded and replayed by adding annotation /*LOG_FUNCTION*/ before the clauses that call/signal the commands/events.
    For example, to record the following command:
        call Leds.redToggle();
    change it to:
        /*LOG_FUNCTION*/call Leds.redToggle();
    To record the following event:
        signal Timer.fired();
    change it to:
        /*LOG_FUNCTION*/signal Timer.fired();
    You can find some code sample in ./sample.
  5. Make sure your application compiles, by
        $ make mica2
  6. Use EnviroLog preprocessor to integrate EnviroLog with your annotated application (assuming you are using MICA2 platforms)
        make mica2 envirolog
  7. Compile resulted application and install into MICA2 platforms (assuming you are using a MIB510 programming board)
        $ make mica2 install mib510,com1
  8. You have two choices now:
    1. Keep current mote (mote A) connected with PC and continue with step 9.
    2. Find another mote (mote B), install TOSBase application into it, keep mote B connected with PC, place mote A within one hop from mote B, and continue with step 9.
  9. Set MOTECOM:
        $ export MOTECOM=serial@COM1:mica2 
  10. Start RECORD mode
        $ java net.tinyos.tools.BcastInject start_sensing 0 101 
  11. When you decide to stop recording, stop RECORD mode
        $ java net.tinyos.tools.BcastInject start_sensing 1 101 
  12. Start to replay the recorded data, entering REPLAY mode:
        $ java net.tinyos.tools.BcastInject start_sensing 4 101 
  13. To enter normal mode, you have to quit from REPLAY mode:
        $ java net.tinyos.tools.BcastInject start_sensing 5 101