ramonfontes / reproducible-research

62 stars 35 forks source link

Cant Execute LogNormalShadowing Propagation Model, Kindly assist #11

Closed harualhassan closed 5 years ago

harualhassan commented 5 years ago

!/usr/bin/python

"Propagation Model Demo"

from mininet.log import setLogLevel, info from mininet.node import Controller from mn_wifi.net import Mininet_wifi from mn_wifi.node import OVSKernelAP from mn_wifi.cli import CLI_wifi

def topology(): "Create a network." net = Mininet_wifi( controller=Controller, accessPoint=OVSKernelAP )

info("*** Creating nodes\n")
ap1 = net.addAccessPoint( 'ap1', ssid='ssid_ap1', txpower='15' , mode='g', channel='1' , position='10,10,0' )
sta1 = net.addStation( 'sta1', ip='192.168.0.1/24', txpower='15' , position='8,10,0' )
sta2 = net.addStation( 'sta2', ip='192.168.0.2/24', txpower='15' , position='11.36,10,0' )

# net.propagationModel(model='logDistance', exp=3, sL=1)
# net.propagationModel(model='ITU', pL=20)
net.propagationModel(model='logNormalShadowing', sL=2, exp=3, variance=1)
# net.propagationModel(model='friis', sL=5)
# net.propagationModel(model="twoRayGround")

info("*** Configuring wifi nodes\n")
net.configureWifiNodes()

#info("*** Adding Link\n")
#net.addLink(sta1, ap1)
#net.addLink(sta2, ap1)

net.plotGraph(max_x=120, max_y=20)

info("*** Starting network\n")
net.build()

for i in range(1,71):
    x = 10+i*1.36
    y = 10
    z = 0

    pos = '%s,%s,%s' % (x,y,z)    
    sta2.setPosition(pos)

    info("---------------------\n")    

    #info(sta2.params['position'][0])
    info(sta2.params['position'][0] -  10)
    info("m *** Dist-Sta2-Ap1\n")

    info(sta2.params['rssi'][0])
    info("dBm *** RSSI\n")   

info("*** Running CLI\n") 
CLI_wifi( net )

info("*** Stopping network\n")
net.stop()

if name == 'main': setLogLevel( 'info' ) topology()

aru@haru-HP-Laptop-15-bs0xx:~/mininet-wifi/examples$ sudo python propagationModel2.py Creating nodes Configuring wifi nodes Starting network Configuring nodes

1.36m Dist-Sta2-Ap1 -22.0dBm RSSI

2.72m Dist-Sta2-Ap1 -31.0dBm RSSI

4.08m Dist-Sta2-Ap1 -36.0dBm RSSI

5.44m Dist-Sta2-Ap1 -40.0dBm RSSI

6.8m Dist-Sta2-Ap1 -43.0dBm RSSI

8.16m Dist-Sta2-Ap1 -45.0dBm RSSI

9.52m Dist-Sta2-Ap1 -47.0dBm RSSI

10.88m Dist-Sta2-Ap1 -49.0dBm RSSI

12.24m Dist-Sta2-Ap1 -50.0dBm RSSI

13.6m Dist-Sta2-Ap1 -52.0dBm RSSI

14.96m Dist-Sta2-Ap1 -53.0dBm RSSI

16.32m Dist-Sta2-Ap1 -54.0dBm RSSI

17.68m Dist-Sta2-Ap1 -55.0dBm RSSI

19.04m Dist-Sta2-Ap1 -56.0dBm RSSI

20.4m Dist-Sta2-Ap1 -57.0dBm RSSI

21.76m Dist-Sta2-Ap1 -58.0dBm RSSI

23.12m Dist-Sta2-Ap1 -59.0dBm RSSI

24.48m Dist-Sta2-Ap1 -59.0dBm RSSI Traceback (most recent call last): File "propagationModel2.py", line 65, in topology() File "propagationModel2.py", line 45, in topology sta2.setPosition(pos) File "/usr/local/lib/python2.7/dist-packages/mininet_wifi-2.2.1d1-py2.7.egg/mn_wifi/node.py", line 346, in setPosition self.updateGraph() File "/usr/local/lib/python2.7/dist-packages/mininet_wifi-2.2.1d1-py2.7.egg/mn_wifi/node.py", line 332, in updateGraph cls.updateCircleRadius(self) File "/usr/local/lib/python2.7/dist-packages/mininet_wifi-2.2.1d1-py2.7.egg/mn_wifi/plot.py", line 272, in updateCircleRadius node.pltCircle.set_radius(max(node.params['range'])) AttributeError: 'Station' object has no attribute 'pltCircle' Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(*targs, *kargs) File "/usr/lib/python2.7/dist-packages/matplotlib/_pylab_helpers.py", line 92, in destroy_all manager.destroy() File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 570, in destroy self.canvas._tkcanvas.after_cancel(self.canvas._idle_callback) File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 617, in after_cancel data = self.tk.call('after', 'info', id) RuntimeError: main thread is not in main loop Error in sys.exitfunc: Traceback (most recent call last): File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs func(targs, **kargs) File "/usr/lib/python2.7/dist-packages/matplotlib/_pylab_helpers.py", line 92, in destroy_all manager.destroy() File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 570, in destroy self.canvas._tkcanvas.after_cancel(self.canvas._idle_callback) File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 617, in after_cancel data = self.tk.call('after', 'info', id) RuntimeError: main thread is not in main loop Kindly assist

ramonfontes commented 5 years ago

Regarding this repository, which script are you trying to reproduce? I didn't notice any problem with logNormalShadowing.

harualhassan commented 5 years ago

The program will star executing and it will stop before reaching the end and give the attached error message

Regards

Haru

Sent from my iPhone

On 16 Dec 2018, at 12:53 AM, Ramon Fontes notifications@github.com wrote:

Closed #11.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

ramonfontes commented 5 years ago

Sorry, you didn't answer my question.