[SOLVED] erorr in leach.err (invalid command name "Resource/Energy)
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
erorr in leach.err (invalid command name "Resource/Energy)
I install leach( in ns2.34 with gcc 4.4 -ubuntu 14.4)
Now i'm getting error as below in leach.err file:
Code:
invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/home/hossein/nss/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 10)
invoked from within
"source.orig /home/hossein/nss/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/hossein/nss/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 25)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Please edit post #1 to CODE Tags : [code]error output[/code]
And no colors, please. Color is for a single word.
Editing post #1 : The 'Edit' button in post #1.
Quote:
invalid command name "Resource/Energy"
Is a failed build. Or you are using an executable 'ns' with no LEACH.
? What's the output from $ which ns
The "leach ns" is supposed to be /usr/local/bin/ns
The only "patch" you can use in Ubuntu 14.04 - 32bits is leach+pegasis-ns234-files-2.tar.gz
... And : You cannot use a 64bits OS for leach ( and a lot of other protocols.)
also in
/home/saho/nss/ns-allinone-2.34/ns-2.34/mit/uAMPS/sims file ,edit uamps.tcl.
but i'm getting error in leach.err
Code:
invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/home/hossein/nss/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /home/hossein/nss/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/hossein/nss/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 24)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
also in ubuntu 10.04 ns234 gcc 4.3 ,i'm getting error:
Code:
invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/home/hosseinnn/ns/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /home/hosseinnn/ns/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/hosseinnn/ns/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 31)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
2.6.32-21 ... i686 : OK, that's Ubuntu 10.04 - 32bits.
Should be specified by every question.
Quote:
invalid command name "Resource/Energy"
Strange. Seems like you are using a wrong 'ns'. (mannasim "ns"?).
1) ? What's the reply from $ which ns
2) ? Did you add a PATH text to .bashrc ? Not required.
2.6.32-21 ... i686 : OK, that's Ubuntu 10.04 - 32bits.
Should be specified by every question.
Strange. Seems like you are using a wrong 'ns'. (mannasim "ns"?).
1) ? What's the reply from $ which ns
2) ? Did you add a PATH text to .bashrc ? Not required.
-
i didnt install mannasim. ns is working correctly.
1-/usr/local/bin/ns
2-in bashrc i added below:
NS2=/home/saho/ns/ns-allinone-2.34
PATH=$PATH:$NS2/bin:$NS2/tcl8.4.18/unix:$NS2/tk8.4.18/unix
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/saho/ns/ns-allinone-2.34/otcl-1.13:/home/saho/ns/ns-allinone-2.34/lib
TCL_LIBRARY=/home/saho/ns/ns-allinone-2.34/tcl8.4.18/library
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
OK, leach can still be built with Ubuntu 10.04.4 :
Delete the "leach ns-allinone-2.34/".
$ sudo apt-get install g++-4.1
$ tar xvf ns-allinone-2.34.tar.gz
$ cd ns-allinone-2.34/
$ tar xvf leach+pegasis-ns234-files-2.tar.gz
$ export CC=gcc-4.1 CXX=g++-4.1 && ./install
$ cd ns-2.34/
$ sudo make install
$ cp ns na234-leach ( This is your backup.)
mac/chanel.cc: INITIALIZE THE LIST xListHead
couldn't read file "mit/uAMPS/sims/nodescen.tcl": no such file or directory
while executing
"source.orig mit/uAMPS/sims/nodescen.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source $opt(sc)"
invoked from within
"if { $opt(sc) == "" } {
puts "*** NOTE: no scenario file specified. - wireless.tcl"
set opt(sc) "none"
} else {
puts "Loading scenario file...."
(file "tcl/ex/wireless.tcl" line 323)
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Quote:
"mit/uAMPS/sims/nodescen.tcl": no such file or directory
OK, download `leach-test__Ubuntu1204.tar.gz' https://drive.google.com/file/d/0B7S...ew?usp=sharing
... and unpack in /home/saho/, and you have /home/saho/9tmp/***
Go to ns-2.34/, and edit the paths to your name :
$ grep -Rn knudfl *
... Then you can run the usual "export ***** && ./test"
... in this ordered copy of the usual files.
( Or you can copy your own files / folders to the new odd locations in your current ns-allinone-2.34/.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.