Hi David,

>> 1. Identify the sensors from tos/platform/subfoler. Here I am a little
confused. I 'd like to read all native sensors on the Iris board. *Should I
be using sensors under "mts300"?*
**
Sorry, but i don't know much about Iris motes. Actually, i have been using
MicaZ (i think similar to Iris) and mts310 sensor board. So, if you have
mts310 sensor board, you should use  tos/platform/mts300, if you don't have
any sensor boards, than Iris mote have sensors on it, i can advise you to
check sensor  models matching with the  ones in the tos/platform/xxx
directory and try them.

>> When read is done, do:
>>event void Read1.readDone(error_t result, uint16_t data) {
>>    local.readings[Sensor1.id] = data;
>>  }
>>event void Read2.readDone(error_t result, uint16_t data) {
>>    local.readings[Sensor2.id] = data;
>>  }
You should do something like this:

 When read is done, do:
event void Read1.readDone(error_t result, uint16_t data) {
    localSensor1.readings[Index1] = data;
  }
event void Read2.readDone(error_t result, uint16_t data) {
    localSensor2.readings[Index2] = data;
  }

When the buffers are filled, you can send them over the radio in a task.
Don't forget the following;
localSensor1.id=TOS_NODE_ID;
localSensor2.id=TOS_NODE_ID+1;

in the boot handler.Oscilloscope java application will interpret each
message with different id seperately and plot related data.
Have you studied MultihopOscilloscope application? In that application (as i
recall) different motes have different id fields in their oscilloscope_t
structure. In your case, instead of multiple motes, you have multiple
sensors on a single mote. Same logic applies again.

Maybe you can read each sensor sequentally, when one sensor finishes
reading, read another one, ..... etc. Then, in your probable SendRadioMsg
task, switch between the filled buffers and send them over the air.

You could better play with those things :)

All the best,

--
Mehmet Akif Antepli



On Wed, Nov 4, 2009 at 5:58 AM, David Li <[email protected]> wrote:

> Hi Mehmet,
>
> Thanks for the info. I studied your suggestion. Here is what I think that
> have to be done. Please let me know if they are ok.
>
> 1. Identify the sensors from tos/platform/subfoler. Here I am a little
> confused. I 'd like to read all native sensors on the Iris board. *Should
> I be using sensors under "mts300"?*
>
> 2. In OscilliscopeAppC.nc: wire the new sensor components. For example, if
> I want to read Sensor1 and Sensor2, then do the following:
>
> new SensorC1() as Sensor1
> new SensorC2() as Sensor2
> ....
> Oscilliscope.Read1 -> Sensor1;
> Oscilliscope.Read2 -> Sensor2;
>
> 3. In OscilliscopeC.nc: first declare uses interfaces:
>
> interface Read1<uint16_t>;
> interface Read2<uint16_t>;
>
> Then in Timer.fired(), do:
>
> call Read1.read();
> call Read2.read()
>
> When read is done, do:
>
> event void Read1.readDone(error_t result, uint16_t data) {
>
>     local.readings[Sensor1.id] = data;
>   }
>
>
> event void Read2.readDone(error_t result, uint16_t data) {
>
>     local.readings[Sensor2.id] = data;
>   }
>
>
> Do these make sense?
>
> Thanks.
>
> - David
>
>
> On Fri, Oct 30, 2009 at 6:42 AM, Mehmet Akif Antepli <
> [email protected]> wrote:
>
>> Hi David,
>>
>> >> Can I read the native sensor data using this code?
>>
>> Yes, you can.  You should write sensor data to the "readings" field in the
>> "oscilloscope_t" structure. You can think each sensor as a different node,
>> then, for each sensor u can use "oscilloscope_t" struct and use a different
>> "id".
>>
>> Ex;
>>
>> Sensor1.id = TOS_NODE_ID;
>> Sensor2.id = TOS_NODE_ID+1;
>> Sensor3.id = TOS_NODE_ID+2;
>>
>> etc.
>>
>> >>  I don't see any obvious sensor driver code under "platform" directory
>>
>> Sensorboard directory is:
>>
>> "opt\tinyos-2.1.0\tos\sensorboards"
>>
>> so it is not under platform directory!
>>
>> Which sensor r u going to use?
>>
>> --
>> Mehmet Akif Antepli
>>
>>   On Fri, Oct 30, 2009 at 4:26 PM, David Li <[email protected]> wrote:
>>
>>>  Hi,
>>>
>>> I am running Oscilliscope application on Iris motes with Tinyos 2.1. My
>>> questions is:
>>>
>>> Can I read the native sensor data using this code? I don't see any
>>> obvious sensor driver code under "platform" directory.
>>>
>>> Thanks.
>>>
>>> - David
>>>
>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> [email protected]
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to