Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-18 Thread mojtaba raznahan
Paul, Thank you very much.I got it. sincerely, On Wed, Nov 18, 2009 at 1:50 AM, Paul Johnson oewyn...@gmail.com wrote: Mojtaba, As I said before, there is nothing wrong, you are interpreting the time information incorrectly. When you print sim_time() it is in 10^-9 of a second(i

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-17 Thread mojtaba raznahan
I think i should solve this problem by specifying random numbers as clock offset between motes,and sim_time() as global time. On Mon, Nov 16, 2009 at 10:31 PM, mojtaba raznahan mojtaba.razna...@gmail.com wrote: Paul, Thanks again for your clear answers. Yes, I think like you.So due to this

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-17 Thread Paul Johnson
Yes, you can do that, but it won't accurately model a real clock because of clock skew. In general, clocks do not run at the exact same rate, their frequency tends to drift. This drift depends on a lot of factors such as temperature, humidity, etc. In TOSSIM there is no support for clock

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-17 Thread mojtaba raznahan
You're right, Paul,sim_time() returns an uint32_t measure.I see this number in the program : *DEBUG (0): Booted at time 1024 DEBUG (1): Booted at time 1320 DEBUG (2): Booted at time 6000 . . DEBUG (1): Timer fired at 1175691828 DEBUG (1): Timer fired at -1943585060 DEBUG (1): Timer fired at

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-17 Thread Paul Johnson
Mojtaba, %d in printf is used for signed 16 bit integers, you need to use %lu for 32 bit unsigned integers. -Paul mojtaba raznahan wrote: You're right, Paul,sim_time() returns an uint32_t measure.I see this number in the program : *DEBUG (0): Booted at time 1024 DEBUG (1): Booted at

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-17 Thread mojtaba raznahan
Paul, thanks,Yes corrected by %lu. but why between this to line of code there is a big gap ? *dbg(Control,AMControl started Successfully %lu .\n,sim_time()); if(TOS_NODE_ID == 1 ) { dbg(Base,This is the base station...ready for sending packets %lu.\n,sim_time()); call

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-17 Thread Paul Johnson
Mojtaba, As I said before, there is nothing wrong, you are interpreting the time information incorrectly. When you print sim_time() it is in 10^-9 of a second(i believe). This means that there are 10^9 ticks per second. The python function bootAtTime uses these ticks to set the boot time

[Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-16 Thread mojtaba raznahan
Hi all, I want to know how can I set the local time of each mote programmatically ? I want to set different local time for each node then test my synchronization algorithm on them. I used the LocalTime interface to get the local time but i can't set different initial local time for each node.And

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-16 Thread Janos Sallai
In tossim, the node object in python has a bootAtTime method which lets you set when the mote boots. You can use this to make the local clock's offsets different from each other. By the way, TOSSIM does not simulate clock skew. This might limit the validity of the simulation results. Janos On

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-16 Thread mojtaba raznahan
Hi Janos, thanks for reply. What's the meaning of this numbers ? I set the bootAtTime event as these : *t.getNode(0).bootAtTime(1024); t.getNode(1).bootAtTime(1320); t.getNode(2).bootAtTime(6000)*; And i get the time by *sim_time_string()* method and it print the boot times as this :

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-16 Thread Paul Johnson
Mojtaba, Actually, i believe the bootAtTime is in 100's of pico seconds (10^-10) seconds. So 1024 * 10^-10 = 0.001024, and apparently sim_time_string() returns time in seconds (up to nano seconds (10^-9)). There are actually 1024 milli ticks per second, so this is why each timer fired

Re: [Tinyos-help] Set local time of each mote programmatically at boot time

2009-11-16 Thread mojtaba raznahan
Paul, Thanks again for your clear answers. Yes, I think like you.So due to this issue I can't test time synchronization algorithms in TOSSIM,am I right ?Or maybe there is some interface for doing this job .. ? sincerley, Mojtaba On Mon, Nov 16, 2009 at 9:58 PM, Paul Johnson oewyn...@gmail.com