[Tinyos-help] bug in my app

jurin dan jurin1er at hotmail.com
Tue Aug 8 18:57:49 PDT 2006


          hi,

          it have been two weeks i'm trying to write an apps named 
FullControl by myself which may interrest you. this apps is almost like the 
Sense_Ligt_To_Log apps release by tinyos(see apps/Sense_Ligt_To_Log).

          i have attached all file that concern my own apps. and i'm using 
tinyOS v.1.1.15
          the bugs is about radio transmission i.e serial-radio transmission 
is possible but radio-serial not.
          follow this few step to  see what i'm telling. u will need 2 mica2

1. extract the attachements to your apps folder or contrib folder 
(tinyos-1.x/apps or tinyos-1.x/contrib)

2. copy the BcastInject.java file to tinyos-1.x/tools/java/net/tinyos/tools

3. open an cygwin shell

4. generate the java class with this commands after going to this folder: 
\tinyos-1.x\tools\java\net\tinyos\tools

    1. APPDIR=`ncc -print-tosdir`/../apps/FullControl
    2. mig java -I $APPDIR -java-classname=net.tinyos.tools.CommandMsg 
$APPDIR/CommandsAndDataStruct.h CommandMsg -o CommandMsg.java
    3. javac CommandMsg.java
    4. mig java -I $APPDIR -java-classname=net.tinyos.tools.LogMsg 
$APPDIR/CommandsAndDataStruct.h LogMsg -o LogMsg.java
    5. javac LogMsg.java
    6. javac BcastInject.java


5. go to apps/FullControl or contrib/FullControl and compile and load the 
apps on one mica2
$ PFLAGS=-DCC1K_DEF_FREQ=916400000 make mica2 install.1 mib510,<portname>

u will see this print on ur screen:

$ PFLAGS=-DCC1K_DEF_FREQ=916400000 make mica2 install.1 mib510,com5
mkdir -p build/mica2
    compiling MainCmd to a mica2 binary
ncc -o build/mica2/main.exe -Os -DCC1K_DEF_FREQ=916400000 
-finline-limit=100000
-Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=mica2 
-fnesc-cfile=bui
ld/mica2/app.c -board=micasb -I%T/lib/Deluge 
-DIDENT_PROGRAM_NAME=\"MainCmd\" -D
IDENT_USER_ID=\"Owner\" -DIDENT_HOSTNAME=\"toshiba-ce16063\" 
-DIDENT_USER_HASH=0
x35e4e258L -DIDENT_UNIX_TIME=0x44d96b01L -DIDENT_UID_HASH=0x32dece74L 
MainCmd.nc
-lm
SensorsToPcM.nc:585: warning: `MicControl.stop' called asynchronously from 
`MicA
DC.dataReady'
SensorsToPcM.nc:610: warning: `BattControl.stop' called asynchronously from 
`Bat
tADC.dataReady'
SensorsToPcM.nc:537: warning: `PhotoControl.stop' called asynchronously from 
`Li
ghtADC.dataReady'
SensorsToPcM.nc:561: warning: `TempControl.stop' called asynchronously from 
`Tem
pADC.dataReady'
    compiled MainCmd to build/mica2/main.exe
           19702 bytes in ROM
            1114 bytes in RAM
avr-objcopy --output-target=srec build/mica2/main.exe build/mica2/main.srec
avr-objcopy --output-target=ihex build/mica2/main.exe build/mica2/main.ihex
    writing TOS image
set-mote-id build/mica2/main.srec build/mica2/main.srec.out-1 1
    installing mica2 binary using mib510
uisp -dprog=mib510 -dserial=com5 --wr_fuse_h=0xd8 -dpart=ATmega128 
--wr_fuse_e=f
f  --erase --upload if=build/mica2/main.srec.out-1
Firmware Version: 2.1
Atmel AVR ATmega128 is found.
Uploading: flash

Fuse High Byte set to 0xd8

Fuse Extended Byte set to 0xff
rm -f build/mica2/main.exe.out-1 build/mica2/main.srec.out-1
    installing mica2 bootloader using mib510
uisp -dprog=mib510 -dserial=com5 --wr_fuse_h=0xd8 -dpart=ATmega128 
--wr_fuse_e=f
f  --upload if=/opt/tinyos-1.x/tos/lib/Deluge/TOSBoot/build/mica2/main.ihex
Firmware Version: 2.1
Atmel AVR ATmega128 is found.
Uploading: flash

Fuse High Byte set to 0xd8

Fuse Extended Byte set to 0xff

6. on the 2nd mica2 install the tosbase apps and leave it on the station 
base
$ PFLAGS=-DCC1K_DEF_FREQ=916400000 make mica2 install.0 mib510,<portname>

7. turn on the mote install with FullControl apps

8. Launch the serial forwarder
java net.tinyos.sf.SerialForwarder -comm serial@<portname>:mica2

9. open another cygwin shell and type
java net.tinyos.tools.BcastInject -h  to see the command i implemante. u 
will see this print on your screen:

Usage: java net.tinyos.tools.BcastInject <command> [arguments]
        where <command> and [arguments] can be one of the following:
                tog_red
                tog_green
                tog_yellow
                tog_sounder
                radio_louder
                radio_quieter
                start_sensing [nsamples interval_ms]
                read_log [dest_address]

10. for example if we want to toggle the red led of the mote install with 
the app FullControl
command look like :

java net.tinyos.tools.BcastInject tog_green

where is my bug?
for example when i send a command like as step 10 to toggle green led, the 
red led on station base light to mean that message has been sent from serial 
to radio but the red led on the remote mote doesn't toogle also the green 
led on the station base doesn't light.

if anyone can give me help i will appreciate to much.
thx in advanced

_________________________________________________________________
Play Q6 for your chance to WIN great prizes.  
http://q6trivia.imagine-live.com/enca/landing
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FullControl.rar
Type: application/octet-stream
Size: 152068 bytes
Desc: not available
Url : http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060808/0c205223/FullControl-0001.obj


More information about the Tinyos-help mailing list