[Tinyos-help] TinyDB and MICAz

Stefano Tennina ironste at hotmail.com
Sat Sep 17 03:14:35 PDT 2005


Hello everyone,
On a Windows (CygWin) system I installed the TinyOS 1.1.11
distribution. I downloaded TinyDBApp code on 3 nodes
MICAz (0, 1 and 2) as in the example below:

PC at STEFANO_NBOOK /opt/tinyos-1.x/apps/TinyDBApp
$ make micaz eprb,192.168.1.8 reinstall.1
set-mote-id build/micaz/main.srec build/micaz/main.srec.out-1 1
    installing micaz binary using eprb
uisp -dprog=stk500 -dhost=192.168.1.8 --wr_fuse_h=0xd9 -dpart=ATmega128 
--wr_fuse_e=ff  --erase --upload if=build/micaz/main.srec.out-1
Firmware Version: 1.7
Atmel AVR ATmega128 is found.
Uploading: flash

Fuse High Byte set to 0xd9

Fuse Extended Byte set to 0xff
rm -f build/micaz/main.exe.out-1 build/micaz/main.srec.out-1

I run SerialForwarder (in background) and
TinyDBMain applications from my pc, as in
what follows:

PC at STEFANO_NBOOK /opt/tinyos-1.x/tools/java
$ java net/tinyos/sf/SerialForwarder -comm network at 192.168.1.8:10002 &
[1] 284

PC at STEFANO_NBOOK /opt/tinyos-1.x/tools/java
$ java net/tinyos/tinydb/TinyDBMain
Catalog file in use: net/tinyos/tinydb/catalog.xml
Creating PhoenixSource with sf at localhost:9001


Without any modification in the sources codes, from
the java app TinyDBMain, I experienced two strange
problems running the following query on MICAz nodes
equipped with MTS310 sensor board:

SELECT nodeid, temp FROM sensors
SAMPLE PERIOD 2048

The following is the output in TinyDB Query window:

Epoch    NodeID           Temp
2	 2	     461
2	 1	     511
3	 2	     460
3	 1	     476
4	 2	     460
4	 1	     477
5	 1	     476
5	 2	     501
6	 2	     460
6	 1	     476
7	 1	     476     <<< 1. 22.0°C
7	 2	     460
8	 2	     501
8	 1	     511     <<< 1. 24.9°C
9	 2	     460
9	 1	     476
10	 2	     501     <<< 2. 24.1°C
10	 1	     476
11	 2	     460     <<< 2. 20.7°C
11	 1	     511
12	 2	     460
12	 1	     476
15	 1	     476
15	 2	     460
16	 2	     501
16	 1	     476
17	 2	     501
18	 2	     460
18	 1	     476
19	 1	     511
19	 2	     460
20	 2	     501
21	 2	     501
21	 1	     476
22	 2	     460
22	 1	     476
23	 2	     460


1. Temperature readings are unstable, that is,
   they oscillate e.g. (Node 2) from 460 to 501
   (a range of more than 3°C (20,7°C - 24,1°C)
   based on the conversion formula found in the
   sensor datasheet) !!

2. Readings come from sensors only for 23 epochs.
   After that, without any external intervention,
   green leds of motes blink and no more data
   arrives.

This behaviour is the same even if node 2 is off
as in what I report in the following.

Epoch      NodeID           Temp
2	1	       477
3	1	       511
4	1	       477
5	1	       477
6	1	       511
7	1	       477
8	1	       477
9	1	       477
10	1	       477
11	1	       477
12	1	       477
13	1	       477     <<< 22.1°C
14	1	       511     <<< 24.9°C
15	1	       477
16	1	       477
18	1	       477
19	1	       477
20	1	       477
21	1	       477
22	1	       476


Note that, if the query is:
     SELECT nodeid, temp, light FROM sensors
     SAMPLE PERIOD 2048
the above mentioned problems seem to disappear (even
if sometimes a spurious temperature reading arrives).

I know that temperature and light sensors share the
same ADC channel, but this behaviour is strange.

All this didn't happen with the old version of
TinyDB (task-tinydb-1.1.1Nov2003) on MICA2 nodes.

Can anyone tell me why this happens and how to solve
the problem ??

PhD Stefano TENNINA
Dept. of Electrical Engineering and Centre of Excellence DEWS
University of L'Aquila
ITALY




More information about the Tinyos-help mailing list