LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem in running nam-1.11 of ns-allinone-2.29 (https://www.linuxquestions.org/questions/linux-newbie-8/problem-in-running-nam-1-11-of-ns-allinone-2-29-a-788391/)

rishabhk 02-11-2010 01:58 AM

problem in running nam-1.11 of ns-allinone-2.29
 
while running tcl script in ns-allinone-2.29, i am getting following error
---------------------------------------------------------------------------
rishabh@rishabh-laptop:~/Desktop/my prgs/WSN TEST-VII$ nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"rishabh@rishabh-laptop:~/Desktop/my prgs/WSN TEST-VII$ nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[string equal [tk windowingsystem] "classic"]
|| [string equal [tk windowingsystem] "aqua"]} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {..."

invoked from within
"if {[string equal [tk windowingsystem] "classic"]
|| [string equal [tk windowingsystem] "aqua"]} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {..."
---------------------------------------------------------------------------
tracefile is getting created but nam is not working.
please help me.

knudfl 02-11-2010 05:44 AM

Welcome to LQ.

[code omitted because of length], etc. :
This is a well known error. > LQ Search, and Google.

Happens, when nam is compiled with a wrong version of tcl , tk.

ns-allinone-2.29 : ns-allinone-2.29.3.tar.gz is to be used :
http://sourceforge.net/projects/nsna...allinone-2.29/
EDIT :
http://www.linuxquestions.org/questi...31-a-801695/#3
...............About the patch 'tk-8.4-lastevent.patch'

Remove all tcl, tk with your package manager = Synaptic.
And redo " ./install "
'tcl, tk version 8.4.1x can usually be reinstalled after the ns2 build.

If you have further issues : The used version of Ubuntu,
like Ubuntu 9.10 Karmic, must be told by every question ..
http://www.linuxquestions.org/linux/...Ask_a_Question
.....

Useful info : http://nsnam.isi.edu/nsnam/index.php/User_Information
.....

deb-worm 03-16-2011 03:53 AM

hi ! i'm new in the forum and i need your help..

i run ns-allinone-2.26 with 3.3 version of gcc..

when i run nam it returns :

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"

i try to do the steps you said : with patch you said , i run the patch
, it said me that succeed , but nam doesn' t work again !

i have nam 1-9 and tk8.3.2 !

what should i do?

help me....

knudfl 03-16-2011 04:22 AM

@ deb-worm, post # 3 : Welcome to LQ.

Nam is a separate application : Any 'nam' can be used.
https://docs.google.com/uc?id=0B7S25...=CLPiyxo&hl=en
> > nam-1.14.i586.tar.gz : A 32bits binary nam.
cd nam-1.14.i586/ && sudo cp nam /usr/local/bin/

64bits https://docs.google.com/uc?id=0B7S25...CN3jzIcL&hl=en
> > nam-1.14-x86_64.tar.gz

deb-worm 03-16-2011 05:21 PM

thanks @knudfl !!

i do this step :
> > nam-1.14.i586.tar.gz : A 32bits binary nam.
cd nam-1.14.i586/ && sudo cp nam /usr/local/bin/

now i type nam and it opens , but when i try to run a simple example such as :

#Create a simulator object
set ns [new Simulator]
#Open the nam trace file
set nf [open out.nam w]
$ns namtrace-all $nf
#Define a 'finish' procedure
proc finish {} {
global ns nf
$ns flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
exec nam –a out.nam &
exit 0
}
#Create two nodes
set n0 [$ns node]
set n1 [$ns node]
#Create a duplex link between the nodes
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
#Call the finish procedure after 5 seconds of simulation time
$ns at 5.0 "finish"
#Run the simulation
$ns run


the result is :

Cannot connect to existing nam instance. Starting a new one...

nam: Unable to open the file "–a.nam"


what should i do ??

knudfl 03-17-2011 05:31 AM

# 5
Quote:

exec nam –a out.nam &
Looks wrong. The example shown below works ( filename = 2nodes-1link.tcl ).
.. And it is written in "chapters", so you can use it as a template.
Please read http://www.isi.edu/nsnam/ns/tutorial/nsscript1.html
And code must be shown in code tags : [/code] at text end, [code] at start.
Please edit post 5 http://www.linuxquestions.org/questi....php?do=bbcode
Code:

set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

proc finish {} {
        global ns nf
        $ns flush-trace
        close $nf
        exec nam out.nam &
        exit 0
}

#########################################

set n0 [$ns node]
set n1 [$ns node]

$ns duplex-link $n0 $n1 1Mb 10ms DropTail

#########################################

$ns at 5.0 "finish"

$ns run

Some more examples are attached here
http://www.linuxquestions.org/questi...roblem-726993/

..


All times are GMT -5. The time now is 10:38 AM.