Broken Pipe Py-OBD (Impossible to retrieve obd commands)

Subject of the issue

I am trying to retrieve OBD variables through python script running on a Autopi Dongle. I imported and installed the py-obd library, but unfortunately a broken pipe message is showing.

Steps to reproduce

I am using this python code

-- encoding: utf-8 --

import obd
import sys
import serial
import time

connection = obd.OBD() # auto-connects to USB or RF port

cmd = obd.commands.SPEED
response = connection.query(cmd) # send the command, and parse the response

print(response.value) # returns unit-bearing values thanks to Pint
print(“mph”)) # user-friendly unit conversions

Expected behaviour

Retrieve the obd commands from python script

Actual behaviour

It is showing this message:
File “./”, line 9, in
connection = obd.OBD() # auto-connects to USB or RF port
File “/usr/local/lib/python2.7/dist-packages/obd/”, line 61, in init
self.__connect(interface_cls, portstr, baudrate, timeout=timeout, protocol=protocol, status_callback=status_callback)
File “/usr/local/lib/python2.7/dist-packages/obd/”, line 81, in __connect
portnames = scan_serial()
File “/usr/local/lib/python2.7/dist-packages/obd/”, line 190, in scan_serial
if try_port(port):
File “/usr/local/lib/python2.7/dist-packages/obd/”, line 154, in try_port
s = serial.Serial(portStr)
File “/usr/local/lib/python2.7/dist-packages/serial/”, line 240, in init
File “/usr/local/lib/python2.7/dist-packages/serial/”, line 286, in open
File “/usr/local/lib/python2.7/dist-packages/serial/”, line 634, in _update_dtr_state
fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_DTR_str)

I have read some forums about this issue and some of them tell to set up “rtscts” and “dsrdtr” variables to true, but it is only possible through serial command, not with obd one. Could someone help me?

I’m having the exact same problem, did you find any solution?, if so could you please let me know.