Dear Philip,
after that I realized the TinyOS 2.X environment generated a build
source as Build, and inside it, there is a environment
variable checking before it binds to default value, [EMAIL PROTECTED]:9002,
by using Env.getenv("MOTECOM").
how can I change the ENV setting to override this default behavior? I
tried with export option, but it seems not right.
I guess the reading dropping happened is because the
synchronized public void messageReceived(int dest_addr, Message
msg) {}
please correct me if I am wrong.
The code I used to convert temperature (in Java):
// readings contain N samples
void temperatureADC2Celsius(int moteID, int count, int[] readings){
double avgTemp = 0.0;
for(int temp : readings){
avgTemp += temp;
}
avgTemp /=readings.length;
double a=0.00130705;
double b=0.000214381;
double c=0.00093;
double R1 = 1.0;
double ADC_FS = 1023.0;
double adc = avgTemp;
double Rthr = R1 * (ADC_FS-adc) / adc;
double tempKelvin = 1 / (a + b * Math.log(Rthr) + c *
Math.pow(Math.log(Rthr),3));
double tempDegreeC = tempKelvin - 273.15;
System.out.println("Mote "+Integer.toString(moteID)+" reading at
count "+count+": "+Double.toString(tempDegreeC));
}
the values I got from this function is similar to the outputs from a
temperature meter.
It is according the Crossbow's documentation.
Philip Levis wrote:
On Jun 3, 2007, at 11:36 PM, Peizhao Hu wrote:
1. I am using SerialForwarder with port 9002. But I can't find this
definition in the Oscilloscope example. so is port 9002 a default port
number for serialforwarder and the example just bind to this default
port 9002?
Yes. Please read tutorial 4.
2. the second question is related to the temperature readings:
Mote 2 reading at count 0: 513.8
Mote 2 reading at count 2: 513.1
Mote 2 reading at count 4: 513.1
Mote 2 reading at count 6: 513.0
Mote 2 reading at count 14: 511.8
Mote 2 reading at count 17: 511.3
Mote 2 reading at count 19: 511.2
Mote 2 reading at count 22: 511.1
Mote 2 reading at count 24: 511.2
Mote 2 reading at count 27: 511.0
Mote 2 reading at count 29: 511.0
Mote 2 reading at count 32: 510.0
Mote 2 reading at count 34: 510.1
Mote 2 reading at count 37: 510.0
Mote 2 reading at count 39: 510.1
Mote 2 reading at count 43: 510.0
Mote 2 reading at count 46: 510.2
...
from the above dataset, it seems like the mote is not reporting data at
every count (I only have one mote running, so shouldn't have jump
ahead). Also, how can I convert these values into degree C temperature
value?
You're dropping packets? I'm not sure how you got floating point
numbers, so it's hard to say how to convert them to temperature...
Phil
--
regards;
Peizhao
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help