Posts: 20
Joined: Fri Nov 21, 2014 9:59 pm

help with pyobd-pi errors

Mon Feb 18, 2019 6:17 am

i recently began trying to make a car computer system. i have been having some difficulty with getting the gui to load for some reason. it appears that it connects to the car, recieves data, and then has an error. from what i have gathered searching elsewhere on the internet it MAY have to do with essentially the obd connecter asking my car for sensors it doesnt have and then not working because of it. or it MAY be picking up data from something other than the generic obd2 protocol and wires. this is the tutorial i have followed to install it on my pi (or rather just clone it)

and this is what is displayed in the terminal window after it has an error

sudo su
[email protected]:/home/pi# python obd_gui.py
python: can't open file 'obd_gui.py': [Errno 2] No such file or directory
[email protected]:/home/pi# ls
Desktop MagPi Music Pictures Templates
Documents maps navit_icons.zip Public Videos
Downloads minicom.log navit-OSD-800-480.txt pyobd-pi
[email protected]:/home/pi# cd pyobd-pi/
[email protected]:/home/pi/pyobd-pi# python obd_gui.py
Opening interface (serial port)
Interface successfully /dev/ttyUSB0 opened
Connecting to ECU...
atz response:ELM327 v1.5
ate0 response:ate0OK
0100 response:BUS INIT: ERROR
Connected to /dev/ttyUSB0
Traceback (most recent call last):
File "obd_gui.py", line 394, in connect
File "obd_gui.py", line 50, in get_output
return self.c.capture_data()
File "/home/pi/pyobd-pi/obd_capture.py", line 44, in capture_data
self.supp = self.port.sensor(0)[1]
File "/home/pi/pyobd-pi/obd_io.py", line 226, in sensor
r = self.get_sensor_value(sensor)
File "/home/pi/pyobd-pi/obd_io.py", line 215, in get_sensor_value
data = sensor.value(data)
File "/home/pi/pyobd-pi/obd_sensors.py", line 112, in hex_to_bitstring
v = eval("0x%s" % i)
File "<string>", line 1
SyntaxError: invalid token

i do not know anything of particular importance in regards to python, so much of this is another language. (both literally and metaphorically.) but i think theres extra data throwing things off for the scanner, it reads some hex that has some other data inside it for other functions not related to obd2 and after converting it to bitstring gets something crazy and clearly not the correct value. if im reading this right and reading this other guide i found right
https://mtantawy.com/everything-you-nee ... ostic-tool

i really am not sure where to go from here, so i would appreciate any help at all in this matter. thank you

Return to “Troubleshooting”