[Tinyos-help] question on mica sense carrier

2006-06-07 Thread Liu Haibin
Hi,I have a question on mica/ChannelMonC.nc, the implementation of the CSMA/CA on mica. The code below shows that    uint8_t bit = TOSH_READ_RFM_RXD_PIN();    CM_search[0] <<= 1;    CM_search[0] = CM_search[0] | (bit & 0x1);
        if ((CM_search[0] & 0xfff) == 0) {   // 12 clock ticks      CM_waiting = -1;      signal ChannelMon.idleDetect();        }after a random delay, it checks if during the past 12 clock ticks a single 1 bit is received. If not, then it signals that channel is idle. But my question is if some node is transmitting a long sequence of 0s, then the idleness is falsely detected. Why is it so?
Regards,Haibin 
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] (no subject)

2006-06-07 Thread Graham Healy
Em, slight problem... I googled the error with no success, anybody any ideas?I have all installed all the indicated rpms off the install guide for tinyos-2.x, and paths and the like seem to be set correctly...
[EMAIL PROTECTED]:/opt/tinyos-2.x/apps/Blink$ make mica2mkdir -p build/mica2    compiling BlinkAppC to a mica2 binaryncc -o build/mica2/main.exe -Os -finline-limit=10 -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=mica2 -fnesc-cfile=build/mica2/app.c -board=micasb  -fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())' -fnesc-dump='referenced(interfacedefs, components)' -fnesc-dumpfile=build/mica2/wiring-
check.xml BlinkAppC.nc -lmIn file included from /opt/tinyos-2.x/tos/system/TinySchedulerC.nc:41:In component `McuSleepC':/opt/tinyos-2.x/tos/chips/atm128/McuSleepC.nc: In function `McuSleep.sleep':/opt/tinyos-
2.x/tos/chips/atm128/McuSleepC.nc:116: implicit declaration of function `pgm_read_byte'make: *** [exe0] Error 1Cheers in advance,Graham
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] tmote flash verify problem

2006-06-07 Thread jagan nath

Hi all,
I am writing a chunk of data(4096 bytes)  on to the flash and trying
to verify it by
calling,Blockread.verify().
The verifyDone is not returning success, but if I do a ComputeCRC
check, the computecrcDone is returning success.

I wanted to know what is the difference between the two.and is it OK
if the verify doesnt pass

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


[Tinyos-help] set frequency and power for the CC2420 in Micaz motes

2006-06-07 Thread Andres Aberasturi

Hi all,

At this moment I am working with the chipcon CC2420 in the MicaZ motes. I 
would like to know if I can change the frequency and the power, and how can 
I do it?


I have seen that for the mica2 motes, this is made in the MakeXbowLocal:

CFLAGS = -DCC1K_DEFAULT_FREQ=RADIO_916BAND_CHANNEL_00
CFLAGS += -DRADIO_XMIT_POWER=0xFF

But what happens if I use the MicaZ? Which range of values can I use for 
micaz?


Thanks in advance,

Andrés

_
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en 
MSN Motor. http://motor.msn.es/researchcentre/


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


[tinyOS-help]how to support mica2 with mate

2006-06-07 Thread song guo
Hi all,Recently I have a problem that when I used the bombilla-mica.vmsf to build a VM, and type  make mica2 to establish a mica2 platform, the compile is all right.but when I tried the program from the mate tutorialI typed
 java net.tinyos.script.Scripter reboot reboot.txt, it appears have writen to the mica2,however I did not see the result of the program. I just write led(2), but nothing happened. I used a mts420ca sensor board.
Can any one give me some hint?Thank you very muchSong Guo
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Read/write registers of CC2420 with Boomerang

2006-06-07 Thread Ole Bischoff





Hi,
 
I'm using Boomerang and TelosB and want to 
read/write some
registers of the CC2420. I know that I can use 
the functions of
the CC2420Control-interface, but I really would like to know how
the resource handler works. So I wrote a little module that 
increases
the RF-power of the radio and displays the value on the LEDs.
My program should work like a simple 3-bit counter (Blink example),
but when I start it on my tmote the default RF-power value 
(0x1F)
is displayed on the LEDs. When I change line37 of RegCC2420M.nc 
to "call Radio.SetRFPower(rh, m_value) " the 
whole thing works fine.
Perhaps someone can help me with this problem a.k.a. resource 
handler.
 
Best regards,
                
    Ole Bischoff
 
RegCC2420.nc
01 configuration RegCC2420 {02 }03 
implementation {04   components Main05 
, RegCC2420M06 , 
TimerC07 , LedsC08 , 
CC2420RadioC09 , HPLCC2420C;10    
11   components new CC2420ResourceC() as 
RadioResource;1213   Main.StdControl -> 
TimerC;14   Main.StdControl -> RegCC2420M;15  
16   RegCC2420M.TimerRFPower -> 
TimerC.Timer[unique("Timer")];17  18   
RegCC2420M.Resource -> RadioResource.ResourceCmdAsync;19  
20   RegCC2420M.HPLRadio -> 
HPLCC2420C.HPLCC2420;21   RegCC2420M.Radio -> 
CC2420RadioC.CC2420Control;2223   RegCC2420M.Leds -> 
LedsC;24 }
 
RegCC2420M.nc
01 module RegCC2420M {02   provides 
{03 interface StdControl;04   
}05   uses {06 interface 
Leds;07 interface Timer as 
TimerRFPower;08 interface CC2420Control as 
Radio;09 interface HPLCC2420 as 
HPLRadio;10 interface ResourceCmdAsync as 
Resource;11   }12 }13 implementation {1415  
/* VARIABLES 
***/16   uint8_t m_value = 
3;17  18  /* STD CONTROL 
*/19   command result_t 
StdControl.init() { return SUCCESS; }2021   command result_t 
StdControl.start() {22 call TimerRFPower.start( 
TIMER_REPEAT, 1000 );23 return 
SUCCESS;24   }2526   command result_t 
StdControl.stop() {27  return 
SUCCESS;28   }2930  /* TIMER 
***/31   event result_t 
TimerRFPower.fired() {32      call 
Resource.request(RESOURCE_NONE);33      return 
SUCCESS;34   }3536   async event void 
Resource.granted(uint8_t rh) {37      call 
HPLRadio.write(rh, CC2420_TXCTRL, m_value);38 39  
    call Leds.set(call 
Radio.GetRFPower()/4); 40 41      if 
(m_value == 31) {42        call 
TimerRFPower.stop();43        call 
Leds.set(0);44  }45 46  
    m_value += 4;47 48      call 
Resource.release();49   }50 
}
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] typhon+tossim

2006-06-07 Thread Munaretto, Daniel
Hi all,
 i'm really new with typhon scripts and i saw the /tython/manual.html but i 
don't know how to do this simple file with 4 nodes.
 
If i want only to modify the loss rate among nodes, although to have a sort of 
chain of nodes (0 sees only 1, 1 sees only 0 and 2, and so on), i tried to run 
this "test.py"
 
java net.tinyos.sim.SimDriver -script "test.py"
 
where test.py is:
 
...
 
from simcore import *
from java.util import *
from net.tinyos.message import *
from net.tinyos.packet import *
radio.setLossRate(0,1,0)
radio.setLossRate(0,2,1)
radio.setLossRate(0,3,1)
radio.setLossRate(1,0,0)
radio.setLossRate(1,2,0)
radio.setLossRate(1,3,1)
radio.setLossRate(2,0,1)
radio.setLossRate(2,1,0)
radio.setLossRate(2,3,0)
radio.setLossRate(3,0,1)
radio.setLossRate(3,1,1)
radio.setLossRate(3,2,0)

sim.exec("./build/pc/main.exe", 4, "-b=0 -gui -rf=lossy -t=10 ")
 
..
 
But it is shown syntax error.

Anyone could suggest me how to build up this simple example?
Cheers
Daniele

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


[Tinyos-help] FW: typhon+tossim

2006-06-07 Thread Munaretto, Daniel
Now with this program no syntax errors, but i'm not able to print on an output 
file my dbg messages (written in my nesc program). And i don't know if it is 
the right way to create the chain i mentioned before.
 
 
 
import simcore
import simutil
import simtime
import math
from simcore import *
from java.util import *
from net.tinyos.message import *
from net.tinyos.packet import *
radio.setLossRate(0,1,0)
radio.setLossRate(0,2,1)
radio.setLossRate(0,3,1)
radio.setLossRate(1,0,0)
radio.setLossRate(1,2,0)
radio.setLossRate(1,3,1)
radio.setLossRate(2,0,1)
radio.setLossRate(2,1,0)
radio.setLossRate(2,3,0)
radio.setLossRate(3,0,1)
radio.setLossRate(3,1,1)
radio.setLossRate(3,2,0)

sim.exec("./build/pc/main.exe", 4, "-b=0 -rf=lossy -t=10")
sim.exit()

-Original Message- 
From: Munaretto, Daniel 
Sent: Wed 6/7/2006 4:01 PM 
To: tinyos-help@Millennium.Berkeley.EDU 
Cc: 
Subject: typhon+tossim


Hi all,
 i'm really new with typhon scripts and i saw the /tython/manual.html 
but i don't know how to do this simple file with 4 nodes.
 
If i want only to modify the loss rate among nodes, although to have a 
sort of chain of nodes (0 sees only 1, 1 sees only 0 and 2, and so on), i tried 
to run this "test.py"
 
java net.tinyos.sim.SimDriver -script "test.py"
 
where test.py is:
 
...
 
from simcore import *
from java.util import *
from net.tinyos.message import *
from net.tinyos.packet import *
radio.setLossRate(0,1,0)
radio.setLossRate(0,2,1)
radio.setLossRate(0,3,1)
radio.setLossRate(1,0,0)
radio.setLossRate(1,2,0)
radio.setLossRate(1,3,1)
radio.setLossRate(2,0,1)
radio.setLossRate(2,1,0)
radio.setLossRate(2,3,0)
radio.setLossRate(3,0,1)
radio.setLossRate(3,1,1)
radio.setLossRate(3,2,0)

sim.exec("./build/pc/main.exe", 4, "-b=0 -gui -rf=lossy -t=10 ")
 
..
 
But it is shown syntax error.

Anyone could suggest me how to build up this simple example?
Cheers
Daniele


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


[Tinyos-help] tinyos simulator

2006-06-07 Thread Roberto
does anyone knowa  tinyOS simulator, letting the user to run more codes
on different nodes?

thank you

Roberto

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


[Tinyos-help] Blackbook v.5.1 available

2006-06-07 Thread David Moss
Sending this out again because some people didn't get it the first time...

Yesterday I uploaded the newest version of Blackbook cross-platform
compatible file system to the tinyos-1.x CVS, under /contrib/rincon/. This
is a file system that currently runs on tmote's, mica2, mica2dot, micaz,
etc. and was designed to be easily ported to other platforms. 

The TinyOS file system part of it that runs on the mote is in
contrib/rincon/apps/Blackbook5.  If you're just getting started with
Blackbook, I recommend going through the demo apps and reading the
documentation under Blackbook5/apps/.

The Java programs that let your computer interact with the mote's file
system is located at /contrib/rincon/tools/java/com/rincon/blackbook

Many bugs were fixed from v.5.0, and longevity testing has been performed on
both the mica- and telos mote types.

TelosB Standalone (full):
16834 bytes ROM
1012 bytes RAM

MicaZ Standalone (full):
20502 bytes ROM
968 bytes RAM

The Blackbook 5 API pdf document for this file system can be found in CVS.

You can contact me with questions, comments, bug reports, etc.
-David


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


[Tinyos-help] CC2420 security features support

2006-06-07 Thread Stefan Tillich

Hi,

There have been a couple of posts about integrating the CC2420 security 
features for the MICAz platform back in 2005. Have there been new 
developments in this regard?


Has anyone successfully activated/used the CC2420 security features with 
TinyOS?


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


[Tinyos-help] problems with temperature readings

2006-06-07 Thread Daniel Villón
Hi,I am using a MICAz with an MDA300 to do temperature and light readings. I've seen the posts about the problem of using the temperature sensor and the radio because they share one pin. I also have seen the modified 
PhotoTempM.nc module which is supposed to resolve the problem (look ../platform/micaz), I included in my project.Now that I have done those changes, I'm trying to receive the the data and this is what I get:  01 BE 03 88 00
where 01 is the mote number, 03BE is the light reading and 0088 is the temperature reading... I have more readings but they are almost the same.The problem is that when I do the conversion for the temperature sensor, I get a -10 C which is impossible because I'm into a room and it is very far from the 30 C that we have now. Now I don't know if it is a problem of the shared pin, or if it is a problem of the formula (Which I don't think it is), or what is it?, there is something strange going on too, when I put my hand over the light sensor, the light and the temperature reading changes...both.
I attach a part of the program when I do the readings of the light and temperature, maybe I need to change the way I do it in order to get a correct temperature reading.event result_t Timer.fired(){    // every time the timer fires it has to make a reading of both sensors
                if (cont < 59) cont++;        else cont=0;                if (cont == 59) return call ADC2.getData();                return SUCCESS;    }        async event result_t 
ADC2.dataReady(uint16_t data){ // reading of temperature sensor as it is done in the tutorial                        atomic{            data2 = data;            }               return  call 
ADC1.getData();                }            async event result_t ADC1.dataReady(uint16_t data) {    // reading of the light sensor as it is done in the tutorial                        atomic{
            data1 = data;            }                       atomic{            //current data // here I do the arrengement of the data to send it
            ptrmsg->actual.nodo = TOS_LOCAL_ADDRESS;                    ptrmsg->actual.sensor1 = data1;            ptrmsg->actual.sensor2 = data2;            dada1++;            ptrmsg->dada1 = dada1;
            }                            post envio ();  // envio = send , it goes to a post where the data is sended                return SUCCESS;
    }task void envio () {        ptrmsg =  call SendMHopMsg.getBuffer(msgptr, &len);                  call SendMHopMsg.sendTTL(0x00,sizeof(datos), msgptr,0);            }    
I hope I was clear enough and somebody can help me 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] CC2420 rx/tx energy

2006-06-07 Thread Szymon Fedor
Spam detection software, running on the system "mail.Millennium.Berkeley.EDU", 
has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  Hi all, Does anyone know why CC2420 consumes more 
  energy when receiving data than when sending. I know this issue was 
  already raised and Joe answered that it's because of the modulation 
  scheme. But if anyone could say why exactly decoding of O-QPSK signal 
  costs more energy than encoding , I would appreciate it. [...] 

Content analysis details:   (5.2 points, 5.0 required)

 pts rule name  description
 -- --
 0.2 INVALID_DATE   Invalid Date: header (not RFC 2822)
 0.0 HTML_60_70 BODY: Message is 60% to 70% HTML
 0.0 HTML_MESSAGE   BODY: HTML included in message
 1.2 MIME_HTML_ONLY BODY: Message only has text/html MIME parts
 0.4 DNS_FROM_RFC_ABUSE RBL: Envelope sender in abuse.rfc-ignorant.org
 1.8 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net
  [Blocked - see ]
 1.4 DNS_FROM_RFC_POST  RBL: Envelope sender in postmaster.rfc-ignorant.org
 0.1 DNS_FROM_AHBL_RHSBLRBL: From: sender listed in dnsbl.ahbl.org
 0.1 MIME_BOUND_NEXTPARTSpam tool pattern in MIME boundary

The original message was not completely plain text, and may be unsafe to
open with some email clients; in particular, it may contain a virus,
or confirm that your address can receive spam.  If you wish to view
it, it may be safer to save it to a file and open it with an editor.

--- Begin Message ---


Hi all,
 
Does anyone know why CC2420 consumes more energy when receiving data than when sending. I know this issue was already raised and Joe answered that it's because of the modulation scheme. But if anyone could say why exactly decoding of O-QPSK signal costs more energy than encoding , I would appreciate it. 
 
Thanks
Szymon --- End Message ---
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Re: problems with temperature readings

2006-06-07 Thread Raghu Ganti
Hi Daniel: Have you done all the init? Like wiring to the TempStdControl and calling init and start? Have a look at $TOSROOT/apps/Micasbverify/ for an example of how to use the temperature sensor. Also the light and temp sensor share the same pin, so you have to wait sometime before calling 
ADC1.getData(). I think there was a fix to ensure that there is enough time gap when photo and temp are used at the same time, you will have to check that by looking at the PhotoTemp code. Hope that helps.
RaghuMessage: 1Date: Wed, 7 Jun 2006 18:44:09 +0200
From: " Daniel Vill?n " <[EMAIL PROTECTED]>Subject: [Tinyos-help] problems with temperature readingsTo: "
tinyos-help@Millennium.Berkeley.EDU"<tinyos-help@millennium.berkeley.edu>Message-ID:<
[EMAIL PROTECTED]>Content-Type: text/plain; charset="iso-8859-1"Hi,I am using a MICAz with an MDA300 to do temperature and light readings. I've
seen the posts about the problem of using the temperature sensor and theradio because they share one pin. I also have seen the modifiedPhotoTempM.nc module which is supposed to resolve the problem (look../platform/micaz), I included in my project.
Now that I have done those changes, I'm trying to receive the the data andthis is what I get:  01 BE 03 88 00where 01 is the mote number, 03BE is the light reading and 0088 is thetemperature reading... I have more readings but they are almost the same.
The problem is that when I do the conversion for the temperature sensor, Iget a -10 C which is impossible because I'm into a room and it is very farfrom the 30 C that we have now. Now I don't know if it is a problem of the
shared pin, or if it is a problem of the formula (Which I don't think itis), or what is it?, there is something strange going on too, when I put myhand over the light sensor, the light and the temperature reading
changes...both.I attach a part of the program when I do the readings of the light andtemperature, maybe I need to change the way I do it in order to get acorrect temperature reading.event result_t 
Timer.fired(){// every time the timer fires ithas to make a reading of both sensorsif (cont < 59) cont++;else cont=0;if (cont == 59) return call ADC2.getData();
return SUCCESS;}async event result_t ADC2.dataReady(uint16_t data){ // readingof temperature sensor as it is done in the tutorialatomic{data2 = data;
}   return  call ADC1.getData();}async event result_t ADC1.dataReady(uint16_t data) {// reading ofthe light sensor as it is done in the tutorialatomic{
data1 = data;}atomic{//currentdata // here I dothe arrengement of the data to send it
ptrmsg->actual.nodo = TOS_LOCAL_ADDRESS;ptrmsg->actual.sensor1 = data1;ptrmsg->actual.sensor2 = data2;dada1++;ptrmsg->dada1 = dada1;
}post envio();  // envio = send, it goes to a post where the data is sendedreturn SUCCESS;}
task void envio () {ptrmsg =  call SendMHopMsg.getBuffer(msgptr, &len);call SendMHopMsg.sendTTL(0x00,sizeof(datos), msgptr,0);}I hope I was clear enough and somebody can help me
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]
-- next part --An HTML attachment was scrubbed...URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060607/e76a1935/attachment-0001.htm

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


[Tinyos-help] Errors with S_MAC applications

2006-06-07 Thread bhushan bhatt
Hi all,   I am trying to make some S-MAC apps files and all the programs give me around 30-35 errors when i run it. I am trying to debug but its taking lot of my time. If anyone has worked with S-MAC and know the problem can help me. I really need to get this working soon so i can implement S-MAC with my applications.Thanks,Bhushan __Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Simple flashWrite/read program not working ( error i the reading part)

2006-06-07 Thread jagan nath

Hi all,
Below is a very simple and straight forward flash Read/write code, The
Red Led is toggling indicating that the data has been written
correctly. However Im not able to read back the data correctly ( The
yellow Led is not glowing).

P.S. 1. The flash has been formatted using
/opt/tinyos1.x/apps/TestDeluge/formatflash
2. The volume is getting correctly mounted ( checked with an LED)

Here is the code
**configuration file*
includes Storage;

configuration FlashCheck{}

implementation{ 
components Main,FlashCheckM,BlockStorageC,LedsC;

Main.StdControl->FlashCheckM;

FlashCheckM.Leds->LedsC;
FlashCheckM.Mount->BlockStorageC.Mount[ unique("StorageManager")];
FlashCheckM.BlockRead->BlockStorageC.BlockRead[ 
unique("StorageManager")];

FlashCheckM.BlockWrite->BlockStorageC.BlockWrite[unique("StorageManager")];
}
** Module***

module FlashCheckM{

provides interface StdControl;
uses{   
interface Leds;
interface Mount;
interface BlockRead;
interface BlockWrite;
}
}

implementation{ 
block_addr_t addr = 0x00;
block_addr_t length = 10;
uint8_t temp = 0xA0;
uint8_t DataWriteBuf[10];
uint8_t DataReadBuf[10];
uint8_t i;
bool DATA_OK=FALSE;

task void FlashWriteTask(){

for(i=0;i<10;i++)
DataWriteBuf[i] = temp++;
call BlockWrite.write(addr,&DataWriteBuf[0],length);
}

task void FlashReadTask(){
call BlockRead.read(addr,&DataReadBuf[0],length);
}

command result_t StdControl.init(){
call Leds.init();
return SUCCESS;
}
command result_t StdControl.start(){
call Mount.mount(0xd1);
return SUCCESS;
}
command result_t StdControl.stop(){
return SUCCESS;
}

event void BlockWrite.writeDone(storage_result_t result, block_addr_t
address, void* buf, block_addr_t len){
if(result==STORAGE_OK){
call Leds.redToggle();
}else{
call Leds.greenToggle();
}
call BlockWrite.commit();

}

event void BlockRead.readDone(storage_result_t results, block_addr_t
x, void* buf, block_addr_t rlen){
if(results == STORAGE_OK){
temp = 0xA0;
for(i=0;i<10;i++){
if(DataReadBuf[0]==temp++)
DATA_OK = TRUE;
}
if(DATA_OK==TRUE)   
call Leds.yellowToggle();
}
}

event void Mount.mountDone(storage_result_t result, volume_id_t id) {
if(result==STORAGE_OK){
post FlashWriteTask();
}

}

event void BlockRead.verifyDone(storage_result_t result){
post FlashReadTask();
}

event void BlockRead.computeCrcDone(storage_result_t result, uint16_t
crc, block_addr_t address, block_addr_t len){}

event void BlockWrite.eraseDone(storage_result_t result){
}

event void BlockWrite.commitDone(storage_result_t result){
call BlockRead.verify();
}
}
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] set frequency and power for the CC2420 in Micaz motes

2006-06-07 Thread Michael Schippling

IF you poke down a bit further in MakeXbowLocal you should see things like:

CFLAGS +=-DCC2420_TXPOWER=TXPOWER_MAX
CFLAGS +=-DCC2420_DEF_CHANNEL=26

for the micazis that what you are looking for?
MS



Andres Aberasturi wrote:

Hi all,

At this moment I am working with the chipcon CC2420 in the MicaZ motes. 
I would like to know if I can change the frequency and the power, and 
how can I do it?


I have seen that for the mica2 motes, this is made in the MakeXbowLocal:

CFLAGS = -DCC1K_DEFAULT_FREQ=RADIO_916BAND_CHANNEL_00
CFLAGS += -DRADIO_XMIT_POWER=0xFF

But what happens if I use the MicaZ? Which range of values can I use for 
micaz?


Thanks in advance,

Andrés

_
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras 
en MSN Motor. http://motor.msn.es/researchcentre/


___
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


Re: [Tinyos-help] using flash in tinyos-2.x

2006-06-07 Thread Philip Levis
On Tue, 2006-05-30 at 22:22, Manju wrote:
> Hi,
> 
> I am working on tinyos-2_0_devel-BRANCH and telosb motes. I was trying
> to read and write from the STM25P80 flash on telosb motes.
> 
> However, I realized that most of the interfaces as defined TEP103 has
> not been implemented (or even specified in interfaces/* directory). :(
> 
> By browsing the tinyos-help achieves, I understand that Flash
> (tos/lib/Flash) is pretty well supported on tinyos-1.x. However, I
> started working with TinyOS only with 2.x version and I am not
> familiar with tinyos-1.x.
> 
> Questions:
> 1 Is there any code, supporting reading and writing of flash in
> tinyos-2.x for telosb motes?
> 
> 2) Is there a simulator type of support for flash (either separately
> or in TOSSIM), which would allow me to test my code of reading and
> writing to flash, without actually using a mote (like telosb or
> mica2)?
> 
> 3) How easy or difficult would it be to port the flash support for
> STM25P80 to tinyos-2.x code base?
> 
> Any help or suggestion would be greatly appreciated

TOSSIM currently does not have support for flash storage. Among other
things, doing so before TEP 103 was solid could just lead to a lot of
repeated work.

The best reference for doing this is how it's done in 1.x; the top-level
interfaces are just layered on top of an mmap file, which is either
named (for cross-invocation storage) or anonymous.

Phil

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


[Tinyos-help] How does CC2420 ACK implemented

2006-06-07 Thread Adam
I notice CC2420 radio control model support immediate ACKs. I am curious how
it is implemented? Is it through an explicit short message? Can we capture
the ACK message through certain tools? Thanks.

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


Re: [Tinyos-help] How does CC2420 ACK implemented

2006-06-07 Thread Philip Levis
On Wed, 2006-06-07 at 17:04, Adam wrote:
> I notice CC2420 radio control model support immediate ACKs. I am curious how
> it is implemented? Is it through an explicit short message? Can we capture
> the ACK message through certain tools? Thanks.

Check out the CC2420 data sheet.

The TinyOS 1.x stack uses hardware-generated acknowledgments. Software
processes received acknowledgments. The 2.x stack also uses
hardware-generated acknowledgments. The Boomerang stack uses
software-generated acknowledgments.

If you're digging into the CC2420, I *strongly* recommend getting a
developer's kit. They run about $600, but have software that lets you
inspect every packet sent out, which lets you really easily figure out
if a problem is in the receiver or in the transmitter.

Phil

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


Re: [Tinyos-help] Re: Packet format from PC to base mote through UART

2006-06-07 Thread Lei Tang
Thanks for you suggestion.Packetizer.java indicates the form of each packet should be :  7e    <16-bit crc>  7e. So my packet does not violate it. I think the base mote assumes a packet from UART has the form of TOS_Msg. My problem is my mote received header of each packet correctly, but not data section.
For example, if the raw data is "7E 42 7D 5E 00 00
81 05 AA 07 44 08 11 B9 25 7E", at the base mote I can see Msg->addr = 007e, Msg->type = 00, Msg->group = 81, Msg->length = 05; they all look good. But Msg->data is "25 00 00 00 00". I'm so confused.
Do you have more suggestion? Thanks.LeiOn 6/7/06, David Gay <[EMAIL PROTECTED]> wrote:
On 6/5/06, Lei Tang <[EMAIL PROTECTED]> wrote:
> I was using a general serial-port application to send data to the mote,> because I want to have my own application to control motes.A suggestion: if you want to roll your own code, start by reading
through the existing code which does what you want to do. The Javaversion (well, the part that encodes a packet for transmission over aserial port) is intinyos-1.x/tools/java/net/tinyos/packet/Packetizer.java. It does have
comments, and it does have a brief description of the protocol andencoding.David Gay
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help