saburhb / FlyNetSim

FlyNetSim: An Intergrated UAV-Network Simulator
37 stars 27 forks source link

FlyNetSim.py #2

Open Tedz10F opened 4 years ago

Tedz10F commented 4 years ago

Hello,

Firstly thank you for all of the detailed instructions, I'm currently undertaking an Undergraduate dissertation to do with evolutionary drone positioning, and read your thesis and might use the simulator to run some of my tests.

Just something that might be worth noting,

Not complaining, thought I'd let you know. Kudos for the work put into this

-Toby

saburhb commented 4 years ago

Thanks Toby for pointing out the mistakes. I will correct those in the code and instructions. Apart from the syntactical issues, some other functional issues may arise as some people tried out different cases. I have a plan to release an improved version of it. However, it may take a while, as I moved to other projects and have to manage time to work on it. Thanks, Sabur

Tedz10F commented 4 years ago

Thank you for getting back to me,

I understand other projects take priority. The simulator does not seem to be working/ communicating with ns3. If it helps for any future work I'm on Mint 19.3 Cinnamon and have followed the instructions and have correct a couple of the paths.

Best of luck with everything


From: Sabur Baidya notifications@github.com Sent: Saturday, 29 February 2020, 18:50 To: saburhb/FlyNetSim Cc: Tedz10F; Author Subject: Re: [saburhb/FlyNetSim] FlyNetSim.py (#2)

Thanks Toby for pointing out the mistakes. I will correct those in the code and instructions. Apart from the syntactical issues, some other functional issues may arise as some people tried out different cases. I have a plan to release an improved version of it. However, it may take a while, as I moved to other projects and have to manage time to work on it. Thanks, Sabur

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/saburhb/FlyNetSim/issues/2?email_source=notifications&email_token=AOQQGMYTLTZRQ7Y7MRLYC6LRFFMG7A5CNFSM4K64S6JKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENMC2UY#issuecomment-592981331, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOQQGMZCGGYE3ITIYJUBDRDRFFMG7ANCNFSM4K64S6JA.

alicesquivel commented 4 years ago

Hi guys, Totally agree with Tedz10F. Thank you saburhb for sharing your project and for all the details you provided!! I really appreciate it!!

I've been trying to make the simulator work as well. However, I faced the same issues, and I think, the simulator is not communicating with ns-3. This screenshot is so far where I started to have issues. I'm exploring the code and I will go further to see if I can fix things. Any advice or comments are more than welcome as well!

Screen Shot 2020-03-02 at 11 15 51 AM

Thank you, Alicia

saburhb commented 4 years ago

@Tedz10F, @alicesquivel , could you please run "FlyNetSim_direct_no_ns3.py" that directly connects GCS and UAV bypassing ns-3. If that works fine, you can confirm that problem could be from ns-3. Also while running, do run with "-v 3" to print with verbose mode.

@alicesquivel, your log doesn't look like ns-3 problem, as it shows "CONTROL: sending" and "CONTROL: message received". That means the first command from GCS goes through the ns-3 and reaches the UAV. However, at the UAV, it shows the error in Mavlink connection which is the connection of Ardupilot and the simulated vehicle. You probably need to debug your Ardupilot simulator separately. You can read more about that here : https://ardupilot.org/dev/docs/sitl-simulator-software-in-the-loop.html.

alicesquivel commented 4 years ago

Hi @saburhb,

Thanks for following up! If I run the simulator with ---> python FlyNetSim.py I don't get any errors. But the ARM bottom doesn't work. image

I got this error when I run ---> python FlyNetSim_direct_no_ns3.py -v 3 image

I will try debugging my Ardupilot simulator separately and then come back here! Thanks again!

Alicia

Tedz10F commented 4 years ago

Hello @saburhb @alicesquivel ,

I did test the FlyNetSim_direct_no_ns3.py with the following results: image It does appear to be working without NS3, although the box in the top right corner remains blank. and with -v 3 it doesn't want to arm image

Do you have any suggestions to integrate NS3? I am happy to manually install/configure it if you are able to let us know what NS builds/modules you used.

Again, thank you for your time with this!

Best Regards, Toby

alicesquivel commented 4 years ago

Hi guys,

Thanks for your recommendations @saburhb, they were more than useful!

I'm in the same step with you @Tedz10F image

Looking forward to your suggestions @saburhb And thanks for your time and for following up on this with us! Really appreciate it.

Best, Alicia

saburhb commented 4 years ago

@Tedz10F, @alicesquivel,

Since the FlyNetSim_direct_no_ns3.py works fine and the code FlyNetSim.py is failing, the problem should be indeed from ns-3. I would suggest you to try two things: 1) Try to run only the ns-3 alone. It would need the config.xml in its home folder (ns-3.27/) though. Check if any runtime error happens. The successful execution should connect to the ports and wait for messages from GCS.
2) If the previous step works fine, redirect the console output of ns-3 in a log file while running along with FlySim part. In the file FlyNetSim.py wherever " waf --run" is called, you redirect the output to a file and then run the FlyNetSim.py . When it crashes, check the log file and show the log if there are errors.

alicesquivel commented 4 years ago

Hi @Tedz10F, Before trying your last comment, I found out, there is another error, it happened really quickly, that I needed to record a video and then screenshot it. This happens when running FlyNetSim.py. I was comparing the experiment with the screenshots in the paper. Just after this error happens, the Network Simulator terminal closes.

image

I got this error, in the Network Simulator: image

What do you think it is? An ns-3 problem? image

Thanks for all your comments and help! :D Alicia

saburhb commented 4 years ago

@alicesquivel .. The "address already in use" error comes from the port number which is still active by some other process. It could be caused by running the FlyNetSim multiple times and if the last process did not close the sockets gracefully; Or the port number is used by some other process in the same machine. The probability of the first reason is high. I would suggest two things : (i) If restarting your machine is feasible, do restart and run the code. You should not see that specific error, Or, (ii) Change the port numbers in the code. Note that the port numbers need to be changed in both FlySim and NetSim component as per the diagram shown in the github.

alicesquivel commented 4 years ago

Hey @saburhb, Yes, that was an issue!!! Thankss for helped me to figure it out! However, I tried your previous comment and I got this error when running ns-3 alone.

image

And I think, its this error: image

I looked for that to comment it out, but I didn't find it.

Thanks for all your help!! Alicia

alicesquivel commented 4 years ago

I think I found the file in the czmq folder. I commented out the #include line, but I'm still getting the same issue. Is there a specific czmq version I need to use? I have this folder in the home folder (ns-3.27/).

I followed this for the installation: http://czmq.zeromq.org/manual:czmq

Any comments or suggestions are more than welcome!! :))))

Thanks!!! A

saburhb commented 4 years ago

@alicesquivel There should be a file : "/usr/include/czmq_prelude.h" and you should comment the line with "#include " in that file.

alicesquivel commented 4 years ago

Great!!! It's beautifully working!!! Thanks @saburhb!!! for all your help!!

image

I will run some experiments and try to integrate a map UI. I will let you know about my experiments! Thanks for all your help, comments, and suggestions! Alicia

durgesh2020 commented 4 years ago

Hello @saburhb Thank you for the FlyNetSim. I am sorry to ask you this very basic question. Whenever I try to install below: sudo apt-get install libzmq5 libzmq-dev libczmq4 libczmq-dev czmq libxml2 libxml2-dev

I get error like no candidate for czmq and libczmq4. I tried to add other repositories but no luck. Can you please tell me how to resolve this? Thank you once again and I wish a healthy and safe environment for you and your family in this pandemic.

saburhb commented 4 years ago

@durgesh2020 You can search the appropriate versions of the libraries available in the default apt sources. You can execute the following command to check the versions of czm,q libczmq and libczmq-dev and then install the latest versions: sudo apt-cache search czmq

durgesh2020 commented 4 years ago

@durgesh2020 You can search the appropriate versions of the libraries available in the default apt sources. You can execute the following command to check the versions of czm,q libczmq and libczmq-dev and then install the latest versions: sudo apt-cache search czmq

Thank you so much for reply. Is it necessary to load both version 3 and 4 of czmq?

saburhb commented 4 years ago

@durgesh2020 Try installing latest version only. In case the functions used in the code is deprecated in the latest version, you may try older version.

Eric-AI20 commented 4 years ago

I think I found the file in the czmq folder. I commented out the #include line, but I'm still getting the same issue. Is there a specific czmq version I need to use? I have this folder in the home folder (ns-3.27/).

I followed this for the installation: http://czmq.zeromq.org/manual:czmq

Any comments or suggestions are more than welcome!! :))))

Thanks!!! A

Hi @alicesquivel @saburhb , Thanks for sharing your experience, now I am facing the same issue, I commented the line with "#include " in that file however the problem still unsolved. Can you give me some advice to fix it? Much appreciate! Eric. czmq_issue01 czmq_issues02

a4ashwin commented 3 years ago

Hey @saburhb, Yes, that was an issue!!! Thankss for helped me to figure it out! However, I tried your previous comment and I got this error when running ns-3 alone.

image

And I think, its this error: image

I looked for that to comment it out, but I didn't find it.

Thanks for all your help!! Alicia

Hi @alicesquivel @saburhb , I am still facing this issue after commenting the "#include " in "/usr/include/czmq_prelude.h". How did you resolve it?