Hi 

i'm working on a VMware with XubunTOS and i'm trying to turn the 
RadioCountToLeds's  simulation (i'm not sure it's possible to). So i have 
tinyos2.X installed and the tutorial im following on lesson 11  is for TOSSIM 
in TinyOS 2.0.1 
( http://docs.tinyos.net/tinywiki/index.php/TOSSIM#Compiling_TOSSIM ). I'm just 
saying the problem is may be because the the version i'm using : for example, 
on RadioCountToLedsC.nc when it's compliled it gives : 

RadioCountToLedsC.nc:46: (near initialization for `@safe')
In file included from RadioCountToLedsAppC.nc:47:
RadioCountToLedsC.nc: In function `MilliTimer.fired':
RadioCountToLedsC.nc:88: warning: passing argument 2 of `Packet.getPayload' 
makes pointer from integer without a cast 


and the compliation is failed but when i remove @safe() from 
RadioCountToLedsC.ns  i got : 

In file included from RadioCountToLedsAppC.nc:47:
In component `RadioCountToLedsC':
RadioCountToLedsC.nc: In function `MilliTimer.fired':
RadioCountToLedsC.nc:88: warning: passing argument 2 of `Packet.getPayload' 
makes pointer from integer without a cast
RadioCountToLedsC.nc: In function ‘RadioCountToLedsC$MilliTimer$fired’:
RadioCountToLedsC.nc:88: warning: passing argument 2 of 
‘RadioCountToLedsC$Packet$getPayload’ makes pointer from integer without a cast 


and the program is compilated successfully but the result of the simulation is 
not like on the tutorial. after typing : python test.py 

ubuntu@ubuntu:/opt/tinyos-2.x/apps/RadioCountToLeds$ python test.py 
1   2   -54.0
2   1   -55.0
1   3   -60.0
3   1   -60.0
2   3   -64.0
3   2   -64.0
Creating noise model for  1
Creating noise model for  2
Creating noise model for  3
DEBUG (1): RadioCountToLedsC: timer fired, counter is 1.

Segmentation fault (core dumped) 


some help please and thank you .


Cordialement
Hamza Tayeb


________________________________
 De : Ali Shareef <[email protected]>
À : [email protected] 
Envoyé le : Dimanche 18 mars 2012 19h51
Objet : Re: [Tinyos-help] some help please
 
Salam Hamza,

Try the following.
I am also working with TinyOS.

Salam,
Ali

#! /usr/bin/python
# This file is an example Python script from the TOSSIM tutorial.
# It is intended to be used with the RadioCountToLeds application.

import sys
from TOSSIM import *
from RadioCountMsg import *

t = Tossim([])
m = t.mac();
r = t.radio();

t.addChannel("RadioCountToLedsC", sys.stdout);
t.addChannel("LedsC", sys.stdout);

for i in range(0, 2):
  m = t.getNode(i);
  m.bootAtTime((31 + t.ticksPerSecond() / 10) * i + 1);

f = open("Topologies/topo12perfect.txt", "r")
lines = f.readlines()
for line in lines:
  s = line.split()
  if (len(s) > 0):
    if (s[0] == "gain"):
      r.add(int(s[1]), int(s[2]), float(s[3]))

noise = open("Noise/meyer-heavy.txt", "r")
lines = noise.readlines()
for line in lines:
  Astr = line.strip()
  if (Astr != ""):
    val = int(Astr)
    for i in range(0, 2):
      t.getNode(i).addNoiseTraceReading(val)

for i in range(0, 60):
  t.runNextEvent();

msg = RadioCountMsg()
msg.set_counter(7);
pkt = t.newPacket();
pkt.setData(msg.data)
pkt.setType(msg.get_amType())
pkt.setDestination(0)

print "Got here";

print "Delivering ", msg, " to 0 at ", str(t.time() + 3);
pkt.deliver(0, t.time() + 3)


for i in range(0, 20):
  t.runNextEvent();
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to