Serial download from a digital tachograph in python

Digital tachographs are a compulsory equipment for heavy trucks in the european union. The companies owning these trucks have to download the data at least once every 3 months.

Without dedicated hardware, this was so far not easily possible in linux, but my python script should make it possible to download the data with a serial cable with the right connector.

Ubuntu package

Ubuntu packages are available in my ppa. You can add my ppa with

sudo apt-add-repository ppa:k-2005

and then install loadVu with

sudo apt-get install loadvu

Usage

Start the program with

./loadvu

The data will be saved to a file named after the vehicle and date.
If your serial connection is not /dev/ttyUSB0, you should specify it with the –serial parameter. A possible call would be

./loadvu --serial /dev/ttyUSB1

Extra transfer response parameters

While the commision regulation 1360/2002 defines TREPs 1 to 6

TRTP/TREP Description
1 Overview
2 Daily Activity on a specified date
3 Events and faults
4 Detailed speed
5 Technical data
6 Card download

At least the digital tachographs from Siemens VDO return data on other requests, too. For example Daimler’s TCO-DKG program requests 17,19 and 20 and saves those to an .add file. The vu also returns data requesting trtp 18. To mimic the behaviour of tco-dkg, type

./loadvu --treps 2,3,4,5 -o mycar.esm
./loadvu --treps 17,19,20 -o mycar.add

Download of card data

It is possible to download the data stored in a driver card inserted into the vehicle unit. However, in the current version the script will add vehicle data to the file, so few programs will be able to read it. The current svn of readesm can, but the last release cannot.

./loadvu --treps 6 -o card.esm

Future versions might handle this with more elegance.

Download Speed

With a digital tachograph from 2007, loadvu tells:

$ ./loadvu
Sending 'Request Start Communication Request'
Got the expected response
Sending 'Request Diagnostic Session'
Got the expected response
Sending 'Request Request Byte rate 115200'
Got the expected response
[...]
Sending 'Request Stop Communication'
Got the expected response
data saved to UL-XX YYY 2010-11-09 to 2011-11-18 21.54 (CET).esm
Got 222772 Byte in 1789.75275612 seconds. (124.470823827 Byte/s)

It’s slow. Really slow. Considering how many trucks there are, also expensively slow. And it’s not just this script, it’s that slow with any program. Why? Hard to tell. The transfer is slowest when transferring daily activities, where many cryptographic signatures are transferred. However, there is no technical reason why these would have to be generated at every download, as the data really should not change once written.

Enjoy the script.


filetype loadvu-2011.11.tar.gz (4.96 kiB, 2011-11-18)

This entry was posted in Computers, Vehicles and tagged , , , . Bookmark the permalink.

2 Responses to Serial download from a digital tachograph in python

  1. asker says:

    Do you no any freeware/opensource windows/unix cmdline/gui program for downloading driver card data using the chipcard reader (SCR3311)?

  2. Andreas Goelzer says:

    asker: try fahrlinx. Has some bugs, hasn’t had a release in a while, but works with a similar card reader here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">