LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-21-2014, 02:16 AM   #1
tsabran
LQ Newbie
 
Registered: Sep 2014
Posts: 8

Rep: Reputation: Disabled
Error in running leach_test in NS-2.34


Hi all,

I am trying to simulate leach on NS2 but I've had problems with running the leach_test. I've followed all steps from installing NS2 up to installing the LEACH patch (used the latest one from exidus). Here's the error message in the leach.err I found.

Code:
couldn't read file "/mit/uAMPS/uamps.tcl": no such file or directory
    while executing
"source.orig /mit/uAMPS/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/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)
Your help are very much appreciated, thanks!
 
Old 09-21-2014, 02:48 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
Leach+pegasis (@exidus) http://www.linuxquestions.org/questions/tags/pegasis/

The latest patch package is exidus-pegasis-leach-ns234-patch.2.tar.gz
https://drive.google.com/file/d/0B7S...it?usp=sharing

A build example : http://www.linuxquestions.org/questi...-a-4175504301/
( "leach+pegasis-ns234-files-2.tar.gz" is identical with
exidus-pegasis-leach-ns234-patch.2.tar.gz , it's just a different naming.)

! Important → → Using : http://www.linuxquestions.org/questi...-a-4175505299/

-

Last edited by knudfl; 09-21-2014 at 02:53 AM.
 
Old 09-21-2014, 06:56 AM   #3
tsabran
LQ Newbie
 
Registered: Sep 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
I've already followed every step, knudfl, the last issue turns out to be a problem with the directory, but now the leach.err contains this message. I'm also using the latest patch from exidus, Ubuntu 12.04, and g++-4.4.
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/tamisabran/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
    invoked from within
"source.orig /home/tamisabran/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/tamisabran/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
    (file "mit/uAMPS/sims/uamps.tcl" line 23)
    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)
I've read the posts related to similar problems, tried the solutions as well but somehow the leach.err stays like this. Do you have any other possible solution for this? Thank you in advance!
 
Old 09-21-2014, 08:08 AM   #4
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
← #3 .
Quote:
invalid command name "Resource/Energy"
May be you are using the wrong executable 'ns' ?
Solution : Delete all ns2 related PATH entries you may have in .bashrc,
and do : $ cd ns-allinone-2.34/ns-2.34/ && sudo make install
( 'make install' will copy 'ns' to /usr/local/bin/ ).

? Are you sure you are doing
export RCA_LIBRARY=/home/tsabran/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/tsabran/ns-allinone-2.34/ns-2.34/mit/uAMPS && ./test

Other possibility : You have a failed build.

-
 
Old 09-21-2014, 10:05 AM   #5
tsabran
LQ Newbie
 
Registered: Sep 2014
Posts: 8

Original Poster
Rep: Reputation: Disabled
I've followed your advice the leach_test now is running but now the leach.out is not as expected. I've also read some threads that mentions similar problems but have not exactly solved the problem I have now.
Below is content of leach.out

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
Node 0: (67.837825076579037,0.95365322239401429)
Node 1: (5.6106347616811441,59.567387057266842)
Node 2: (12.847064953691822,12.473798362758847)
Node 3: (51.243302110230225,83.015594297561606)

...

Max Distance for this Simulation is 138.0
Load complete... - wireless.tcl
Starting Simulation... - wireless.tcl
THRESH = 0.01 - ns-leach.tcl
0: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
1: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
2: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
3: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
4: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
5: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
6: ******************************************* - ns-leach.tcl

...

Cluster Head 63 broadcasting ADV at time 4.7729349769525859e-05 - ns-leach.tcl
0: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 0 sending {{0 , 0.00116}} to BS at time 0.0027482888117750588 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl

...

55 rcvd ADV_CH from 63 at 0.10513800972892393 - ns-leach.tcl
85 rcvd ADV_CH from 63 at 0.10513802212761844 - ns-leach.tcl
62 rcvd ADV_CH from 63 at 0.10513802240024794 - ns-leach.tcl
5 rcvd ADV_CH from 63 at 0.10513803192315134 - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 0 sending {{0 , 0.84116000000000002}} to BS at time 0.84175207777054617 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 1 sending {{1 , 0.84116000000000002}} to BS at time 0.84248958218982894 - ns-leach.tcl
...

Node 95 is DEAD!!!! - ns-leach.tcl
Node 96 is DEAD!!!! - ns-leach.tcl
Node 97 is DEAD!!!! - ns-leach.tcl
Node 98 is DEAD!!!! - ns-leach.tcl
Node 99 is DEAD!!!! - ns-leach.tcl

At 1.0999999999999999: - mit/uAMPS/stats.tcl
		Total Energy = 2.0152459364510666
		Total Data = 0
		Total Alive = 0

Simulation complete. - mit/uAMPS/stats.tcl

num_nodes is set 101
Thank you so so much, I really appreciate your time and help!
 
Old 02-20-2015, 05:02 PM   #6
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by tsabran View Post
I've followed your advice the leach_test now is running but now the leach.out is not as expected. I've also read some threads that mentions similar problems but have not exactly solved the problem I have now.
Below is content of leach.out

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
Node 0: (67.837825076579037,0.95365322239401429)
Node 1: (5.6106347616811441,59.567387057266842)
Node 2: (12.847064953691822,12.473798362758847)
Node 3: (51.243302110230225,83.015594297561606)

...

Max Distance for this Simulation is 138.0
Load complete... - wireless.tcl
Starting Simulation... - wireless.tcl
THRESH = 0.01 - ns-leach.tcl
0: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
1: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
2: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
3: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
4: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
5: ******************************************* - ns-leach.tcl
THRESH = 0.01 - ns-leach.tcl
6: ******************************************* - ns-leach.tcl

...

Cluster Head 63 broadcasting ADV at time 4.7729349769525859e-05 - ns-leach.tcl
0: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 0 sending {{0 , 0.00116}} to BS at time 0.0027482888117750588 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl

...

55 rcvd ADV_CH from 63 at 0.10513800972892393 - ns-leach.tcl
85 rcvd ADV_CH from 63 at 0.10513802212761844 - ns-leach.tcl
62 rcvd ADV_CH from 63 at 0.10513802240024794 - ns-leach.tcl
5 rcvd ADV_CH from 63 at 0.10513803192315134 - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 0 sending {{0 , 0.84116000000000002}} to BS at time 0.84175207777054617 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 1 sending {{1 , 0.84116000000000002}} to BS at time 0.84248958218982894 - ns-leach.tcl
...

Node 95 is DEAD!!!! - ns-leach.tcl
Node 96 is DEAD!!!! - ns-leach.tcl
Node 97 is DEAD!!!! - ns-leach.tcl
Node 98 is DEAD!!!! - ns-leach.tcl
Node 99 is DEAD!!!! - ns-leach.tcl

At 1.0999999999999999: - mit/uAMPS/stats.tcl
		Total Energy = 2.0152459364510666
		Total Data = 0
		Total Alive = 0

Simulation complete. - mit/uAMPS/stats.tcl

num_nodes is set 101
Thank you so so much, I really appreciate your time and help!
sir how u fix it about error invalid command name "Resource/Energy"
 
  


Reply

Tags
leach, ns2, pegasis, wsn



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
Leach_test file eng_mohamed_sc Linux - Software 2 08-23-2013 12:29 PM
leach_test error mehran Fedora 1 04-22-2012 10:12 AM
leach_test execution on ns2.29 ridhaasma Linux - Newbie 5 12-12-2011 03:35 AM
jhbuild: Error during phase build of gnome-shell: Error running make Kenny_Strawn Linux - Desktop 1 07-09-2010 06:01 PM
ERROR running make when installing Nvidia drivers (syntax error) randyriver10 Linux - Software 5 02-21-2004 04:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:29 PM.

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