[Tinyos-help] need your help
Urs Hunkeler
uhu at gmx.ch
Mon Mar 2 01:50:22 PST 2009
Hi Mohamed,
I found that in TinyOS there are 1024 ticks and not 1000ms per second,
so I would use the following formula to get the timeout for one day: 24
* 60 * 60 * 1024. If you use such a large number, be sure to add 'L' at
the end of the number to indicate the compiler that it is a long int.
The timeout would then be: 88473600L.
The way you wrote the program the radio is always on. It looks to me
that you have only one hop (e.g. the base station and a node). The node
(which runs on batteries) could turn off the radio when it does not need
it, and only turn it back on to send the message and wait for the ack.
I would transmit the raw battery reading rather than simply a message
indicating whether the battery threshold is above a certain value. You
don't gain anything in terms of message size by not transmitting the
battery voltage, and debugging (or more detailed data analysis) is so
much easier if you know the actual value.
Why do you transmit an ack? You don't seem to do anything with it. Even
so, you could use the ack mechanism provided by TinyOS rather than
implementing your own ack message.
If no ack is received, I would, after a timeout, try sending the message
again for a limited number of times, before giving up and going back to
sleep (ie. turn the radio off).
Cheers,
Urs
Mohamed H. Seddik wrote:
> Hi Urs
>
> Really, I appreciated your help.
> this is my first time with tinyos & the programming too, but i've a paper which can not be accomplised without testing or simulating it. and i could not get any help in this topic.
> I've wrote a very simple programe which for monitor the battery voltage level and at certin levels it will gives a read every day and send it to base station to be monitored.
> the packet sent containg the node_id and the voltage level until the base station sense this packet and send to the mote an ACK packet
>
> if you have any tweaks please do it and if you please to explain these tweaks because i'd like to know more about this field.
>
>
> Thanks
>
>
> Mohamed
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: BatteryC.txt
Url: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090302/1a94b97e/attachment.txt
More information about the Tinyos-help
mailing list