Hello friends
I wrote an application in tinyos-2.x to measure the battery voltage of a
mica2 mote. I read the data on the PC through the Listen application.
The data read from the mote was as follows. These are the consecutive
measurements taken.
00 FF FF 00 0B 02 22 01 67 40
00 FF FF 00 0B 02 22 01 67 40
00 FF FF 00 0B 02 22 01 67 80
00 FF FF 00 0B 02 22 01 67 40
00 FF FF 00 0B 02 22 01 67 80
00 FF FF 00 0B 02 22 01 67 80
00 FF FF 00 0B 02 22 01 67 80
00 FF FF 00 0B 02 22 01 67 80
I used the broadcast address to send data from the mote.The mote was
programmed using a mote ID 11. The data structure contains just nx_uint16_t
voltage as the voltage field.
typedef nx_struct Battery_Msg
{
nx_uint16_t voltage;
}battery_msg;
So,according to the message_t structure of tinyos-2.x the data field must
contain the bytes 02 22 ( Correct me if I am wrong ). Now converting this
data in decimal form and using the value in the formula give by the CrossBow
manual gives the battery voltage as 2.29 V which is a valid voltage range
for a mica2 mote.
Now i want to know if what i did was indeed correct or was by fluke. I used
the VoltageC component of tinyos-2.x to measure the voltage. Is this the
right thing to do? And if it is then is the value returned by it the true
voltage or the value to be used in the formula give in the manual. I doubt
my approach because somewhere in the mail archives i read that the value
returned is the true value and there isnt any need to use the formula. I am
not sure which one is the right thing. If indeed this is true then the data
what i measured is thoroughly wrong.
I dont know why I think that I have interpreted the message fields
incorrectly because I dont know the true size of am_addr_t , am_id_t and
am_group_t datatypes.
Please help me out
MMA
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help