LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-13-2015, 08:28 AM   #1
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Rep: Reputation: Disabled
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)

Last edited by SAHO; 04-13-2015 at 11:03 AM.
 
Old 04-13-2015, 10:41 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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.)

-
 
Old 04-13-2015, 11:18 AM   #3
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
i did what you said for install leach :
$ tar xvf ns-allinone-2.34.tar.gz
$ cd ns-allinone-2.34/
$ patch -p0 < otcl_ns234_gcc-4.4.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ tar xvf leach+pegasis-ns234-files-2.tar.gz (The updated leach (and pegasis))
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ ./install
$ cd ns-2.34/
$ sudo make install

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)
what shoud i do?

Last edited by SAHO; 04-13-2015 at 11:22 AM.
 
Old 04-13-2015, 02:37 PM   #4
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
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)
 
Old 04-13-2015, 02:38 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
*


? What's the output from $ uname -m
 
Old 04-13-2015, 02:56 PM   #6
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
*


? What's the output from $ uname -m
i686 GNU/Linux

Last edited by SAHO; 04-13-2015 at 03:30 PM.
 
Old 04-13-2015, 03:30 PM   #7
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Linux ubuntu 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
 
Old 04-13-2015, 04:10 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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.


-

Last edited by knudfl; 04-13-2015 at 04:11 PM.
 
Old 04-13-2015, 06:34 PM   #9
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
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

export NS2
export PATH
export LD_LIBRARY_PATH
export TCL_LIBRARY
 
Old 04-14-2015, 05:29 AM   #10
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
@knudfl
I delete PATH in bashrc but it still dosent work.pl guide me .i dont know what shoud i do.

Last edited by SAHO; 04-14-2015 at 06:38 AM.
 
Old 04-14-2015, 07:52 AM   #11
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
iam waiting for your replay
 
Old 04-14-2015, 08:28 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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.)


-
 
1 members found this post helpful.
Old 04-14-2015, 09:56 AM   #13
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
OK, leach can still be built with Ubuntu 10.04.4 :

Delete the "leach ns-allinone-2.34/".
-
tnx alot for your replay.
what do you mean delete LEACH ns-allinone-2.34? i should delete ns and reinstall it?
 
Old 04-14-2015, 10:49 AM   #14
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
tnx tnx tnx .
i deleted ns and do what u said.
leach.out isnt empty.
Code:
Creating sensor nodes... - uAMPS.tcl
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 (100 == BS) - uAMPS.tcl
*** NOTE: no connection pattern specified. - wireless.tcl
Loading scenario file... - wireless.tcl
num_nodes is set 101
but iam getting new erorr.


leach.err
Code:
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)
 
Old 04-14-2015, 11:07 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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/.)


-
 
  


Reply

Tags
leach, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
invalid command"Resource/Energy" in leach.err file of exidus-pegasis-leach-patch2 flowing_river Linux - Software 0 03-16-2015 06:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration