title: Error ([Errno 111] Connection refused) in veins (sumo-launchd.py)
body: <p>i want to use <a href="http://veins.car2x.org/" rel="nofollow">veins</a>, to co-simulate between <a href="http://www.omnetpp.org/" rel="nofollow">OMNeT++</a> network simulator and <a href="http://sumo-sim.org/" rel="nofollow">SUMO</a> road traffic simulator. </p>
  
  <p>Veins has <a href="http://veins.car2x.org/documentation/sumo-launchd/" rel="nofollow">sumo-launchd</a> daemon (written in Python), that is designed to run in the background, listening for incoming requests. On each incoming connection, it receives the simulation setup in XML format, then launches a separate instance of SUMO and proxies requests between OMNeT++ and SUMO. </p>
  
  <p>When i run <a href="https://github.com/sommer/mixim-sommer/blob/veins/sumo-launchd.py" rel="nofollow">sumo-launchd.py</a> (after opening OMNet++ and start simulation) in the terminal, i get the following issue, which i believe is Python related.</p>
  
  <pre><code>bluemix@blueMix:~/SUMO/veins-2.1/examples/veins$ python /home/bluemix/SUMO/veins-2.1/sumo-launchd.py -vv -c /home/bluemix/SUMO/sumo-0.19.0/bin/sumo
  Logging to /tmp/sumo-launchd.log
  Listening on port 9999
  Connection from 127.0.0.1 on port 45234
  Handling connection from 127.0.0.1 on port 45234
  Got TraCI message of length 2
  Got TraCI command of length 1
  Got TraCI command 0x0
  Got CMD_GETVERSION
  Got TraCI message of length 314
  Got TraCI command of length 309
  Got TraCI command 0x75
  Got CMD_FILE_SEND for "sumo-launchd.launch.xml"
  Got CMD_FILE_SEND with data "&lt;launch&gt;
    &lt;copy file="erlangen.net.xml"/&gt;
    &lt;copy file="erlangen.rou.xml"/&gt;
    &lt;copy file="erlangen.poly.xml"/&gt;
    &lt;copy file="erlangen.sumo.cfg" type="config"/&gt;
    &lt;basedir path="/home/bluemix/OMNeTpp/omnetpp-4.3.1/samples/mixim/examples/veins/"/&gt;
    &lt;seed value="0"/&gt;
  &lt;/launch&gt;
  "
  Creating temporary directory...
  Temporary dir is /tmp/sumo-launchd-tmp-2JQTRd
  Base dir is /home/bluemix/OMNeTpp/omnetpp-4.3.1/samples/mixim/examples/veins/
  Seed is 0
  Finding free port number...
  Claiming lock on port
  ...found port 41320
  Starting SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320, seed 0
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 1)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 2)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 3)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 4)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 5)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 6)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 7)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 8)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 9)
  Error ([Errno 111] Connection refused)
  Connecting to SUMO (/home/bluemix/SUMO/sumo-0.19.0/bin/sumo -c erlangen.sumo.cfg) on port 41320 (try 10)
  Error ([Errno 111] Connection refused)
  Releasing lock on port
  Cleaning up
  Result: "&lt;?xml version="1.0"?&gt;
  &lt;status&gt;
      &lt;exit-code&gt;-1&lt;/exit-code&gt;
      &lt;start&gt;1390404178&lt;/start&gt;
      &lt;end&gt;1390404189&lt;/end&gt;
      &lt;status&gt;Could not connect to SUMO ([Errno 111] Connection refused). Might be protected by a personal firewall or crashed before a connection could be established.&lt;/status&gt;
      &lt;stdout&gt;&lt;![CDATA[Loading configuration... done.
  ]]&gt;&lt;/stdout&gt;
      &lt;stderr&gt;&lt;![CDATA[Error: Empty edges in roundabout.
  Quitting (on error).
  ]]&gt;&lt;/stderr&gt;
  &lt;/status&gt;
  "
  Closing connection from 127.0.0.1 on port 45234
  ^CKeyboard interrupt.
  Shutting down.
  </code></pre>
  
  <p>and the information from OMNeT++ console:</p>
  
  <pre><code>&lt;!&gt; Error in module (TraCIScenarioManagerLaunchd) scenario.manager (id=6) at event #1, t=0: Model error: Connection to TraCI server lost. Check your server's log. Error message: 104: Connection reset by peer.
  
  TRAPPING on the exception above, due to a debug-on-errors=true configuration option. Is your debugger ready?
  
  Simulation terminated with exit code: 2
  </code></pre>
  
  <p>I googled (<a href="https://groups.google.com/forum/#!topic/omnetpp/05iHVFNhiYs" rel="nofollow">1</a>, <a href="https://groups.google.com/forum/#!topic/omnetpp/QX0SL67lJ-0" rel="nofollow">2</a>) the problem, but not exactly the same as mine.
  Thanks in advance.</p>