[Tinyos-devel] Timer synchronization problem
Matt Welsh
mdw at eecs.harvard.edu
Tue Mar 18 06:34:29 PDT 2008
The timer ticks in binary milliseconds. So you need
TIMER_INTERVAL=10240 to represent 10 seconds.
On Mar 7, 2008, at 7:50 PM, Iñigo Urteaga wrote:
> Hi,
>
> I'm trying to synchronize a simulation in TOSSIM with an application
> running a PDE model. I have timers (using Timer<TMilli>) firing every
> 10 seconds in each node to read a variable that I am updating using
> the TOSSIM radio packet injection interface. From debug outputs using
> sim_time()/sim_ticks_per_sec() it appears that the timer is firing at
> intervals just less than 10 seconds, i.e., when TIMER_INTERVAL=10000
> the timer fires at slightly less than 10 seconds. Setting the timer
> interval for 10251 milliseconds seems to give the best results.
> However, using this, the timer fires at intervals slightly greater
> than 10 seconds using startPeriodic(TIMER_INTERVAL) (debug provided
> below). Debug for TIMER_INTERVAL=10250 is also provided, notice that
> the timer fires at just slightly under 10 seconds. My knowledge of
> TOSSIM is not deep enough to know why this might be the case, or if
> there is an easy way around this problem.
>
> Thanks in advance for any help.
>
> Kevin Barnhart
>
>
> TIMER_INTERVAL=10251
> ____________________
>
> DEBUG (1): Timer fired at time 20.021504
> DEBUG (1): Timer fired at time 30.032247
> DEBUG (1): Timer fired at time 40.042989
> DEBUG (1): Timer fired at time 50.053731
> DEBUG (1): Timer fired at time 60.064473
> DEBUG (1): Timer fired at time 70.075215
> DEBUG (1): Timer fired at time 80.085958
> DEBUG (1): Timer fired at time 90.096700
> DEBUG (1): Timer fired at time 100.107442
> DEBUG (1): Timer fired at time 110.118184
> DEBUG (1): Timer fired at time 120.128926
> DEBUG (1): Timer fired at time 130.139668
> DEBUG (1): Timer fired at time 140.150411
> DEBUG (1): Timer fired at time 150.161153
> DEBUG (1): Timer fired at time 160.171895
> DEBUG (1): Timer fired at time 170.182637
> DEBUG (1): Timer fired at time 180.193379
> DEBUG (1): Timer fired at time 190.204122
> DEBUG (1): Timer fired at time 200.214864
> DEBUG (1): Timer fired at time 210.225606
> DEBUG (1): Timer fired at time 220.236348
> DEBUG (1): Timer fired at time 230.247090
> DEBUG (1): Timer fired at time 240.257833
> DEBUG (1): Timer fired at time 250.268575
> DEBUG (1): Timer fired at time 260.279317
> DEBUG (1): Timer fired at time 270.291036
> DEBUG (1): Timer fired at time 280.300801
> DEBUG (1): Timer fired at time 290.311543
> DEBUG (1): Timer fired at time 300.322286
> DEBUG (1): Timer fired at time 310.333028
> DEBUG (1): Timer fired at time 320.343770
> DEBUG (1): Timer fired at time 330.354512
> DEBUG (1): Timer fired at time 340.365254
> DEBUG (1): Timer fired at time 350.375997
> DEBUG (1): Timer fired at time 360.386739
>
> TIMER_INTERVAL=10250
> ____________________
>
> DEBUG (1): Timer fired at time 20.021504
> DEBUG (1): Timer fired at time 30.031270
> DEBUG (1): Timer fired at time 40.041036
> DEBUG (1): Timer fired at time 50.050801
> DEBUG (1): Timer fired at time 60.060567
> DEBUG (1): Timer fired at time 70.070333
> DEBUG (1): Timer fired at time 80.080098
> DEBUG (1): Timer fired at time 90.089864
> DEBUG (1): Timer fired at time 100.099629
> DEBUG (1): Timer fired at time 110.109395
> DEBUG (1): Timer fired at time 120.119161
> DEBUG (1): Timer fired at time 130.128926
> DEBUG (1): Timer fired at time 140.138692
> DEBUG (1): Timer fired at time 150.148458
> DEBUG (1): Timer fired at time 160.158223
> DEBUG (1): Timer fired at time 170.167989
> DEBUG (1): Timer fired at time 180.177754
> DEBUG (1): Timer fired at time 190.187520
> DEBUG (1): Timer fired at time 200.197286
> DEBUG (1): Timer fired at time 210.207051
> DEBUG (1): Timer fired at time 220.216817
> DEBUG (1): Timer fired at time 230.226583
> DEBUG (1): Timer fired at time 240.236348
> DEBUG (1): Timer fired at time 250.246114
> DEBUG (1): Timer fired at time 260.255879
> DEBUG (1): Timer fired at time 270.265645
> DEBUG (1): Timer fired at time 280.275411
> DEBUG (1): Timer fired at time 290.285176
> DEBUG (1): Timer fired at time 300.294942
> DEBUG (1): Timer fired at time 310.304708
> DEBUG (1): Timer fired at time 320.314473
> DEBUG (1): Timer fired at time 330.324239
> DEBUG (1): Timer fired at time 340.334004
> DEBUG (1): Timer fired at time 350.343770
> DEBUG (1): Timer fired at time 360.353536
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
More information about the Tinyos-devel
mailing list