-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTCO 4.0 Structure ? #42
Comments
Hi, Can you tell me if you have an issue? BR |
I assume V1B is a different file format, ie. not DDD. If it's a different format entirely (as opposed to just a DDD format with a different extension in the filename), this project doesn't currently support it. |
Hi, I have some trucks with the old file format (DTCO3) and some trucks with the new file format (DTCO4, since june 2019). I attach the file with the three format in dtco3 in a zip and with the three format in dtco4 in other zip. Thank you in advance for your Reply! |
Hi @Bobertin89, I understand thank you. Unfortunately I don't know anything about the new standard or the effort required to implement it. Perhaps it's something @davispuh has looked at. |
Haven't really looked into it, but most structures in gen2 is different with extra fields and signature validation is completely different. |
Hi all, |
Most likely it won't be that easy, but you can try.
That's the most user friendly you'll find, I've been going over it for ages... |
Unfortunately these specs are not written to be developer friendly, which was my motivation for publishing this project in the first place (because the XML config file provides a good interpretation of the first digital spec!). |
Hi, Best regards and thank you in advance! |
Hey Guys, Ty verry much und Best regards. |
Hi @Bobertin89, I don't really understand your comment about "global value". The XML config for a card (driver or vehicle) contains definitions for the elementary files defined by the gen 1 spec. These elementary files (think of them as sections) follow each other in the ddd file. Each one starts with a magic, and this selects which bit of the config will be used to interpret that section. For example, here is the config for the driver card "CardIccIdentification" elementary file. It has a magic of
It is the responsibility of the config above to consume the entire elementary file. This is very important, because when this section is consumed we expect to put the read head at the exact start of the next elementary file, otherwise we will fail to read the correct magic for the next section and things will not work. Within the config you can consume primitive values, such as You can introduce further nesting in the XML using There are also facilities for reading repeated data from the elementary file given a count already encountered. If you need I can find examples of this. There are more esoteric facilities available too, such as reading from a cyclic buffer within the elementary file. Hopefully the gen 2 spec doesn't have these, but the feature is there! I hope this gives a reasonable overview of how the config files work. I have no idea whether the capabilities provided are sophisticated enough to process the gen 2 spec. Does it even have the concept of elementary files with magics, because this is fundamental to the current way of processing. And finally, @davispuh wrote the signature checking and I believe it is switched off by default. |
I created a new ConfigFile, which contains now the C1 or Gen2 structure. |
The code to pick the region which is going to be used for processing (based on magic) is here: https://github.com/jugglingcats/tachograph-reader/blob/master/src/DataFile.cs#L100 Clearly if the new standard has the same magic used more than once in the file there must be a way choose the correct region XML in the config to be used. I am not sure how this could/should be determined. |
Does anybody knows why Gen2 files have Objects ID's like 0x7621, 0x7622, etc. Old files have 0x7601, 0x7602..? I understand that it could specify Gen2 file but I can't find any document proving this idea. Moreover the document https://dtc.jrc.ec.europa.eu/iot_doc/EU%202016-799-EN.pdf describes that it must be 0x7601, 0x7602 because there's no difference for TREP in messages sending to old or new DTCO4.0 tachographs. |
Greetings, There is an other problem that i met. Gen 2 have new Elementary Files nammed DIR, ATR/INFO and EXTENDED_LENGHT. When the documentation redirect the user to TCS_145, TCS_146 and TCS_147 in order to complete the EF, I don't undersatnd what we really have to put in. Which type of data did i have to put in the EF ? Thanks in advance. |
@WallHackUp01 it looks like the information needed is in this ISO spec: https://www.iso.org/standard/54550.html. Unfortunately it is not free 👎. And it is annoying because the EF is variable length so in order to skip it we need to know the structure. |
There is some information regarding the ISO spec available her |
That's not true, it just looks like this isn't included in document you're looking at but if you look at latest one, there are described those TREP IDs. http://data.europa.eu/eli/reg_impl/2016/799/2018-04-17 See
|
Thank you for pointing to the information! Now it is clear. |
I'm about to dive into this myself, and it would be really handy if others have something to start with. Once/if I get this working, I intend to submit this back into the project. Hopefully others will as well! Does anyone have a working example for GEN2 stuff? |
Hi All, Just posting a note to say I haven't forgotten about my GEN2 Stuff, but the holidays and work overtook me. I'll be back on it in the new year. Hope all is well with everyone. |
It's not true. and here: https://dtc.jrc.ec.europa.eu/ The length of all EF is known. Also DIR, ATR / INFO (these EF do not appear in ddd files). Other documentation needed is ASN.1, Elliptic curve cryptography (Brainpool, NIST), etc.
Yes :) (app is not completed): https://esmreader.tachosfera.eu/ |
@mpi-wl are you going to share the code for gen2 stuff? |
@Sh0ckwav3 my library is not available as open source. |
Well so i will give it a second try... but i cant find Specifications for Vehile, anyone got one for Vehicle DDD Files? |
The file structure of vu is in the same documentation. Search for "DDP_029". The file structure from vu is differently described than the file structure from the driver card. |
@mpi-wl is our library as .net as well? Ty for your help |
JavaScript
The structure of the ddd file for the driver card AA BB CC DD EE XX XX ... XX XX AA (or BB, CC, DD ... XX.) is 1 byte AA BB - EF file id DD EE - length (data or signature) XX XX ... XX XX - data or signature Not all EF are signed (e.g. certificates) Ddd file for the VU The VU ddd file contains the data of gen 1 or gen 2 |
Don't worry :) it's not easy. Everything is ok: After 128 bytes (containing the signature for 05 04) there is 05 05 - so it's ok You can only find data for gen 2 by checking 3 byte. Unfortunately, I don't know C# well and I can't help you with the code from this project. If I find some time, I can look at this code, but I don't know if I can help you. |
What is your problem? |
Do you know if this converter works for the new tachograph files (SMART tachograph) ? |
@RazviPatcas @AskmeKolaric |
@mpi-wl |
Do you read a 1G or 2G driver card? Do you do it in the following order?
Are readable cards and non-readable cards issued by the same authority? What is the response of the Perform Hash of File (SW1, SW2) command when the error occurs? |
@mpi-wl |
Do you send commands to the card in a similar way? I don't know if I can help you. Send me an email: [email protected] |
@mpi-wl, @AskmeKolaric, it seems you are having a conversation about different software? Let's keep the conversation here about tachograph-reader |
@jugglingcats Sorry. |
Hi ! |
@WallHackUp01 a colleague and I did some experiments and could read gen2 vehicle unit files to some degree. But we used Kaitai Struct for that, it's a declarative language that compiles to source files of many programming languages (JavaScript, C#, Python etc.). We have used the tachograph-reader for quite some time and are very happy about it (thanks @jugglingcats!). So we tried to add support for gen2, as many of you tried as well, but haven't been successful. This is why we took a different direction and Kaitai Struct seems promising so far. |
@jugglingcats Alfie, would you allow a fork of this repo as AGPL3 for v.2 development? I will be adding v.2 support and want to make sure it stays in FOSS. |
Hi @rimutaka, I think the AGPL is same as or perhaps more restrictive than the vanilla GPL. I imagine that most people using tachograph-reader are static linking it with or compiling it into their proprietary code of some form. Wouldn't making it AGPL discouraged almost all potential developers from using it? Having said that you are perfectly at liberty to fork the code if you wish. Or we could think about changing the licence on this repo to LGPL which is more permissive... |
@jugglingcats , let me clarify. I want to change the license for the fork only. However, any code created before that will be under the original license. That's complicated. What I'm asking is your permission to replace the original license in my v.2 fork with (A)GPL while retaining the reference to the original project + your copyright. Then any changes made to the fork will be automatically under (A)GPL without having to delineate which part of the v.2 code is under which license. No pressure. I totally understand if you want to keep it as-is. |
Understood. I'm exploring whether you'd be happy to have a more permissive licence on this repo and make your changes here, in the interests of keeping everything in one place and avoid a fork. I'd be happy to make you a contributor so you have the ability to merge pull requests, etc. I'm not quite clear what your rationale is for wanting your changes to be AGPL, given it will prevent most people from using the code... |
What I see there is they piggy-backed on the open source and are not willing to contribute. Maybe I'm reading too much into it. |
I'm strongly against any *GPL and always prefer the least restrictive license as possible and MIT is very good :). That is true that some people may wish to build their own stuff on top of it and don't contribute anything back but that's their own choice maintaining their own fork which over time might be worse than this because it's a lot of work to merge/rebase changes especially if forks have diverged a lot.
The problem with AGPL is that this is a library to be integrated with wider software stack and that would require open sourcing those other parts which is core business of company. I would say this library alone isn't that useful without rest of functionality. For example for .ddd file downloading from different vehicle manufacturers there weren't any library at all so we built everything on own from scratch and all proprietary. The default choice for most companies is implement from scratch themselves and keep it proprietary which is kinda stupid but that's how it usually is. So 10 different companies waste time on implementing same things for no reason. If there is some library there is chance some companies will use same library and some might even contribute back thus everyone benefits :P |
That's not true. Even though I don't share my (and only mine) library as open source, I helped other people with their problems (2nd generation structure). Your opinion is unfair and harmful. |
Let's calm this discussion down folks... ;) @mpi-wl, I read your post and understood your code was not related to tachograph-reader in any way, and am sure people appreciate your contribution to the discussion / problem solving. @rimutaka can be forgiven for not picking up on this detail. @rimutaka's concern is valid especially if he is planning to contribute significant enhancements. @davispuh articulated my concern with (A)GPL perfectly. This code is going to end up embedded in bigger system and GPL licence doesn't work for any commercial company wanting to use this code in their closed source product. Perhaps we could compromise on LGPL which would be more permissive. The company I work for is generally comfortable with LGPL code. Open to suggestions / further thoughts. |
Thanks everyone for your input. I tend to agree that no license change is needed. |
Thanks @rimutaka if you are happy to contribute your changes to this repo I will give you contributor access. Perhaps you could work on a v2.x branch until it becomes stable |
@rimutaka I have made you collaborator - welcome! I am going to close this issue because it's getting rather long and covers a few different threads of conversation. I'll create a new pinned issue giving high level on DTCO 4.0 support. |
Thanks Alfie. I'll start by posting new issues for .net5 and other changes I made in that PR to make sure I'm not breaking it for everyone else. I won't be merging anything in a hurry. |
Hello I want to summarize and consult all information which I need to write update to gen2. -The structures of bytes for the segments is the same like in gen1. On the beggining I thought that I can compare length of data "application_Identification" becouse it is exacly 10 byte in gen1(pic.2) and 15 byte in gen2(pic.3) . After select generation, choosen config. But I found information that in the card can be mixed information (gen1 and gen2 segments). *"segment" mean one block of data like "application_Identification" *@Dilemma725 wrote a program which to be able to check wchich generation card is. In his code he checking first and second byte of all card byte data. My question is: |
@mpi-wl Is there somehow possible to contact you ? I want to ask few questions about project you were making, |
Hi,
from 14 JUN 2019 new Tacho will be install in the trucks. There also will
new drivercard. Has some already some test data? How will be the implemtation?
BR
Carsten
The text was updated successfully, but these errors were encountered: