Issue in Leach Protocol Installation : 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.
After completing all the steps in the link, i tried to execute the leach_test, but it shows some errors in the 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 "/Users/houcine/Documents/ns2/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /Users/houcine/Documents/ns2/ns-allinone-2.35/ns-2.35/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 /Users/houcine/Documents/ns2/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 18)
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 "/Users/houcine/Documents/ns2/ns-allinone-2.35/ns-2.35/tcl/mobility/leach.tcl" line 19)
invoked from within
"source.orig /Users/houcine/Documents/ns2/ns-allinone-2.35/ns-2.35/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 /Users/houcine/Documents/ns2/ns-allinone-2.35/ns-2.35/tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
I have made a lot of research about the solution of the problem but i didn't find anything.
Any help about this issue please ?
Thank you very much.
System : MAC OS X 10.11 El Capitain
NS 2 Version : ns 2.35
NB : The installation in MAC OSX is almost like the one on Ubuntu. The only changes is the home path.
Last edited by Hataki_Kakachi; 10-14-2015 at 09:30 AM.
Reason: Correction of the question's title
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Welcome to LQ.
32bits OS : Leach does not work with ns-2.35, in any "Linux OS". EDIT : See post #7.
So probably neither with OSX. EDIT : See post #7.
The answer to ``invalid command name "Resource/Energy"`` is usually :
A failed build. Or you are using a wrong executable 'ns'.
Besides that, the "leach test" command is :
$ export RCA_LIBRARY=/home/<name>/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/<name>/ns-allinone-2.34/ns-2.34/mit/uAMPS && ./test
( ./test will run ./leach_test. Please read the text files test, leach_test.)
The link that i followed for the installation contains a video with the execution of leach protocol on ns 2.35 and it works perfectly .
For the export RCA_LIBRARY ..... commands, the paths are already added to the .bash_profile file ( equivalent of the .bashrc file on Linux) .
Moreover , i don't have the test file in my case, i've only the leach_test file . and it is the file that is used by the guy in the video to test the leach protocol.
the installation steps and the build of the leach protocol are all done in my case, but the error is always there.
You mean by the "wrong executable ns" that the installation of ns2 on Mac OS X is not done successfully ?
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
ns-2.35 + LEACH is OK with a 64bits OS
About ns-2.35 + LEACH : Works with a 64bits OS only.
( My test : CentOS 6.7 - x86_64 ).
Your OSX may be OK with {ns-2.35 + LEACH}, if it's a 64bits OS.
----
The only "issue" I can spot is that no file leach.alive.txt is created.
May be there is an awk solution for that ? "leach.alive.txt" is useful for running $ xgraph leach.alive.txt &
Could you please send me your skype name in a private message in order to help me about this issue ? We can use teamviewer to let you verify all files of the LEACH protocol.
Using : $ tar xvf ns-allinone-2.35_gcc482.tar.gz https://drive.google.com/file/d/0B7S...ew?usp=sharing
(ns-allinone-2.35_gcc482 is the `Oct 2014' update, for all gcc/g++ versions 4.4 .. 5.2).
$ cd ns-allinone-2.35/
$ tar xvf leach_ns235_Oct2015.tar.gz
( Or : $ patch -p0 < leach_ns235-Jun2015.patch )
$ ./install
$ cd ns-2.35/
$ sudo make install
$ ./leach_test
( Before you can do './leach_test', you will still have to find all "pradeepkumar" text in ns-2.35/ :
$ grep -Rn pradeepkumar *
.... and replace `pradeepkumar' with your own path : 25 lines in 9 files.)
------
That's it. That short "instruction" is the way to do ns-2.35 + LEACH !
Will probably solve any issues you may have experienced.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #10.
""Where should I paste the attached file"" : Wherever you like.
The command 'awk -f leach__nodes-alive.awk leach.alive >> leach.alive.txt' ...
is when the files are present in the same directory. Which one doesn't matter.
ns-2.35 + LEACH works OK too with a contemporary 64bits Ubuntu OS.
My test : Ubuntu 15.04 - x86_64.
Hi sir,I am a newer,I use Ubuntu15.10 , ns-allinone-2.35_gcc482.tar.gz and leach-Octo2015,
when I do "make",there is trouble
./config.h:60:19: fatal error: tclcl.h:...
compilation terminated.
Makefile:88: recipe for target 'tools/random.o' failed
make:*** [tools/random.o] Error 1
Could you help me?
I want to use leach on ns-2.35.
Thank You!
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Post #14, @Bird2015 : Welcome to LQ.
? May be the Ubuntu 15.10 gcc/g++ -5.2 is patched to be unusable with ns2 ?
You can just use one of the other default Ubuntu 15.10 compilers (4.7, 4.8, 4.9) :
$ sudo apt-get update && sudo apt-get install g++-4.9
$ cd ns-allinone-2.35/ (assume patched with leach_ns235-Jun2015.patch or leach-Oct2015)
$ export CC=gcc-4.9 CXX=g++-4.9 && ./install
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.