Re: [Tinyos-help] VoltageM errors??

2006-04-27 Thread davisj2
Rahul,
  Thanks,  I have used VOltageC. But as I have read, I think that VoltageM
returns the value as a direct reference, of mv, VoltageC does not.  Was just
thinking this was a better implementation of obtaining the voltage values.  The
current conversion I have for VoltageC returns values that increase as the
battery dies, this is wierd 

Thanks.
Josh

Quoting Rahul Sawant [EMAIL PROTECTED]:

 Hi
 r u using VoltageC from tos/system if not use this as this is the
 configuration for VoltageM and it includes voltage.h
 if ur using VoltageC then It seems like you dont have the voltage.h file in
 tos/platform/mica2 if u dont just download the attached file
 
 Rahul Sawant
 
 
 On 4/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
  Hey all,
  IM trying to use the VoltageM component with mica2 tinyos-1.1.15, as it
  returns the actually voltage in mv.  However, when I compile i get these
  errors:
 
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc: In
  function `Std
  Control.start':
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67:
  `TOS_ADC_VOLT
  AGE_PORT' undeclared (first use in this function)
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67: (Each
  undecla
  red identifier is reported only once
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67: for
  each func
  tion it appears in.)
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:68:
  `TOSH_ACTUAL_
  VOLTAGE_PORT' undeclared (first use in this function)
  make: *** [exe0] Error 1
 
 
  Any ideas??? thanks so much
 
  -
  This mail sent through IMP: http://horde.org/imp/
  ___
  Tinyos-help mailing list
  Tinyos-help@Millennium.Berkeley.EDU
  https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
 
 




-
This mail sent through IMP: http://horde.org/imp/
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Mica2, CPU Timed Sleep and Wakeup

2006-04-27 Thread Harri Siirtola


First, as far as I know, the Snooze component is deprecated. There are many 
improvements in the newer TInyOS versions that make things much more 
simple. For example, the CountSleepRadio app (previously in contrib/ucb, 
now in the apps dir IIRC) is good for just testing that power saving 
works. It just sends an incremented integer over the air and goes to sleep. 
When a timer expires, the mote wakes up and sends the next one. There's 
another example, apps/examples/TestSleep which toggles a led between 
sleeping periods.


Second, in the current tree, power saving is transparent to the user. When 
there are no interrupts (nor tasks, IIRC) pending, and only Timer 0 
running, power saving kicks in. You can test it with the latest measuring 
apps, just study the make/avr/route.extra to see which commad line 
switches you must use to enable power saving. The 
PowerManagement.AdjustPower() call is deeper down the radio stack and is 
automatic once you compile the app correctly.


Regards,

Harri

At 01:18 PM 4/26/2006 -0600, Michael Schippling wrote:

Sorry, I'm at a loss. I thought that one of the features of the motes
was the ability to sleep between samples to save power, but I never
paid attention to how/where/why this might work. I actually have it
on my list of things to do for a project that I never work on anymore...

Assuming as usual that no one who actually knows how to do this will
answer your question...Perhaps there is something in the atmega spec
book about it?

MS

Gregory A. Moore wrote:

Michael,
Thank you for your response, but:
SnoozeC only works for Mica motes, not Mica2.  They have a slightly 
different processor so I am sure there are some dependency issues that 
don't quite fit.
I have also looked at the OnOffApp which is supposed to essentially be 
the Snooze for the mica2, but it relies on a radio packet to start the 
mote again.

If you have any other suggestions I am greatly appreciative.
Thanks,
Greg


There is a module tos\platform\mica\SnoozeC.nc that purports to
do the shutdown and timer wakeup. And a TestSnooze demo app.
I haven't tried them, YMMV...
MS


Gregory A. Moore wrote:

Hi All,

I have perused the archives about this pesky timed mica2 sleep
problem and have not found
any code snippets or anything of huge benifit.

So I repeat the question:
I am working with Mica2.
I would like to put the mote's CPU to sleep for a set period of  time 
and then have it

awoken by some timer, not an incomming radio packet.

I have done the power measurements with the use of
HPPowerManagementM and I have not
gotten any successful current readings that show me that the module  is 
doing anything in

the way of sleeping.

The code from Berkely's study for P-TOSSIM shows us how to set the
mote's CPU to sleep,
but it does not show us how to wake it up with a timer.

I write nesC well, but I am not an experienced embedded programmer
so I am not quite sure
how to program the awake tasks from the schematics.

I hope there is someone out there who can help me with my woes.

The code snippet I am using to put the mote to sleep is at the end
of this email.

Thank you in advance,

Greg


Successful code. thanks to Berkely folks, to put the mote to sleep:

task void gotoSleep() {
 cli();
 //fires the interupt pin to signal data recording
 //This is PIN5 on the connector, use probe to read signal
 TOSH_SET_INT1_PIN();
 TOSH_CLR_INT1_PIN();

 // set the PA_POW to 00h to ensure lowest possible leakage current
 call CC1000Control.SetRFPower(0x00);

 // power down the radio
 call CC1000StdControl.stop();
 //call CC1000RadioIntM.StdControl.stop();
 //call HPLPowerManagement.adjustPower()


 ///Code taken from Snooze.nc,  this is current code used to
 //put the Mica2 into different low power states
 // save port state
 port[0] = inp(PORTA); nops(8);
 port[1] = inp(PORTB); nops(8);
 port[2] = inp(PORTC); nops(8);
 port[3] = inp(PORTD); nops(8);
 port[4] = inp(PORTE); nops(8);
 port[5] = inp(DDRA);  nops(8);
 port[6] = inp(DDRB);  nops(8);
 port[7] = inp(DDRD);  nops(8);
 port[8] = inp(DDRE);  nops(8);
 port[9] = inp(TCCR0); nops(8);
 // Disable TC0 interrupt and set timer/counter0
 //to be asynchronous from the CPU
 // clock with a second external clock (32,768kHz) driving it.
 //Prescale to 32 Hz.
 cbi(TIMSK, OCIE0);  nops(8);

 // set minimum power state
 // NOTE: this enables pull-ups;
 //   -may be sensor board dependant
 //   - (ex: Port C should be lo during sleep, not hi?)

 outp(0x00, DDRA);// input
 outp(0x01, DDRB);// input

 // changed 00 to ff because the impedance was high in the sleep
 // state, drawing 8mA for 5 sec before sleeping. Now it immediately
 // snoozes.
 outp(0xff, DDRC);// input
 outp(0x00, DDRD);// input
 outp(0x00, DDRE);// input

 outp(0xff, PORTA);// enable pull-ups
 outp(0xfe, PORTB);  // enable pull-ups except for PB0

 // changed the value of PORTC from ff to 0 because ff
 // sounds the alarm when the mote 

[Tinyos-help] MOTE-VIEW

2006-04-27 Thread Daniel Villón
-- Daniel Villón V.---Departamento de Ingeniería Telemática.Universitat Politècnica de Catalunya---
C/. Jordi Girona 1-3Modulo C3 Laboratorio 003Barcelona CP 08034, EspañaTeléfono: +34 93 289 36 71Celular: +34 697 91 43 53e-mail: [EMAIL PROTECTED]
 
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] MOTE-VIEW

2006-04-27 Thread LEE, Yui-wah (Clement)
http://www.xbow.com/Support/Support_pdf_files/MoteView_Users_Manual.pdf

Enjoy!

Clement

On Thu, 27 Apr 2006, [ISO-8859-1] Daniel Vill鏮 wrote:

 I'm currently working in an application  under a variant of AODV protocol
 called NST-AODV(Not So Tiny - AODV). Now I can receive all my data in the
 gateway (MIB510) from MICAz motes but now I'm trying to use the MOTE-VIEW
 software to show my data. The thing is that I can't find any decent manual
 about how to use the MOTE-VIEW. How should I arrange my data to send it by
 the UART so the MOTE-VIEW will understand it. How to use the PostgreSQL to
 create a database, etc.


 Daniel Vill鏮 V.
 ---
 Departamento de Ingenier燰 Telem嫢ica.
 Universitat Polit鋃nica de Catalunya
 ---
 C/. Jordi Girona 1-3
 Modulo C3 Laboratorio 003
 Barcelona CP 08034, Espa鎙
 Tel嶨ono: +34 93 289 36 71
 Celular:   +34 697 91 43 53
 e-mail: [EMAIL PROTECTED]


___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] MOTE-VIEW

2006-04-27 Thread Daniel Villón
Thanks for your help, but I was looking for something morespecific than this. I already read this one.

Daniel
On 4/27/06, LEE, Yui-wah (Clement) [EMAIL PROTECTED] wrote:
http://www.xbow.com/Support/Support_pdf_files/MoteView_Users_Manual.pdf
Enjoy!ClementOn Thu, 27 Apr 2006, [ISO-8859-1] Daniel Vill鏮 wrote: I'm currently working in an applicationunder a variant of AODV protocol called NST-AODV(Not So Tiny - AODV). Now I can receive all my data in the
 gateway (MIB510) from MICAz motes but now I'm trying to use the MOTE-VIEW software to show my data. The thing is that I can't find any decent manual about how to use the MOTE-VIEW. How should I arrange my data to send it by
 the UART so the MOTE-VIEW will understand it. How to use the PostgreSQL to create a database, etc. Daniel Vill鏮 V. ---
 Departamento de Ingenier燰 Telem嫢ica. Universitat Polit鋃nica de Catalunya --- C/. Jordi Girona 1-3 Modulo C3 Laboratorio 003
 Barcelona CP 08034, Espa鎙 Tel嶨ono: +34 93 289 36 71 Celular: +34 697 91 43 53 e-mail: [EMAIL PROTECTED]
-- Daniel Villón V.---Departamento de Ingeniería Telemática.Universitat Politècnica de Catalunya---
C/. Jordi Girona 1-3Modulo C3 Laboratorio 003Barcelona CP 08034, EspañaTeléfono: +34 93 289 36 71Celular: +34 697 91 43 53e-mail: [EMAIL PROTECTED]
 
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Please Help me about system time getting

2006-04-27 Thread Kyuwook Cho
Hi all, 

I'm currently trying to get system time from Mica mote. 
But I'm only getting always 0 as time return value. How can I get system time value?

Here is the code for getting system time and its output by running java
net.tinyos.tools.Listen. And I'm using original Mica mote.

-- output --
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 
7E 00 64 7D 08 00 00 00 00 00 00 00 00 

 configuration ---
configuration TimePut {
}

implementation {
 components Main, TimePutM, TimerC, SimpleTime/*LogicalTime*/, UARTComm as Comm, LedsC;

 Main.StdControl - TimePutM;
 Main.StdControl - TimerC;

 TimePutM.CommControl - Comm;
 TimePutM.SendMsg - Comm.SendMsg[AM_TIMEPUT];
 
 TimePutM.Leds - LedsC;

 TimePutM.Time - SimpleTime.Time;//LogicalTime.Time;
 TimePutM.Timer - TimerC.Timer[unique(Timer)];
}

- module --
includes TosTime;

module TimePutM {
 provides {
 interface StdControl;
 }
 uses {
 interface StdControl as CommControl;
 interface Time;
 interface Timer;
 interface Leds;
 interface SendMsg;
 }
}

implementation {
 TOS_Msg tMsg;
 tos_time_t currentTime;

 task void dataTask() {
 struct TimeMsg *dataMsg;
 dataMsg = (struct TimeMsg *)tMsg.data;
 
 currentTime = call Time.get();
 dataMsg-lowtime = currentTime.low32;
 dataMsg-hightime = currentTime.high32;
 //dataMsg-lowtime = call Time.getLow32();
 //dataMsg-hightime = call Time.getHigh32();
 //dbg(DBG_USR1, Current Time is %i, %i\n, high, low);

 if(call SendMsg.send(TOS_UART_ADDR, sizeof(struct TimeMsg), tMsg)) {
 call Leds.greenToggle();
 }
 }

 command result_t StdControl.init() {
 dbg(DBG_USR1, initialized!!\n);  
 call Leds.init();
 call CommControl.init();
 return SUCCESS;
 }
 
 command result_t StdControl.start() {
 call CommControl.start();
 return call Timer.start(TIMER_REPEAT, 2048);
 }
 
 command result_t StdControl.stop() {
 call CommControl.stop();
 return call Timer.stop();
 }

 event result_t Timer.fired() {
 post dataTask();
 return SUCCESS;
 }

 event result_t SendMsg.sendDone(TOS_MsgPtr pMsg, result_t success) {
 call Leds.redToggle();
 return SUCCESS;
 }
}
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Mica2, CPU Timed Sleep and Wakeup

2006-04-27 Thread Michael Schippling

wow...coulda fooled me about the automatic part...kewel.
Will have to try it sometime.
Which is the current tree however?
MS

Harri Siirtola wrote:


First, as far as I know, the Snooze component is deprecated. There are 
many improvements in the newer TInyOS versions that make things much 
more simple. For example, the CountSleepRadio app (previously in 
contrib/ucb, now in the apps dir IIRC) is good for just testing that 
power saving works. It just sends an incremented integer over the air 
and goes to sleep. When a timer expires, the mote wakes up and sends the 
next one. There's another example, apps/examples/TestSleep which 
toggles a led between sleeping periods.


Second, in the current tree, power saving is transparent to the user. 
When there are no interrupts (nor tasks, IIRC) pending, and only Timer 0 
running, power saving kicks in. You can test it with the latest 
measuring apps, just study the make/avr/route.extra to see which 
commad line switches you must use to enable power saving. The 
PowerManagement.AdjustPower() call is deeper down the radio stack and 
is automatic once you compile the app correctly.


Regards,

Harri

At 01:18 PM 4/26/2006 -0600, Michael Schippling wrote:

Sorry, I'm at a loss. I thought that one of the features of the motes
was the ability to sleep between samples to save power, but I never
paid attention to how/where/why this might work. I actually have it
on my list of things to do for a project that I never work on anymore...

Assuming as usual that no one who actually knows how to do this will
answer your question...Perhaps there is something in the atmega spec
book about it?

MS

Gregory A. Moore wrote:

Michael,
Thank you for your response, but:
SnoozeC only works for Mica motes, not Mica2.  They have a slightly 
different processor so I am sure there are some dependency issues 
that don't quite fit.
I have also looked at the OnOffApp which is supposed to essentially 
be the Snooze for the mica2, but it relies on a radio packet to start 
the mote again.

If you have any other suggestions I am greatly appreciative.
Thanks,
Greg


There is a module tos\platform\mica\SnoozeC.nc that purports to
do the shutdown and timer wakeup. And a TestSnooze demo app.
I haven't tried them, YMMV...
MS


Gregory A. Moore wrote:

Hi All,

I have perused the archives about this pesky timed mica2 sleep
problem and have not found
any code snippets or anything of huge benifit.

So I repeat the question:
I am working with Mica2.
I would like to put the mote's CPU to sleep for a set period of  
time and then have it

awoken by some timer, not an incomming radio packet.

I have done the power measurements with the use of
HPPowerManagementM and I have not
gotten any successful current readings that show me that the 
module  is doing anything in

the way of sleeping.

The code from Berkely's study for P-TOSSIM shows us how to set the
mote's CPU to sleep,
but it does not show us how to wake it up with a timer.

I write nesC well, but I am not an experienced embedded programmer
so I am not quite sure
how to program the awake tasks from the schematics.

I hope there is someone out there who can help me with my woes.

The code snippet I am using to put the mote to sleep is at the end
of this email.

Thank you in advance,

Greg


Successful code. thanks to Berkely folks, to put the mote to sleep:

task void gotoSleep() {
 cli();
 //fires the interupt pin to signal data recording
 //This is PIN5 on the connector, use probe to read signal
 TOSH_SET_INT1_PIN();
 TOSH_CLR_INT1_PIN();

 // set the PA_POW to 00h to ensure lowest possible leakage current
 call CC1000Control.SetRFPower(0x00);

 // power down the radio
 call CC1000StdControl.stop();
 //call CC1000RadioIntM.StdControl.stop();
 //call HPLPowerManagement.adjustPower()


 ///Code taken from Snooze.nc,  this is current code used to
 //put the Mica2 into different low power states
 // save port state
 port[0] = inp(PORTA); nops(8);
 port[1] = inp(PORTB); nops(8);
 port[2] = inp(PORTC); nops(8);
 port[3] = inp(PORTD); nops(8);
 port[4] = inp(PORTE); nops(8);
 port[5] = inp(DDRA);  nops(8);
 port[6] = inp(DDRB);  nops(8);
 port[7] = inp(DDRD);  nops(8);
 port[8] = inp(DDRE);  nops(8);
 port[9] = inp(TCCR0); nops(8);
 // Disable TC0 interrupt and set timer/counter0
 //to be asynchronous from the CPU
 // clock with a second external clock (32,768kHz) driving it.
 //Prescale to 32 Hz.
 cbi(TIMSK, OCIE0);  nops(8);

 // set minimum power state
 // NOTE: this enables pull-ups;
 //   -may be sensor board dependant
 //   - (ex: Port C should be lo during sleep, not hi?)

 outp(0x00, DDRA);// input
 outp(0x01, DDRB);// input

 // changed 00 to ff because the impedance was high in the sleep
 // state, drawing 8mA for 5 sec before sleeping. Now it immediately
 // snoozes.
 outp(0xff, DDRC);// input
 outp(0x00, DDRD);// input
 outp(0x00, DDRE);// input

 outp(0xff, PORTA);// enable 

Re: [Tinyos-help] VoltageM errors??

2006-04-27 Thread Michael Schippling

The VoltageC return value increases as the battery decreases because
the ADC is reading a fixed value (the Bandgap ref) and comparing it
to the ADC Reference which is the battery voltage itself. So as the
ADCref (battery) drops, the value of the fixed BGref appears to increase.

Did that make sense, semantically at least?

MS


[EMAIL PROTECTED] wrote:

Rahul,
  Thanks,  I have used VOltageC. But as I have read, I think that VoltageM
returns the value as a direct reference, of mv, VoltageC does not.  Was just
thinking this was a better implementation of obtaining the voltage values.  The
current conversion I have for VoltageC returns values that increase as the
battery dies, this is wierd 


Thanks.
Josh

Quoting Rahul Sawant [EMAIL PROTECTED]:


Hi
r u using VoltageC from tos/system if not use this as this is the
configuration for VoltageM and it includes voltage.h
if ur using VoltageC then It seems like you dont have the voltage.h file in
tos/platform/mica2 if u dont just download the attached file

Rahul Sawant


On 4/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Hey all,
IM trying to use the VoltageM component with mica2 tinyos-1.1.15, as it
returns the actually voltage in mv.  However, when I compile i get these
errors:

C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc: In
function `Std
Control.start':
C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67:
`TOS_ADC_VOLT
AGE_PORT' undeclared (first use in this function)
C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67: (Each
undecla
red identifier is reported only once
C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67: for
each func
tion it appears in.)
C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:68:
`TOSH_ACTUAL_
VOLTAGE_PORT' undeclared (first use in this function)
make: *** [exe0] Error 1


Any ideas??? thanks so much

-
This mail sent through IMP: http://horde.org/imp/
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help






-
This mail sent through IMP: http://horde.org/imp/
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] MICA2 radio doubt....urgent help needed

2006-04-27 Thread Aditya Bhave
Hi all,I have already posted this question before but havent got any satisfactory replies. Everyone seems to say to dig through the various layers of code and figure it out. I need to know how the radio works on the MICA2 motes. Does anybody know for sure...specifically i have two questions
1. From the tutorial, it seems that the send buffer is 1 packet wide. Can someone explain how exactly the send() command of GenericComm works. IS it a blocking or non blocking send? What happens if i try to send packet2 while packet1 is still being transmitted? Does the lower layer protocol take care of collisions etc
2. The same doubt is with receive. How big is the receivers buffer? What happens if I am inside a receive() event, processing packet1 and packet2's receive event is triggered. Will my one-packet size buffer be overwriiten? Can I do something like this in my code
event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr msg){ /* extract the payload field, AnchorXY is my custom defined packet, i know for sure this event is triggered on receiving a packet of this type */
 struct AnchorXY *q = (AnchorXY*)(msg - data);  /* do some processing on this data call a local function process() */ process(*q); /* Multi-hop this message */
 call SendMsg.send(TOS_BCAST_ADDR, sizeof(struct AnchorXY), msg); return msg;}The above code is sometimes working sometimes not. I suspect its because the send() command is non blocking therefore msg is returned to TinyOS before it is sent over the radio. Now maybe the buffer is getting overwritten with next received packet and that is why some packets are not getting sent. Is my reasoning right?
I request someone to please provide detailed explanation on how the radio works. The pdf file that comes with the CD isnt of much help. What does an application programmer need to know about send and receive to avoid the problems we are facing..(packets not getting sent). I am using the latest TinyOS . I dont know the number...think 
1.1.0... I ordered the prof kit from Crossbow just a month back.Thanx in advance-- regards,Aditya Bhave

___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Re: MICA2 radio doubt....urgent help needed

2006-04-27 Thread Muthiah Annamalai
I have already posted this question before but havent got any satisfactoryreplies. Everyone seems to say to dig through the various layers of code and figure it out.  I need to know how the radio works on the MICA2 motes.Please read the tutorial in the tinyos-1.x/doc/ directory.I think TinyOS tutorial is one of the best written, contraryto what you say or think.1. From the tutorial, it seems that the send buffer is 1 packet wide. Can someone explain how exactly the send() command of GenericComm works. IS it a blocking or non blocking send? Send command is non-blocking. Which is how most of TinyOSis written like an event-drive system.What happens if i try to send packet2 while packet1 is still being transmitted?You get a SUCCESS or FAIL when from your 'call Radio.SendMsg()'depending on the conditions. Generally it will resultin failure, and you may
 need to wait for the SendDone() eventbefore you transmit the next packet. Which is why,one should use Queues to do the transmission, as explainedin various tutorial examples like /apps/TOSBase/  Does the lower layer protocol take care of collisions etcI dont think so.2. The same doubt is with receive. How big is the receivers buffer? If you use the default TinyOS AM stack, it is 29 bytes for your payload. For more payload size hackyour way.What happens if I am inside a receive() event, processing packet1 and packet2's receive event is triggered. Will my one-packet size buffer be overwriiten?Again this question is well answered in the Tutorial.You need to do processing withing 'tasks'. See the exampleon OscilloscopeRF/.Can I do something like this in my codeevent TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr msg){   /* extract the payload
 field, AnchorXY is my custom defined packet, iknow for sure this event is triggered on receiving a packet of this type */  struct AnchorXY *q = (AnchorXY*)(msg - data);  /* do some processing on this data call a local function process()*/ process(*q);/* Multi-hop this message */   call SendMsg.send(TOS_BCAST_ADDR, sizeof(struct AnchorXY), msg);  return msg;}you should do this whole thing as a task. Read more abouthow tasks dont interrupt each other, and how they are queued etc, in the tutorial.Basically you code must be more like:task void processData(){  /* do Yada Yada */  call Radio.SendMsg(... )}event TOS_MsgPtr ReceiveMsg.receive(TOS_MsgPtr msg){struct AnchorXY *q = (AnchorXY*)(msg - data);SWAP_OLD_AND_NEW_BUFFERS(q,old);   
 COPY_OLD_TO_YOUR_Q(old);   post processData();return msg;}The above code is sometimes working sometimes not. I suspect its because thesend() command is non blocking therefore msg is returned to TinyOS before itis sent over the radio. Now maybe the buffer is getting overwritten withnext received packet and that is why some packets are not getting sent. Ismy reasoning right?Dont know, but it can cause race conditions and lots of runtime [unwanted]magic.Hope you have some time to read the tutorial before askingquestions.
	
		Yahoo! Mail goes everywhere you do.  Get it on your phone.___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


RE: [Tinyos-help] Mica2, CPU Timed Sleep and Wakeup

2006-04-27 Thread Gregory A. Moore

David,

I wrote the application you are talking about where I enable  
PowerManagement in the StdControl.start command.  Then whenever I want  
to save power I just turn off the radio or, RadioControl.stop().  The  
lowest current I can acheive is slightly less than 1mA.  This is  
better than before, but not as low as I would like.


I have a few questions for you:
1.  This current draw seems like there is an internal oscillator  
running, could this be because I have a timer running even while the  
motes power is being adjusted?
2.  If I were to manually place the mote to sleep in a Power save or  
standby mode, would I have to store my ram contents in the external  
flash to recall the values, or is the ram safe after the mote starts  
back up?
3.  What is the process you used to get the mote to a sleep state  
using HPLPowerManagementM where it is only drawing ~.1mA?  Do you have  
a timer still running and can you wake the mote up from that stata?


Thank you so much for your help already, I appreciate it.

Greg

 Moss [EMAIL PROTECTED] wrote:


I'm using 1.1.15, and have found similar to previous versions that your app
for mica(2|2dot|z) must wire in HPLPowerManagementM and then call
HPLPowerManagement.enable() at start before anything useful happens.

Without doing this, the mote consumes somewhere around 2-3 mA while the
radio is disabled.  With HPLPowerManagement.enable()'d at startup, the mote
consumes approximately 0.102 mA when the radio is disabled and everything is
quiet.

For reference, using a 0.106% duty cycling CC2420 radio on a micaz, the mote
will last about 16 days on 1500 mAh batteries with no power management.
When you add in that power management, you get about 266 days on the same
1500 mAh batteries.

That's a big difference.  I think HPLPowerManagement should be enabled by
default when compiling for the mica2/z's

-david




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Schippling
Sent: Thursday, April 27, 2006 12:20 PM
To: Harri Siirtola
Cc: tinyos-help@Millennium.Berkeley.EDU
Subject: Re: [Tinyos-help] Mica2, CPU Timed Sleep and Wakeup


wow...coulda fooled me about the automatic part...kewel.
Will have to try it sometime.
Which is the current tree however?
MS

Harri Siirtola wrote:


First, as far as I know, the Snooze component is deprecated. There are
many improvements in the newer TInyOS versions that make things much
more simple. For example, the CountSleepRadio app (previously in
contrib/ucb, now in the apps dir IIRC) is good for just testing that
power saving works. It just sends an incremented integer over the air
and goes to sleep. When a timer expires, the mote wakes up and sends the
next one. There's another example, apps/examples/TestSleep which
toggles a led between sleeping periods.

Second, in the current tree, power saving is transparent to the user.
When there are no interrupts (nor tasks, IIRC) pending, and only Timer 0
running, power saving kicks in. You can test it with the latest
measuring apps, just study the make/avr/route.extra to see which
commad line switches you must use to enable power saving. The
PowerManagement.AdjustPower() call is deeper down the radio stack and
is automatic once you compile the app correctly.

Regards,

Harri

At 01:18 PM 4/26/2006 -0600, Michael Schippling wrote:

Sorry, I'm at a loss. I thought that one of the features of the motes
was the ability to sleep between samples to save power, but I never
paid attention to how/where/why this might work. I actually have it
on my list of things to do for a project that I never work on anymore...

Assuming as usual that no one who actually knows how to do this will
answer your question...Perhaps there is something in the atmega spec
book about it?

MS

Gregory A. Moore wrote:

Michael,
Thank you for your response, but:
SnoozeC only works for Mica motes, not Mica2.  They have a slightly
different processor so I am sure there are some dependency issues
that don't quite fit.
I have also looked at the OnOffApp which is supposed to essentially
be the Snooze for the mica2, but it relies on a radio packet to start
the mote again.
If you have any other suggestions I am greatly appreciative.
Thanks,
Greg


There is a module tos\platform\mica\SnoozeC.nc that purports to
do the shutdown and timer wakeup. And a TestSnooze demo app.
I haven't tried them, YMMV...
MS


Gregory A. Moore wrote:

Hi All,

I have perused the archives about this pesky timed mica2 sleep
problem and have not found
any code snippets or anything of huge benifit.

So I repeat the question:
I am working with Mica2.
I would like to put the mote's CPU to sleep for a set period of
time and then have it
awoken by some timer, not an incomming radio packet.

I have done the power measurements with the use of
HPPowerManagementM and I have not
gotten any successful current readings that show me that the
module  is doing anything in
the way of sleeping.

The code from 

Re: [Tinyos-help] VoltageM errors??

2006-04-27 Thread davisj2
MS,
  Thank you, yes that makes sense.  However im looking for an end result of the
actual battery voltage as it drops, not a reference value to infer the voltage.
 I was hoping that VoltageM supplied the actual voltage in either Volts, or MV.

Thanks again.
Josh

Quoting Michael Schippling [EMAIL PROTECTED]:

 The VoltageC return value increases as the battery decreases because
 the ADC is reading a fixed value (the Bandgap ref) and comparing it
 to the ADC Reference which is the battery voltage itself. So as the
 ADCref (battery) drops, the value of the fixed BGref appears to increase.
 
 Did that make sense, semantically at least?
 
 MS
 
 
 [EMAIL PROTECTED] wrote:
  Rahul,
Thanks,  I have used VOltageC. But as I have read, I think that VoltageM
  returns the value as a direct reference, of mv, VoltageC does not.  Was
 just
  thinking this was a better implementation of obtaining the voltage values. 
 The
  current conversion I have for VoltageC returns values that increase as the
  battery dies, this is wierd
 
  Thanks.
  Josh
 
  Quoting Rahul Sawant [EMAIL PROTECTED]:
 
  Hi
  r u using VoltageC from tos/system if not use this as this is the
  configuration for VoltageM and it includes voltage.h
  if ur using VoltageC then It seems like you dont have the voltage.h file
 in
  tos/platform/mica2 if u dont just download the attached file
 
  Rahul Sawant
 
 
  On 4/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  Hey all,
  IM trying to use the VoltageM component with mica2 tinyos-1.1.15, as it
  returns the actually voltage in mv.  However, when I compile i get these
  errors:
 
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc: In
  function `Std
  Control.start':
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67:
  `TOS_ADC_VOLT
  AGE_PORT' undeclared (first use in this function)
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67: (Each
  undecla
  red identifier is reported only once
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:67: for
  each func
  tion it appears in.)
  C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/mica2/VoltageM.nc:68:
  `TOSH_ACTUAL_
  VOLTAGE_PORT' undeclared (first use in this function)
  make: *** [exe0] Error 1
 
 
  Any ideas??? thanks so much
 
  -
  This mail sent through IMP: http://horde.org/imp/
  ___
  Tinyos-help mailing list
  Tinyos-help@Millennium.Berkeley.EDU
  https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
 
 
 
 
 
  -
  This mail sent through IMP: http://horde.org/imp/
  ___
  Tinyos-help mailing list
  Tinyos-help@Millennium.Berkeley.EDU
  https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
 




-
This mail sent through IMP: http://horde.org/imp/
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] SurgeTelos

2006-04-27 Thread Fatima Zohra
Hi All,
Has anyone sucessfully run SurgeTelos on TelosB motes Using Tinyos 1.1.11.

When I run java net.tinyos.surge.MainClass 125 after invoking serial forwarder I get a sensor network topology screen with Mote 0 showing. But It displays no data. Although serial forwarder shows increment in data packets. Also MultiHop does not occur. Motes other than base station don't seem to transmit data at all. The Tx, Rx LEDS dont glow at all.


Please Help! I really need to complete my project. Any suggestions would greatly be appreciated

Thanks in Advance,
Fatima
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Suggest to write a TinyOS programming book

2006-04-27 Thread WenZhan Song
I strongly agree the following today's message (by Aditya) in TinyOS
forum. If we look at the questions in TinyOS forum, many questions are
repeated many time simply because TinyOS is not documented well -- I
wish TinyOS folks could write your experience down somewhere, at least
a good readme file in the distribution - it will save everybody's
time. Even something like: what application sample code is included in
TinyOS distribution? How to test them? What's the architecture of
those modules? I know we can read code then figure out, but it just
take too much time of everybody. We can not assume everyone will
dedicate all time to tinyos development. We need use it as a tool and
focus on research or development ...

Can someone write a book for TinyOS programming?

P.S. Now I understand more why Windows cater customs better than Unix
:-)

WenZhan

===
Date: Fri, 28 Apr 2006 01:37:28 +0530
From: Aditya Bhave [EMAIL PROTECTED]
Subject: Re: [Tinyos-help] Mica2, CPU Timed Sleep and Wakeup
To: Michael Schippling [EMAIL PROTECTED]
Cc: TinyOS Help tinyos-help@millennium.berkeley.edu
Message-ID:
   [EMAIL PROTECTED]
Content-Type: text/plain; charset=iso-8859-1

Hi all
Where is the official documentation for the system modules of TinyOs. I keep
reading in these lists about several modules whose documentaiton is not
given on the TInyOs website. IS there some official source where all the
in-built components of TinyOS are explained.

___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Suggest to write a TinyOS programming book

2006-04-27 Thread David Gay
On 4/27/06, WenZhan Song [EMAIL PROTECTED] wrote:
 I strongly agree the following today's message (by Aditya) in TinyOS
 forum. If we look at the questions in TinyOS forum, many questions are
 repeated many time simply because TinyOS is not documented well --

Note that this one of the major efforts in TinyOS 2.0: the major
subsystems are documented in TEPs. And note also that Phil Levis
recently wrote the following:
http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf
which I thought was announced here... (Kristin/Phil: why isn't there a
link from www.tinyos.net?)

David Gay

___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Sending a message to the Base Station from the PC

2006-04-27 Thread Liliane Fegard

Hi

Thanks for your reply.  So the final packet after escaping 0x7E and 0x7D is:

7e 42 7d5e 00 7d5d 0b 010100 69b0 7e and what I should send 
to the mote is the binary:


11100111001001001101011001011101010101011011000100011001011010100111

I am sending the packet using a C program I wrote that reads from and writes 
to the serial port (The code is running on windows XP and using Dev-C++) and 
I am using the function:
WriteFile(hCom, final, 1, nReadPort,NULL); where final is the array that 
contains the binaries.


char final[177] = 
{11100111001001001101011001011101010101011011000100011001011010100111};


hCom = CreateFile( pcCommPort,
GENERIC_READ | GENERIC_WRITE,
0,
NULL, // no security attributes
OPEN_EXISTING, // comm devices must use OPEN_EXISTING
0,// not overlapped I/O
NULL  // hTemplate must be NULL for comm devices
);

It is not working (The Led is not turning on)….Any idea why???

Thanks in advance,

Liliane.

_
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Suggest to write a TinyOS programming book

2006-04-27 Thread Conor Todd
A suggestion and a question regarding David's post:

Suggestion: How about a community-maintained wiki on tinyos.net?  Then,
as each of us acquires expertise in the various bits of TinyOS, we can
document it for others.

Question: What is a TEP?  Googling for this term led to a variety of
colourful, yet ultimately useless possibilities.

And for all of you who may not have looked into it, the TinyOS Eclipse
plugin featured in the news section of TinyOS.net is really quite nice,
and has made my experience much more enjoyable.  I highly recommend it.

   - Conor


David Gay wrote:
 On 4/27/06, WenZhan Song [EMAIL PROTECTED] wrote:
   
 I strongly agree the following today's message (by Aditya) in TinyOS
 forum. If we look at the questions in TinyOS forum, many questions are
 repeated many time simply because TinyOS is not documented well --
 

 Note that this one of the major efforts in TinyOS 2.0: the major
 subsystems are documented in TEPs. And note also that Phil Levis
 recently wrote the following:
 http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf
 which I thought was announced here... (Kristin/Phil: why isn't there a
 link from www.tinyos.net?)
   
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Suggest to write a TinyOS programming book

2006-04-27 Thread Joe Polastre
http://cents.cs.berkeley.edu/tinywiki/index.php/TinyOS_Documentation_Wiki

Already exists.

-Joe

On 4/27/06, Conor Todd [EMAIL PROTECTED] wrote:
 A suggestion and a question regarding David's post:

 Suggestion: How about a community-maintained wiki on tinyos.net?  Then,
 as each of us acquires expertise in the various bits of TinyOS, we can
 document it for others.

 Question: What is a TEP?  Googling for this term led to a variety of
 colourful, yet ultimately useless possibilities.

 And for all of you who may not have looked into it, the TinyOS Eclipse
 plugin featured in the news section of TinyOS.net is really quite nice,
 and has made my experience much more enjoyable.  I highly recommend it.

- Conor


 David Gay wrote:
  On 4/27/06, WenZhan Song [EMAIL PROTECTED] wrote:
 
  I strongly agree the following today's message (by Aditya) in TinyOS
  forum. If we look at the questions in TinyOS forum, many questions are
  repeated many time simply because TinyOS is not documented well --
 
 
  Note that this one of the major efforts in TinyOS 2.0: the major
  subsystems are documented in TEPs. And note also that Phil Levis
  recently wrote the following:
  http://csl.stanford.edu/~pal/pubs/tinyos-programming-1-0.pdf
  which I thought was announced here... (Kristin/Phil: why isn't there a
  link from www.tinyos.net?)
 
 ___
 Tinyos-help mailing list
 Tinyos-help@Millennium.Berkeley.EDU
 https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help