BirchJD / PiOBDII

ODBII graphic interface on a Raspberry Pi computer, using an ELM327 Bluetooth/USB device. Read and display engine data, OBDII Trouble Codes & Descriptions Using Python. YouTube video: https://www.youtube.com/watch?v=yTRAhubZhsU
263 stars 71 forks source link

SyntaxError #2

Closed GevaudanBeast closed 6 years ago

GevaudanBeast commented 6 years ago

Hello, when I try to launch « python PiOBDII.py » : pi@LaCaseMove:~/PiOBDII $ python PiOBDII.py Traceback (most recent call last): File "PiOBDII.py", line 43, in <module> import ELM327 File "/home/pi/PiOBDII/ELM327.py", line 736 SyntaxError: Non-ASCII character '\xe2' in file /home/pi/PiOBDII/ELM327.py on line 736, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

BirchJD commented 6 years ago

Are you using Python 3 on a Raspberry Pi, latest Raspbian operating system and updates with the following installed? apt-get install python3 apt-get install python3-serial apt-get install python3-pygame

GevaudanBeast commented 6 years ago

Yes, off course. I have resolved the problem. In PiOBDII.py I have modified « _thread » by « thread » and remove every special character in comments « # ». I have replace « /dev/... » location with mine. Now, that seems work. But not try directly on the car, I have a black screen. It:s normal ?

BirchJD commented 6 years ago

The errors you are getting occur when running the code as Python rather than Python3. Check Python3 is installed and when the script starts it is using Python3 rather than Python.

GevaudanBeast commented 6 years ago

Since this morning I have a panic kernel, so I will reinstall a cleaner image and try again.

GevaudanBeast commented 6 years ago

Ok, when I launch « python3 PiOBDII.py » the result is a black screen. Nothing else... no choice. My dongle usb obd2 is not connected to the car.

BirchJD commented 6 years ago

I will be checking in this weeks update later today or tomorrow. It's worth checking that first as I consider this feature complete as far as I will take the code, I may make a few minor modifications in future. If you still have the same issue, let me know what display you are using, how you are connecting it to the Raspberry Pi and what resolution it is. Are you using a connected display and keyboard or an ssh session? And also if you type "uname -a" in a command line let me know what that returns.

GevaudanBeast commented 6 years ago

Hello, I use a hdmi screen 800x480 powered on usb. At home, I use a SSH for installation, on the car, I use a direct keyboard / screen. I start "Python3 PiOBDII.py" directly on the Pi Zero W (no SSH). "uname -a" return : pi@LaCaseMove:~ $ uname -a Linux LaCaseMove 4.14.34+ #1110 Mon Apr 16 14:51:42 BST 2018 armv6l GNU/Linux

I have change the /dev/ location to the ELM327.py file (/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0)

BirchJD commented 6 years ago

I have now checked in the feature complete source code, it's probably worth trying that. I think I have a Pi Zero W, hopefully I should get a chance to try it on that over the weekend, and I'll let you know how it goes.

BirchJD commented 6 years ago

I found out what is happening. When running on the light version of Raspbian, you require LXDE, light desktop, when installed on a 4GB SD I have 1685452 (~1.6GB) used and 1860924(~1.8GB) free. You need to install the following packages: apt-get install xserver-xorg apt-get install xserver-xorg-input-mouse apt-get install xserver-xorg-input-kbd apt-get install xserver-xorg-video-* apt-get install lxdm

I will update the readme file on GitHub with Raspiban light requirements.

GevaudanBeast commented 6 years ago

Hello, I thought I did not need an interface to use the script, the Pi Zero W to run, MotionEye (Camera), rPlay (AirPlay for music) and RaspAP (to share the Internet connection) these resources are limited . Do you think it possible to avoid that?

BirchJD commented 6 years ago

You may be able to boot without going to desktop and then start PiOBDII from the command line, I haven't tried. But when I reproduced the environment you had, these packages need to be installed to get it running.

GevaudanBeast commented 6 years ago

Ok, I try !!!

GevaudanBeast commented 6 years ago

Tested, don’t work. Same problem but may be I need update git ?

BirchJD commented 6 years ago

Definitely get the latest from GitHub I have updated many things. When I set up the environment with the latest Raspbian lite, I just installed the the apt-get items listed in the current README.txt file. The only one you won't need is evince, it is a PDF viewer, the others you will need. If you get an error message let me know what it says, it should help.

GevaudanBeast commented 6 years ago

Same issued blank screen... sorry how can turn on logs ?

GevaudanBeast commented 6 years ago

Work if I launch lxde

BirchJD commented 6 years ago

OK, I didn't realize PyGame library only works from the desktop environment.

GevaudanBeast commented 6 years ago

OK. No way ?

BirchJD commented 6 years ago

Thank you for helping my identify the application requires a desktop environment. I'll be able to advise others in future.