1 May 2007 09:11
a problem about Tossim
<eamin_winfor <at> 126.com>
2007-05-01 07:11:38 GMT
2007-05-01 07:11:38 GMT
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
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]))
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.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);
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 :
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
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> </div>
<div>i have meet a problem about Tossim,</div>
<div>when finished the " make micaz sim " and get a "_tossim.dll" 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> </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> s = line.split()<br> if (len(s) > 0):<br> print " ", s[0], " ", s[1], " ", s[2];<br> r.add(int(s[0]), int(s[1]), float(s[2]))</div>
<div> </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> </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> </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> t.runNextEvent()<br> <br>and the result is :</div>
<div> </div>
<div>1 2 -54.0<br>2 1 -55.0 <br>1 4 -60.0 <br>4 1 -60.0 <br>2 3 -64.0 <br>3 2 -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> </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> </div>
<div> </div>
<div> </div>
<br><br>
</div>
RSS Feed