Well I tried turning the nodes off and on again but I get a segmentation
fault. So I tried the example c++ Driver from Tutorial 11 to be able to
use gdb on it.
I appended the Driver sourcecode with my modifications.
I compile it with:
g++ -g -c -o ctest.o ctest.cpp\
-I/data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim
g++ -g -o ctest ctest.o build/micaz/tossim.o build/micaz/sim.o\
build/micaz/c-support.o
"gdb ctest" produces:
(gdb) run
Starting program: /data/hiwi/tinyos/tinyos-2.x/apps/ProbFlooding/ctest
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x0804bd70 in sim_run_next_event ()
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/sim_tossim.c:118
#2 0x0804ae67 in Tossim::runNextEvent (this=0x80d3008)
at /data/hiwi/tinyos/tinyos-2.x/tos/lib/tossim/tossim.c:278
#3 0x08049980 in main () at ctevst.cpp:21
As I receive dbg output from my program's channel and Tossim dbg here is
the complete output of ctest (without gdb) http://jawurek.net/ProbCDUMP
At the end it appears if the sim_ticks var has overrun ?
Is this now a problem in my program for the nodes or some internal
TOSSIM error ?
Any help greatly appreciated.
Marek
ctest.cpp:
#include <tossim.h>
#include <stdlib.h>
int main()
{
Tossim * t = new Tossim(NULL);
t->addChannel("Prob",stdout);
t->addChannel("Tossim",stdout);
Radio * r = t->radio();
int maxN=3;
for(int i =0;i<maxN;i++)
{
Mote* m = t->getNode(i);
m->bootAtTime(0);
for( int j =0;j<maxN;j++)
{
if(j!=i) r->add(i,j,-50.0);
}
m->createNoiseModel();
}
while(true)
{
for (int i=0;i<500;i++){
t->runNextEvent();
}
for(int i=0;i<maxN;i++) t->getNode(i)->turnOff();
for(int i=maxN-1;i>=0;i--) t->getNode(i)->turnOn();
}
}
Am Dienstag, den 12.06.2007, 12:01 +0200 schrieb Marek Jawurek:
> Am Montag, den 11.06.2007, 09:28 -0700 schrieb Philip Levis:
> > On Jun 11, 2007, at 1:49 AM, Marek Jawurek wrote:
> >
> > > Hi,
> > >
> > > recently I ran into problems with TOSSIM of TinyOS version 1.x
> > > which did
> > > not reset completely. Motes did not communicate after the reset
> > > properly. Because of that and because of the fact that most
> > > documentation and development are done for TinyOS 2.x I changed my
> > > application to TinyOS 2.x and tried TOSSIM there.
> > >
> > > Someone should change Tutorial 11 and emphasize that without calling
> > > createNoiseModel on every Node there won't be any communication. It
> > > was
> > > rather frustrating for me to search through my code and compare it to
> > > sample code until I found the solution in the Mailinglist. Intuitively
> > > it should just work when I connect 2 nodes via Radio.add().
> > >
> > > But here is my current problems. I want to run several simulations and
> > > the following issues arise:
> > >
> > > 1. My simulation goes on forever, every call to runNextEvent returns 1
> > > but my motes only react on radio communication which is initiated by
> > > node 1 once and then just rebroadcast. Every time I rebroadcast a
> > > message I also print dbg output. No debug output is created after a
> > > while but runNextEvent still returns new events.
> >
> > Does your application have any timers in it? As long as your
> > application is doing anything, TOSSIM will simulate it... Among other
> > things, having timers means that there's a 32kHz clock running, for
> > the interface LocalTime.
>
> No, afaik it does not use Timers. I uploaded my application to
> http://jawurek.net/ProbC.nc and
> http://jawurek.net/ProbAppC.nc .
> It is a simple Probability Flooding approach. The constant PROB is
> defined in another file but from these two files you can see that there
> are no Timers involved. Does ActiveMessageC use Timers ?
>
>
> > >
> > > 2. I would like to restart a simulation in Python. That means
> > > resetting
> > > everything unique to the last run and to start another run with
> > > TOSSIM.
> > > How can I do that ? Using the constructor Tossim([]) apparently a
> > > singleton is passed because the time in the new Tossim object is the
> > > same as before. Deleting the module TOSSIM with 'del TOSSIM' and
> > > re-importing it doesn't work either.
> > >
> >
> > Hm. The current TOSSIM implementation doesn't support doing this.
> > While you can turn motes on and off to reset their internal state,
> > other pieces of state will remain, such as the radio topology. You
> > could fork within Python to get separate instances...
>
> Ok, I understand. So if I understand correctly I could turn Off all
> motes and turn them on again. This actually has the advantage of not
> having to re - set all topology related stuff. All I would have to
> account for is the new simulation start time which is not zero but the
> current time ? Do I have to call bootAtTime again for every node ? Or
> will they boot immediately ?
>
> Marek
>
>
>
>
>
>
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
--
Marek Jawurek <[EMAIL PROTECTED]>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help