Hi,
Are sure that you have this line in your test.py file :
t.addChannel("RadioCountToLedsC", sys.stdout) ?
I show you my test.py which work with a meyer-heavy.txt file with only its
first 10 lines,
There's only 100 event steps :
------------------
#! /usr/bin/python
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("RadioCountToLedsC", sys.stdout)
t.addChannel("Boot", sys.stdout)
num_noise = 0
for j in range(0, 10):
noise = open("meyer-heavy.txt", "r")
lines = noise.readlines()
for line in lines:
num_noise = num_noise + 1
# print "noise ", num_noise
str = line.strip()
if (str != ""):
val = int(str)
for i in range(1, 4):
t.getNode(i).addNoiseTraceReading(val)
for i in range(1, 4):
print "Creating noise model for ",i;
t.getNode(i).createNoiseModel()
t.getNode(1).bootAtTime(100001);
t.getNode(2).bootAtTime(800008);
t.getNode(3).bootAtTime(1800009);
for i in range(0, 100):
# print "event ", i
t.runNextEvent()
------------------
Rémi
2009/4/17 刘�真� <[email protected]>
> Dear Mr. Philip Levis,
>> Firsrtly,I am so sorry for post this mail to a wrong address.
>> I'm doing simulation with TOSSIM in TinyOS 2.x.I have a question about
>> "runNextEvent()".
>> I did the simulation according to the TinyOS_Tutorials lesson 11(TOSSIM)
>> for RadioCountToLeds .There was a strange result that was not similar to the
>> result tutorials showed out.
>> The result is:
>> 1 2 -54.0
>> 2 1 -55.0
>> 1 3 -60.0
>> 3 1 -60.0
>> 2 3 -64.0
>> 3 2 -64.0
>> DEBUG (1): Application booted.
>> DEBUG (1): Application booted again.
>>
>> DEBUG (1): Application booted a third time.
>> DEBUG (2): Application booted.
>> DEBUG (2): Application booted again.
>> DEBUG (2): Application booted a third time.
>> DEBUG (3): Application booted.
>> DEBUG (3): Application booted again.
>>
>> DEBUG (3): Application booted a third time.
>
>
> I can't see the result as follows:
>
> DEBUG (1): RadioCountToLedsC: timer fired, counter is 1.
> DEBUG (1): RadioCountToLedsC: packet sent.
> DEBUG (2): RadioCountToLedsC: timer fired, counter is 1.
>
> DEBUG (2): RadioCountToLedsC: packet sent.
> DEBUG (3): RadioCountToLedsC: timer fired, counter is 1.
> DEBUG (3): RadioCountToLedsC: packet sent.
> DEBUG (1): RadioCountToLedsC: timer fired, counter is 2.
> DEBUG (2): RadioCountToLedsC: timer fired, counter is 2.
>
> DEBUG (3): RadioCountToLedsC: timer fired, counter is 2.
>
>
>
>> I had to change the script as this:
>> for i in range(0, 100000):
>> t.runNextEvent()
>>
>> This time the result is also wrong.
>> The mote' timer was fired continuously,but it can't trigger the event
>> "sendDone()" or "receive()"
>>
>> Can you tell me the reason?
>> I want to know what is runNextEvent and why the Timer was not fired
>> according to the period I wrote in RadioCountToLedsC.nc
>>
>> Beg your answer! Thank you so much!
>>
>
>
>>
>> WS Liu
>>
>
>
>
>
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help