[Tinyos-help] Running C++ TOSSIM Simulations

Avinash Sridharan avinash.sridharan at gmail.com
Tue Jul 17 21:13:43 PDT 2007

Hi Phil,
 I was trying to use the TOSSIM that comes with tinyos 2.0.1 by following
the TOSSIM tutorial. I was primarily interested in using the new radio model
that comes with TinyOS 2.0.1.

However when I try to run the example code given in the TOSSIM tutorial with
the RadioCountToLeds application the script just prints out the python
statements and exits. Here is the output.
RuntimeWarning: Python C API version mismatch for module _TOSSIM: This
Python has API version 1013, module _TOSSIM has version 1012.
  import _TOSSIM
  1   2   -54.0
  2   1   -54.0
  2   3   -64.0
  3   2   -64.0
  1   3   -64.0
  3   1   -64.0
Creating noise model for  1
Creating noise model for  2
Creating noise model for  3

Could this be due to the warning ? I have just upgraded my system to Ubuntu
7.0.4. Do I need to recompile TOSSIM in order to remove the compatibility
warnings ?

I tried this simple example since with my other applications (that had been
working with 2.0.0 UscGainInterference model) the radio wouldn't work with

The only difference between the code in the tutorial and my example run here
is that instead of using the meyer-heavy.txt file I used a shorter noise
trace by using the first 100 lines of the meyer-heavy.txt.

Thanks in advance for the help.


On 7/12/07, Tal Rusak <tr76 at cornell.edu> wrote:
> Hi,
>      I am trying to run C++ TOSSIM simulations in order to use the gdb
> debugger to examine my code and the TinyOS library code. I have
> followed the TOSSIM tutorial 11, at
> http://www.tinyos.net/tinyos-2.x/doc/html/tutorial/lesson11.html
>      I saved the suggested C++ file as Driver.c and the makefile driver as
> Makefile.Driver. Then I complied to TOSSIM by running
> make micaz sim
> (for python)
> and
> make -f Makefile.Driver
> (for C++)
>      Then I run gdb. To begin, I simply wanted to run the program to
> completion, so I entered "run" 7.04 at the GDB plot. Whenever I try
> to run the program in this way, I get the following error message
> after the program runs for several minutes:
> Program received signal SIGSEGV, Segmentation fault.
> 0x0804dfe2 in sim_noise_trace_add (node_id=0, noiseVal=-60 '&#65533;')
>     at /opt/tinyos-2.x/tos/lib/tossim/sim_noise.c:88
> 88          memcpy(data, noiseData[node_id].noiseTrace,
> noiseData[node_id].noiseTraceLen);
>      It may be applicable to note that the program took up an increasing
> amount or RAM space on Ubuntu 7.04. It used up 98.0% of the 1 GB RAM
> (minus about 230 MB for the OS, ect) and, in one case, 51% of the my
> 4.6 GB swap partition (increased from 1 GB specifically for the
> purpose of running this program). In most subsequent runs, however,
> swap usage was lower.
>      Is there some sort of stack or heap overflow occurring due to lack of
> memory?
>      I tried to optimize the file by reducing the number of motes to 2 and
> the noise traces to 100 (the minimum allowed). However, memory usage
> was similar to the above and the error still occurred.
>      Are there any ideas about how I can resolve this issue? By the way,
> are the memory values that I cite reasonable? If so, is it possible
> to optimize the C++ somehow so it runs on computers with about 1 GB
> of RAM?
>      Any help is appreciated in advance.
> Tal
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Phd Dept. of Electrical Engineering
University of Southern California
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070717/d48ae2a2/attachment.htm

More information about the Tinyos-help mailing list