[Tinyos-help] a problem about Tossim

eamin_winfor at 126.com eamin_winfor at 126.com
Tue May 1 00:11:38 PDT 2007


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
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070501/dcef6e48/attachment.htm


More information about the Tinyos-help mailing list