Dear Colleagues:

I am running TOSSIM simulations of the CTP algorithm by using codes in
*tinyos-2.1.2/apps/testsTestNetwork*. I am using *make micaz sim* under the
TinyOs2.1.2 environment.

I would like to evaluate the energy aspects of CTP. I, therefore, need to
get battery voltage level. I tried to use the DemoSensorC component, but it
was always giving a huge constant value (48879), which is clearly not
correct. This is also confirmed in
http://tinyos.stanford.edu/tinyos-wiki/index.php/Sensing, where it has been
mentioned that DemoSensorC gives fake voltage readings for MICAz.

When I tried to used the VoltageC component directly, I got the following
error:

In component `Atm128AdcC':
> /opt/tinyos-2.1.2/tos/chips/atm128/adc/Atm128AdcC.nc:74: no match
> make: *** [sim-exe] Error 1
>

I commented out *Atm128AdcP.Atm128Calibrate -> PlatformC; *in line 74 of
Atm128AdcC.nc, which causes the above error and initialized *prescaler* in*
Atm128AdcP.nc*, which is in the same folder as *Atm128AdcC.nc, *to
ATM128_ADC_PRESCALE_16 and disabled the platform prescaler option
(ATM128_ADC_PRESCALE). I run *make micaz sim* again*. *This time, it
complied successfully. But when I run *python test.py*, I am getting 0 for
battery voltage. I tried to change the ADC Channel in* VoltageP* the
following options:
    ATM128_ADC_SNGL_ADC0
    ATM128_ADC_SNGL_ADC1
    ATM128_ADC_SNGL_ADC2
    ATM128_ADC_SNGL_ADC3
    ATM128_ADC_SNGL_ADC4
    ATM128_ADC_SNGL_ADC5
    ATM128_ADC_SNGL_ADC6
    ATM128_ADC_SNGL_ADC7
I recompiled and run *python test.py *but I was still getting zero values
for battery voltage.

I, therefore, would like to find out the proper steps that I must take in
order to read battery voltage in TOSSIM when simulating MICAz motes under
the TinyOs2.1.2 environment.

Your assistance will be greatly appreciated.

Best regards

*****
 Clement
<http://nthambazale.com/>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to