Sunday, May 1, 2016

socket.error: [Errno 32] Broken pipe in SUMO TRACI_tls example

Problem:

$ python runner.py
Fontconfig warning: ignoring UTF-8: not a valid region tag
Loading configuration... done.
Traceback (most recent call last):
  File "runner.py", line 129, in
    run()
  File "runner.py", line 81, in run
    traci.init(PORT)
  File "../../../tools/traci/__init__.py", line 394, in init
    return getVersion()
  File "../../../tools/traci/__init__.py", line 416, in getVersion
    result = _sendExact()
  File "../../../tools/traci/__init__.py", line 238, in _sendExact
    _connections[""].send(length + _message.string)
socket.error: [Errno 32] Broken pipe

Solution:
sumoProcess = subprocess.Popen([sumoBinary, "-c", "data/cross.sumocfg", "--tripinfo-output", "tripinfo.xml", "--remote-port", str(PORT)], stdout=sys.stdout, stderr=sys.stderr)    
    time.sleep(5)   
    run()

Increase delay(ms) in SUMO GUI as 10 ms (or any value greater than zero)

Mac OSX 10.10.3, Python 2.7, SUMO 0.21 

No comments:

Post a Comment