1

When I run vanet_sumo.py downloaded from https://github.com/intrig-unicamp/mininet-wifi, it doesn't find SUMO and traCI connection fails.

enter image description here

I can run run sumo configuration file successfully using sumo-gui -c 'cfg_file.sumocfg' command in command line. I imported sumo class and the error happens here in the code.

enter image description here

enter image description here

Sumo version: v1.5 enter image description here

Ubuntu 22.04

Thank you.

mani varma
  • 31
  • 1
  • 4
  • Where and how did you install sumo? If you run the vanet as root it is possible that it does not find sumo if you have it installed as normal user. Is it necessary to run vanet as root? – Michael Nov 13 '22 at 17:44
  • 1
    Yes, we need to be root to run vanet_sumo.py. I understood the issue in my case. Actually, the problem is when I print os.environ in checkBinary() method from mininet-wifi/mn-wifi/sumo/sumolib/sumolib.py file, it doesn't showup SUMO_HOME variable. It shows a few env variables. So, I added SUMO_HOME variable using Python3 os library in the code itself before searching for sumo binary in the code. The image was shared below. This way, I resolved the issue. Thank you for your response. – mani varma Nov 14 '22 at 12:49

1 Answers1

1

Yes, we need to be root to run vanet_sumo.py. I understood the issue in my case.

Actually, the problem is when I print os.environ in checkBinary() method from mininet-wifi/mn-wifi/sumo/sumolib/sumolib.py file, it doesn't show up SUMO_HOME variable. It shows a few env variables but not SUMO_HOME env. However, when I print os.environ in general python3 command line, I see SUMO_HOME. This looked strange to me. I couldn't find reason for this.

Solution :

So, I added SUMO_HOME variable i.e sumo path using Python3 os library in the code itself before searching for sumo binary in the code. The code change is shared below. This way, I resolved the issue.

enter image description here

Thank you.

mani varma
  • 31
  • 1
  • 4
  • I faced the same problem. I tried the solution method you suggested, but the problem still persists. Sumo version: 1.16 and ubuntu 22.04 – jasmin Mar 20 '23 at 10:58