Displaying Vehicle Information With Raspberry PI
Displaying Vehicle Information With Raspberry PI
Engineering
Introduction of the open source project “OBD display” for the world of
Internet-of-Things (IoT) including an app.
Fuel rail pressure (relative to mainfold Commanded throttle actuator 01h 4Ch
01h 22h
vacuum
Time run with MIL on 01h 4Dh
Fuel rail gauge pressure (diesel, or
01h 23h Time since trouble codes cleared 01h 4Eh
gasoline direct injection)
Oxygen sensor 1 01h 24h Get DTCs 01h 00 h
Oxygen sensor 2 01h 25h Supported PIDs 01h 00 h
Oxygen sensor 3 01h 26 h VIN message count 01h 01h
Oxygen sensor 4 01h 27h Get VIN 01h 02h
Oxygen sensor 5 01h 28h ECU name message count 01h 09h
Oxygen sensor 6 01h 29h Get ECU name 01h 0Ah
<?xml version="1.0" encoding="utf-8"?> The open source project is hosted on Github and is
<dashboard> licensed under the MIT license. The GIT project homepage
<Speed> 0</Speed> describes the compilation, the required hardware, and the
<Rpm> 0</Rpm> packages to be installed. Also the license text, numerous
.... useful tips, e.g. how to turn off the mouse pointer, and
</dashboard> some screenshots can be found there. The sources of
the libmhstcan.so (Tiny-CAN API) are included in the
Since the XML files are only simple static one-dimen- Tiny-CAN software package and not part of the GIT
sional structures, no XML library was used to write the files. repository. t
Instead g_strdup_printf and the standard file I/O functions
are used.
A Java script of the HTML page cyclically triggers
a GET request, which reads the corresponding XML file
according to the displayed page. The two modules sock_
lib.c und open_xc.c are responsible for TCP/IP commu-
nication. The sock_lib.c module creates its own thread in
which new socket connections and received data are pro-
cessed. The open_xc.c module also generates an auxil-
iary thread that triggers the cyclic transmission of the OBD
data. The used JSON message format is compatible to the
open source project Open XC of Ford Bug Labs, so the
Android, iOS libraries and apps of Open XC can be used.
As soon as an app opens the TCP/IP socket, the OBD
data is also transferred cyclically. Example of a data
record:
Sponsors