Hands on experiments with micaz, MTS310 and MIB520

This post is after the first set of trials with micaz mote. Till now worked only with telosb, which has usb interface and programming in single board including sensors on board.
This experiment is not conducted in avrora or any emulator.

Mote used- Micaz- CC2420 Radio (Zig-Bee compliant) : The range was much better than Telosb. It gave 21metres compared to 8 metres in telosb.
Following image shows Micaz mounted with MTS310 sensor board

Sensor Board- MTS310 ( light, temp, acoustic,acoustic actuator, seismic, magnetometer sensors)

Programming board- MIB520CB USB/JTAG

The first program came to my mind was to make buzzer on. After searching for the platform files, in mts300 board folder (/opt/tinyos-2.1.0/tos/sensorboards) I found Sounder file.
The application I wrote has 2 files BuzzerC and BuzzerP
BuzzerC
configuration BuzzerC {
}
implementation {
components MainC, BuzzerP, LedsC,SounderC ,new TimerMilliC() as MyTimer;;

MainC.Boot <- BuzzerP;
BuzzerP.Mts300Sounder -> SounderC;
BuzzerP.Leds -> LedsC;
BuzzerP.Beep -> MyTimer;
}

BuzzerP
module BuzzerP
{
uses
{
interface Boot;
interface Mts300Sounder;
interface Timer as Beep;
interface Leds;
}
}
implementation
{
uint8_t count=0;
event void Boot.booted()
{
call Beep.startPeriodic(500);

}
event void Beep.fired()
{

count++;

if((count==2))
{
call Leds.led0Toggle();
call Leds.led1Toggle();
call Leds.led2Toggle();
count=0;
call Mts300Sounder.beep(10);
}
}
}

The code is self explanatory....

Following was the error came while compiling
"Programmer is not responding"
This is because MIB520 has 2 usb ports. One used for programming and other for data.
The "motelist" command will not list any mote connected to MIB520. Instead you have to go to system log and check for the two usb ports activated after pluging in the board. Assuming that first one is usb0 and second one is usb1, the syntax for uploading a new program is "make micaz reinstall.2 mib510,/dev/ttyUSB0" where 2 is the node id

Now you can test the "Antitheft" application which worked fine after giving /dev/ttyUSB1:micaz for serialforwarder

8 comments:

Ashwin said...

Ah, yes... these are what I am familiar with... very useful for noobs like myself

Ashwin said...

>>'make micaz reinstall(.2) ...'
Doesn't it work even without the ".2" following reinstall

Gireesh said...

reinstall is another option for already compiled one.
"install" may work

Ashwin said...

As per your post, it's for the node id, but is it always necessary to give the node id?

Gireesh said...

Depends on application
In AntiTheft or any protocol using collection or dissemination kind of things, its compulsory

Anonymous said...

Why do you use mib510 in the command line instead of mib520 ? Any particular reason? I am trying to get mine work with mib520, but am stuck !! Any help would be appreciated.

Gireesh said...

mib520 s upgrade of mib510 board.
But tinyos repository does not have entries for that in Makefile / configuration file
Anyways; it is just a programming board; as long as it allow us to transfer the cross compiled image; it is fine

Anonymous said...

Sir.. please can you help me with how to program "multihop in WSN" using tinyos?