LinuxQuestions.org
Review your favorite Linux distribution.
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-14-2015, 12:34 PM   #16
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled

tnx again for your replay.

Quote:
Originally Posted by knudfl*
Go to ns-2.34/, and edit the paths to your name :
$ grep -Rn knudfl *-[/QUOTE
directory of my ns in ubuntu is /etc/opt/
go to /etc/opt/ns-allinone-2.34/ns-2.34 ?and edit path?
or go to /home/saho/9tmp/ns-allinone-2.34/ns-2.34?


... 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/.)


-
pl expalin more.i dont know what shoud i do
 
Old 04-14-2015, 12:45 PM   #17
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #16.

$ cd 9tmp/ns-allinone-2.34/ns-2.34/
$ grep -Rn knudfl *
... and then edit all lines with knudfl : Edit knudfl to saho.


By the way, you are not supposed to have any ns2 in /opt/.
Default for leach is /home/saho/ns-allinone-2.34/.


-
 
1 members found this post helpful.
Old 04-14-2015, 01:56 PM   #18
SAHO
LQ Newbie
 
Registered: Mar 2015
Posts: 25

Original Poster
Rep: Reputation: Disabled
I am so thankful for the time you took to help with my project.


when runnig simulation:
Code:
export RCA_LIBRARY=/home/saho/9tmp/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/saho/9tmp/ns-allinone-2.34/ns-2.34/mit/uAMPS && ./test
warning occur:
Code:
Please use -channel as shown in tcl/ex/wireless-mitf.tcl
warning: no class variable Phy/WirelessPhy::alive_

	see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

mac/chanel.cc: INITIALIZE THE LIST xListHead
warning: no class variable Phy/WirelessPhy::alive_

	see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

warning: no class variable Phy/WirelessPhy::alive_

	see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

Loading connection pattern...
Loading scenario file...
Starting Simulation...
mac/channel.cc: sendUp - Calc highestAntennaZ_ and distCST_
mac/channel.cc: highestAntennaZ_ = 1.5,  distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...
my leach.err
Code:
mac/chanel.cc: INITIALIZE THE LIST xListHead
SORTING LISTS ...DONE!


Partial of my 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)
Node 4: (76.816643763713842,16.092541495381173)
Node 5: (88.698179828328165,94.414985316998795)
Node 6: (49.698749394015756,71.163323927281112)
Node 7: (18.752563846648002,37.040607369058115)
Node 8: (66.948251550527402,58.999779009725792)
Node 9: (84.093159662603014,13.760461338684177)
Node 10: (53.398475681151481,34.751569263055721)
Node 11: (35.43723776724061,81.252306830721125)
Node 12: (94.39568416885831,64.282461146024275)
Node 13: (75.900641584722621,81.116376016808843)
Node 14: (94.025061975244924,22.741639904091898)
Node 15: (47.483933645991577,53.024388501897633)
Node 16: (19.265831783072013,19.761381819733131)
Node 17: (52.722785367035677,65.422820470027077)
Node 18: (1.9091479489156733,83.866523198721239)
Node 19: (37.249374872655316,15.680148832351037)
Node 20: (77.114107076597449,63.760125946141841)
..
..
..

THRESH = 0.01 - ns-leach.tcl
31: ******************************************* - ns-leach.tcl
....
69 rcvd ADV_CH from 95 at 0.00037192340076594145 - ns-leach.tcl
27 rcvd ADV_CH from 95 at 0.00037192601976843799 - ns-leach.tcl
31 rcvd ADV_CH from 95 at 0.00037192860920644922 - ns-leach.tcl
66 rcvd ADV_CH from 95 at 0.00037193607648821665 - ns-leach.tcl
18 rcvd ADV_CH from 95 at 0.00037196231845486636 - ns-leach.tcl
54 rcvd ADV_CH from 95 at 0.00037196413578480914 - ns-leach.tcl
47 rcvd ADV_CH from 95 at 0.00037197426923008762 - ns-leach.tcl
0: Current cluster-head is 95, code is 1,  dist is 32.715918042681771 - ns-leach.tcl
1: Current cluster-head is 95, code is 1,  dist is 67.063908175559192 - ns-leach.tcl
..
..
..
19 sending data {19 , 1.8193381172329781} to 95 at 1.8193381172329781 (dist = 35.169893489600447) - ns-leach.tcl
CH 95 received data (19 , 1.8193381172329781) from 19 at 1.8275802344659562 - ns-leach.tcl
80 sending data {80 , 1.8277381374720205} to 95 at 1.8277381374720205 (dist = 41.241606187822342) - ns-leach.tcl
CH 95 received data (80 , 1.8277381374720205) from 80 at 1.835980274944041 - ns-leach.tcl
CH 95 must now perform comp and xmit to BS. - ns-leach.tcl
	compute_energy = 0.00198 - ns-leach.tcl
Node 95 sending {{95 , 1.835980274944041}} to BS at time 1.8437453110472473 - ns-leach.tcl
BS Received data 95 , 1.835980274944041 from 95 at time 1.8519877857415654 - mit/uAMPS/ns-bsapp.tcl 
...
..
..

79 sending data {79 , 4.3897381425501125} to 95 at 4.3897381425501125 (dist = 42.765034007937345) - ns-leach.tcl
CH 95 received data (79 , 4.3897381425501125) from 79 at 4.3979802851002257 - ns-leach.tcl
82 sending data {82 , 4.3981382031124383} to 95 at 4.3981382031124383 (dist = 60.933731777113294) - ns-leach.tcl
CH 95 received data (82 , 4.3981382031124383) from 82 at 4.4063804062248773 - ns-leach.tcl
74 sending data {74 , 4.4065381070079104} to 95 at 4.4065381070079104 (dist = 32.10237340306093) - ns-leach.tcl
CH 95 received data (74 , 4.4065381070079104) from 74 at 4.4147802140158214 - ns-leach.tcl
64 sending data {64 , 4.4149382131854287} to 95 at 4.4149382131854287 (dist = 63.955628932182599) - ns-leach.tcl
CH 95 received data (64 , 4.4149382131854287) from 64 at 4.423180426370859 - ns-leach.tcl
32 sending data {32 , 4.4233380717248707} to 95 at 4.4233380717248707 (dist = 21.517461318223035) - ns-leach.tcl
CH 95 received data (32 , 4.4233380717248707) from 32 at 4.4315801434497422 - ns-leach.tcl
33 sending data {33 , 4.4317380897910201} to 95 at 4.4317380897910201 (dist = 26.937306218960448) - ns-leach.tcl
CH 95 received data (33 , 4.4317380897910201) from 33 at 4.4399801795820411 - ns-leach.tcl
19 sending data {19 , 4.4401381172329772} to 95 at 4.4401381172329772 (dist = 35.169893489600447) - ns-leach.tcl
CH 95 received data (19 , 4.4401381172329772) from 19 at 4.4483802344659553 - ns-leach.tcl
80 sending data {80 , 4.4485381374720196} to 95 at 4.4485381374720196 (dist = 41.241606187822342) - ns-leach.tcl
CH 95 received data (80 , 4.4485381374720196) from 80 at 4.4567802749440402 - ns-leach.tcl
CH 95 must now perform comp and xmit to BS. - ns-leach.tcl
	compute_energy = 0.00198 - ns-leach.tcl
Node 95 sending {{95 , 4.4567802749440402}} to BS at time 4.4606188410730612 - ns-leach.tcl
BS Received data 95 , 4.4567802749440402 from 95 at time 4.4688613157673798 - mit/uAMPS/ns-bsapp.tcl 
This represents data from nodes: 57 9 40 60 53 23 77 78 28 50 35 10 73 36 27 12 96 87 5 15 29 83 90 13 99 2 25 61 41 8 11 30 21 17 56 81 34 68 7 55 76 84 3 22 46 18 88 43 66 72 98 62 14 59 47 75 6 91 71 97 44 16 24 4 58 70 67 51 37 86 38 0 26 69 85 49 92 20 93 63 39 89 45 48 54 65 52 94 42 31 1 79 82 74 64 32 33 19 80 95 - mit/uAMPS/ns-bsapp.tcl
57 sending data {57 , 4.4989381890333568} to 95 at 4.4989381890333568 (dist = 56.710007374425011) - ns-leach.tcl
CH 95 received data (57 , 4.4989381890333568) from 57 at 4.5071803780667148 - ns-leach.tcl
9 sending data {9 , 4.5073380864465848} to 95 at 4.5073380864465848 (dist = 25.933975595504535) - ns-leach.tcl
CH 95 received data (9 , 4.5073380864465848) from 9 at 4.5155801728931699 - ns-leach.tcl
40 sending data {40 , 4.5157382265280051} to 95 at 4.5157382265280051 (dist = 67.958401767457744) - ns-leach.tcl
tcl
 ..
Data was sent to the base station - ns-leach.tcl
62: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 62 sending {{62 , 40.001159999999999}} to BS at time 40.002653033213306 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl
63: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 63 sending {{63 , 40.001159999999999}} to BS at time 40.007423170594471 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl
64: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
...
...
...

BS Received data 33 , 48.401160000000033 from 33 at time 48.517264731731991 - mit/uAMPS/ns-bsapp.tcl 
This represents data from nodes:  - mit/uAMPS/ns-bsapp.tcl
BS Received data 85 , 48.401160000000033 from 85 at time 48.525722938115145 - mit/uAMPS/ns-bsapp.tcl 
...
...
...

BS Received data 43 , 49.241160000000036 from 43 at time 49.708086719163973 - mit/uAMPS/ns-bsapp.tcl 
This represents data from nodes:  - mit/uAMPS/ns-bsapp.tcl

At 50: - mit/uAMPS/stats.tcl
		Total Energy = 156.00720250752127
		Total Data = 4149
		Total Alive = 53

Simulation complete. - mit/uAMPS/stats.tcl
does leach work correct?
 
Old 04-14-2015, 02:41 PM   #19
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #18 : Congratulations : You did it.

The files : Looks OK.

The warnings are just informational text : Can be ignored.


-
 
Old 01-08-2018, 06:32 AM   #20
mauriz
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Hello Mr., I got same error, but my OS is Ubuntu 14.04 and when I try to install gcc-4.1, I got this

Quote:
mau@mau-Satellite-L745:~$ sudo apt-get install g++-4.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package g++-4.1
E: Couldn't find any package by regex 'g++-4.1'
mau@mau-Satellite-L745:~$ sudo apt-get install gcc-4.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gcc-4.1 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'gcc-4.1' has no installation candidate
Can you help me? Thank you for your attention
 
Old 01-08-2018, 07:59 AM   #21
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #20, @mauriz.

There is no gcc, g++ version 4.1 for Ubuntu 14.04 ...

This thread is about LEACH. No big chance with Leach + Ubuntu 14.04.
The above Leach result is 2 years old. Ubuntu 14.04 has changed a lot since then.

LEACH : Must be Ubuntu 10.04 - i386, or an even earlier 32bits Ubuntu version.
Easy to install on any 64bits computer !


Generally about ns-2.34 : Use the patch "ns234_gcc49.patch" when using a contemporary OS.
https://drive.google.com/drive/folde...00?usp=sharing

When older code (than "2012 leach"): gcc34/g++34 can be used.
64bits example
gcc34 https://drive.google.com/file/d/0B7S...ew?usp=sharing
g++34 https://drive.google.com/file/d/0B7S...3J3bnVoWGNWdG8
/view?usp=sharing
-
Attached Files
File Type: txt gcc34-64.txt (388 Bytes, 21 views)

Last edited by knudfl; 01-08-2018 at 08:38 AM.
 
Old 01-08-2018, 07:36 PM   #22
mauriz
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Thank you Mr.
I use this for my simulation
https://www.linuxquestions.org/questions/linux-software-2/how-to-integrate-the-resource-energy-leach-class-into-ns-2-34-a-870368/page20.html#post4680064
but when I run ./leach_test I got error, so I try to use this thread but I can't download gcc4.1
Quote:
When older code (than "2012 leach"): gcc34/g++34 can be used.
64bits example
gcc34 https://drive.google.com/file/d/0B7S...ew?usp=sharing
g++34 https://drive.google.com/file/d/0B7S...3J3bnVoWGNWdG8
/view?usp=sharing
-
So I must do :
1. Install ns-2.34
2. In /home/mau/ns-allinone-2.34 :
$ cd ns-2.34/
$ tar xvf ns-234-leach.tar.gz
$ bash leach-setup.sh
$ ./configure
$ make clean
$ export CC=gcc34 CXX=g++34 && make

Is that right? Thank you for your attention Mr

Last edited by mauriz; 01-09-2018 at 02:39 AM.
 
Old 01-09-2018, 01:51 AM   #23
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #22.

Edit post #22 please. Issue : the "PHP code Tag". Please remove. No code Tags required for links !

Editing : That's the 'Edit' button in post #22.
 
Old 01-09-2018, 02:41 AM   #24
mauriz
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
erorr in leach.err (invalid command name "Resource/Energy)

Sorry. I think it will be a link
 
Old 01-09-2018, 03:06 AM   #25
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #22.

The reference in post #22 https://www.linuxquestions.org/quest...ml#post4680064
... is post #289 by @exidus.
The patch for everything is "leach+pegasis_ns234.patch".

Code:
tar xvf ns-allinone-2.34.tar.gz
cd ns-allinone-2.34/
patch -p0 < ns234_gcc49.patch
patch -p0 < leach+pegasis_ns234.patch
./install
cd ns-2.34/
sudo make install
When using Ubuntu 10.04, skip the patch "ns234_gcc49.patch".


Quote:
I can't download gcc4.1
Please read post #21 : "There is no gcc, g++ version 4.1 for Ubuntu 14.04".

-
 
1 members found this post helpful.
Old 01-15-2018, 01:30 AM   #26
Ashika Naik
LQ Newbie
 
Registered: Jan 2018
Posts: 1

Rep: Reputation: Disabled
i am getting this error in leach.err file
please help. i tried all the prior posted instructions . but still error is not going
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/gecetc/ns-allinone-2.35/ns-2.35/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /home/gecetc/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 /home/gecetc/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 "/home/gecetc/ns-allinone-2.35/ns-2.35/tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig /home/gecetc/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 /home/gecetc/ns-allinone-2.35/ns-2.35/tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
 
Old 01-15-2018, 07:36 AM   #27
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #26, @Ashika Naik : Welcome to LQ.

»» invalid command name "Resource/Energy" «« :
Either you are using a wrong copy of the executable 'ns' with no Leach.
→ Please make sure that no *PATH text was added to .bashrc : Not required.
Or you have a failed build.

Build example
. https://www.linuxquestions.org/quest...-4175524367/#2

INFO, results : Posts 1007, #1009 here
https://www.linuxquestions.org/quest...68/page68.html

All info, Leach https://www.linuxquestions.org/questions/tags/leach/

-
 
  


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 07:22 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