eamin_winfor | 1 May 2007 09:11
Favicon

a problem about Tossim

hi,

i have meet a problem about Tossim,
when  finished the " make micaz sim " and get a "_tossim.dll"  file, i use the tossim to simulate the blink,
and i do as the Toturial Lesson 11,
the test.py is:

from TOSSIM import *
import sys

t = Tossim([])
r = t.radio()
f = open("topo.txt", "r")
lines = f.readlines()
for line in lines:
  s = line.split()
  if (len(s) > 0):
    print " ", s[0], " ", s[1], " ", s[2];
    r.add(int(s[0]), int(s[1]), float(s[2]))

t.addChannel("AMControlStart", sys.stdout)
t.addChannel("Boot", sys.stdout)
t.addChannel("AMControlStartFalse", sys.stdout)
t.addChannel("Timer0Fired", sys.stdout)
t.addChannel("Send", sys.stdout)
t.addChannel("SendDone", sys.stdout)
t.addChannel("RecevieLen", sys.stdout)
t.addChannel("ReceiveCounter", sys.stdout)
t.addChannel("ReceiveNodeID", sys.stdout)

t.getNode(1).bootAtTime(100001);
t.getNode(2).bootAtTime(800008);
t.getNode(3).bootAtTime(1800009);
t.getNode(4).bootAtTime(84210);

r.setNoise(1, -100.0, 5.0)
r.setNoise(2, -100.0, 5.0)
r.setNoise(3, -100.0, 5.0)
for i in range(0, 1000):
  t.runNextEvent()

and the result is :

1   2   -54.0
2   1   -55.0 
1   4   -60.0 
4   1   -60.0 
2   3   -64.0 
3   2   -64.0

DEBUG (4): AMControl Start! 
DEBUG (4): Application Booted! 
DEBUG (1): AMControl Start! 
DEBUG (1): Application Booted! 
DEBUG (2): AMControl Start! 
DEBUG (2): Application Booted! 
DEBUG (3): AMControl Start! 
EBUG (3): Application Booted! 

It seems that the event Timer.fired( ) doesn't work.
I' m lost ,anyhelp is appriciate!

Eamin

 
 

hi,
 
i have meet a problem about Tossim,
when  finished the " make micaz sim " and get a "_tossim.dll"  file, i use the tossim to simulate the blink,
and i do as the Toturial Lesson 11,
the test.py is:
 
from TOSSIM import *
import sys

t = Tossim([])
r = t.radio()
f = open("topo.txt", "r")
lines = f.readlines()
for line in lines:
  s = line.split()
  if (len(s) > 0):
    print " ", s[0], " ", s[1], " ", s[2];
    r.add(int(s[0]), int(s[1]), float(s[2]))
 
t.addChannel("AMControlStart", sys.stdout)
t.addChannel("Boot", sys.stdout)
t.addChannel("AMControlStartFalse", sys.stdout)
t.addChannel("Timer0Fired", sys.stdout)
t.addChannel("Send", sys.stdout)
t.addChannel("SendDone", sys.stdout)
t.addChannel("RecevieLen", sys.stdout)
t.addChannel("ReceiveCounter", sys.stdout)
t.addChannel("ReceiveNodeID", sys.stdout)
 
t.getNode(1).bootAtTime(100001);
t.getNode(2).bootAtTime(800008);
t.getNode(3).bootAtTime(1800009);
t.getNode(4).bootAtTime(84210);
 
r.setNoise(1, -100.0, 5.0)
r.setNoise(2, -100.0, 5.0)
r.setNoise(3, -100.0, 5.0)
for i in range(0, 1000):
  t.runNextEvent()
 
and the result is :
 
1   2   -54.0
2   1   -55.0
1   4   -60.0
4   1   -60.0
2   3   -64.0
3   2   -64.0

DEBUG (4): AMControl Start!
DEBUG (4): Application Booted!
DEBUG (1): AMControl Start!
DEBUG (1): Application Booted!
DEBUG (2): AMControl Start!
DEBUG (2): Application Booted!
DEBUG (3): AMControl Start!
EBUG (3): Application Booted!
 
It seems that the event Timer.fired( ) doesn't work.
I' m lost ,anyhelp is appriciate!

Eamin
 
 
 


<div>
<div>hi,</div>
<div>&nbsp;</div>
<div>i have meet&nbsp;a problem about Tossim,</div>
<div>when&nbsp; finished the " make micaz sim " and get a "_tossim.dll"&nbsp; file, i use the tossim to simulate the blink,</div>
<div>and i do as the Toturial Lesson 11,</div>
<div>the test.py is:</div>
<div>&nbsp;</div>
<div>from TOSSIM import *<br>import sys</div>
<div>
<br>t = Tossim([])<br>r = t.radio()</div>
<div>f = open("topo.txt", "r")<br>lines = f.readlines()<br>for line in lines:<br>&nbsp; s = line.split()<br>&nbsp; if (len(s) &gt; 0):<br>&nbsp;&nbsp;&nbsp; print " ", s[0], " ", s[1], " ", s[2];<br>&nbsp;&nbsp;&nbsp; r.add(int(s[0]), int(s[1]), float(s[2]))</div>
<div>&nbsp;</div>
<div>t.addChannel("AMControlStart", sys.stdout)<br>t.addChannel("Boot", sys.stdout)<br>t.addChannel("AMControlStartFalse", sys.stdout)<br>t.addChannel("Timer0Fired", sys.stdout)<br>t.addChannel("Send", sys.stdout)<br>t.addChannel("SendDone", sys.stdout)<br>t.addChannel("RecevieLen", sys.stdout)<br>t.addChannel("ReceiveCounter", sys.stdout)<br>t.addChannel("ReceiveNodeID", sys.stdout)</div>
<div>&nbsp;</div>
<div>t.getNode(1).bootAtTime(100001);<br>t.getNode(2).bootAtTime(800008);<br>t.getNode(3).bootAtTime(1800009);<br>t.getNode(4).bootAtTime(84210);</div>
<div>&nbsp;</div>
<div>r.setNoise(1, -100.0, 5.0)<br>r.setNoise(2, -100.0, 5.0)<br>r.setNoise(3, -100.0, 5.0)<br>for i in range(0, 1000):<br>&nbsp; t.runNextEvent()<br>&nbsp; <br>and the result is :</div>
<div>&nbsp;</div>
<div>1&nbsp;&nbsp; 2&nbsp;&nbsp; -54.0<br>2&nbsp;&nbsp; 1&nbsp;&nbsp; -55.0 <br>1&nbsp;&nbsp; 4&nbsp;&nbsp; -60.0 <br>4&nbsp;&nbsp; 1&nbsp;&nbsp; -60.0 <br>2&nbsp;&nbsp; 3&nbsp;&nbsp; -64.0 <br>3&nbsp;&nbsp; 2&nbsp;&nbsp; -64.0</div>
<div>
<br>DEBUG (4): AMControl Start! <br>DEBUG (4): Application Booted! <br>DEBUG (1): AMControl Start! <br>DEBUG (1): Application Booted! <br>DEBUG (2): AMControl Start! <br>DEBUG (2): Application Booted! <br>DEBUG (3): AMControl Start! <br>EBUG (3): Application Booted! </div>
<div>&nbsp;</div>
<div>It seems that the event Timer.fired( ) doesn't work.</div>
<div>I' m lost ,anyhelp is appriciate!</div>
<div>
<br>Eamin</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<br><br>
</div>

Gmane