[Tinyos-help] Re: LowPowerSensing

Kevin Klues klueska at cs.stanford.edu
Sun Feb 24 10:19:15 PST 2008


Hi Ian.

You're right about the README file, its not there and I can't seem to
find it anywhere :)  I know I created it at the time I checked the app
in, but somehow it must have gotten lost in the shuffle somehow.  I
'll see about writing a new one when I get some time soon.  For now
though, what sort of questions do you have exactly that I could answer
now?  See below for answers to the rest fo your comments....

>  I also noticed that the Sampler part wouldn't compile - I fixed this by
>  changing
>
>  SampleSend.getPayload(&sample_msg, sizeof(nx_sample));
>
>  to:
>
>  SampleSend.getPayload(&sample_msg);

I think the problem here is that the app exists in cvs where a newer
version of the Packet interface has been defined for the upcoming 2.1
release.  The application therefore uses the newer version of the
interface instead of the one used in the tinyos-2.0.2 release.  (I
assume this is the version you are using, no?).  Your fix is
completely valid for this release.

>  Anyway I got the basestation & sampler compiled and loaded onto tmote skys,
>  started a serialforwarder and ran the java application.  Values were returned
>  although I'm a bit confused about the sample.sin_value that is returned.

So the sample.sin_value is the result of using a general purpose
sensor so that the application will compile on a cross-platform basis.
 The sensor is in fact a "software sensor" that simply runs through
and generates values consistent with a sign wave.

>  What I want to do is return all four sensor readings and set the sample rate
>  to be approx once every hour (not 3000 milliseconds as in your demo).

To do this you need to change just two flags sent in to the makefile
when compiling the Sampler app.  So if you open up the makefile
LowPowerSensing/Sampler/Makefile, and change the line:

CFLAGS += -I.. -I../sampleLog -I../universal_sensors

to

CFLAGS += -I.. -I../sampleLog -I../tmote_onboard_sensors

and then add this line directly after that:

PFLAGS += -DSAMPLING_INTERVAL=(60*1024*60)

This should do exactly what you want.  (By the way, this is the sort
of stuff that was originally in that readme that somehow seems to have
never made it into cvs.....)

Let me know how it goes.

Oh, and I'm forwarding this to tinyos-help so that others can benefit
from your question.

-- 
~Kevin


More information about the Tinyos-help mailing list