0

I am using Telosb motes, with the help of tutorials, I could able to log the data into flash memory of the mote. But I dont know how to retrieve the logged data from flash memory. Is there any kind of command which has to be given at the linux terminal to do this function. please guide me.

My program is to log the counter value when timer is fired.

module LogC {
  uses {
    interface Boot;
    interface Leds;
    interface Timer<TMilli>;
    interface LogWrite;
  }
}

implementation {
   uint8_t counter=0;

   typedef nx_struct logentry_t {
     nx_uint8_t value;
   } logentry_t;

   logentry_t m_entry;

  event void Boot.booted() {
    call Timer.startPeriodic(200);
  }

  event void Timer.fired() {
    counter++;      
    m_entry.value = counter;
       if( call LogWrite.append(&m_entry, sizeof(logentry_t))==SUCCESS){;
          call Leds.led1Toggle();
       }
  }

  event void LogWrite.appendDone(void* buf, storage_len_t len, 
                                 bool recordsLost, error_t err) {
     call Leds.led0Toggle();
  }

  event void LogWrite.syncDone(error_t err) { }

  event void LogWrite.eraseDone(error_t err) { }

}
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

You need to write an application that uses the LogRead interface to retrieve logged data from a flash memory and, for instance, sends it to a PC using a serial connection (this needs also a Java application on the PC side).

Look here http://www.tinyos.net/tinyos-2.x/doc/html/tep103.html for more information about logging interfaces and here http://tinyos.stanford.edu/tinyos-wiki/index.php/Mote-PC_serial_communication_and_SerialForwarder for tutorial about serial communication between a mote and a PC.

maral
  • 1,431
  • 1
  • 10
  • 15