Re: [Tinyos-help] a problem about Tossim

2007-05-01 Thread Romain Thouvenin

If you use TinyOS 2.0.1, you need to update your script to be
compliant with the new radio model of tossim. It is described in the
tutorial.

Also, you didn't set the noise of your 4th node.

Hope it helps,

Romain

On 5/1/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

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(11);
t.getNode(2).bootAtTime(88);
t.getNode(3).bootAtTime(189);
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





___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] a problem about Tossim

2007-05-01 Thread eamin_winfor
hi
 
i have read the new tutorial (Lesson 11) about Tossim, but i meet a problem.
 
It seems that  event Timer.fired()  does't work.(i can see the Boot,but i 
can't seeRadioCountToLedsC: as expected in the RadioCountToLeds) 
 
by the way, i use the tinyos2.0.1
 
Any help is appreciate! 
 
Eamin
 
 ___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] a problem about Tossim

2007-05-01 Thread Philip Levis

On May 1, 2007, at 6:58 AM, [EMAIL PROTECTED] wrote:


hi

i have read the new tutorial (Lesson 11) about Tossim, but i meet a  
problem.


It seems that  event Timer.fired()  does't work.(i can see the  
Boot,but i can't seeRadioCountToLedsC: as expected in  
the RadioCountToLeds)


by the way, i use the tinyos2.0.1

Any help is appreciate!



From April 27:



The bug is in tos/chips/atm128/atm128_sim.h; this is the fix:

22,23c22,23
 #define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) + 0x20)
 #define _SFR_IO16(io_addr) _MMIO_WORD((io_addr) + 0x20)
---
 #define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) )
 #define _SFR_IO16(io_addr) _MMIO_WORD((io_addr) )


That is, the _SFR macros should not add 0x20. When they do so, then  
the timer hardware emulation breaks. The timer system becomes  
confused with the overflow settings of the timer, such that it thinks  
the counter does not reset on compare when it actually does.





Phil



___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help