Reading an "Engine Check"

I don’t think at this stage of development there is anything written for the M2 that would let you know why an Engine Check light is on; however, I believe such a thing should be possible.

What all would need to be implemented in order to use an M2 to learn what triggered an the check engine light?

The check engine faults are called dtc and are checked basically the same way as any other OBDII PID code. This yields a fault code that looks like P0101. You then need to either have a cached list of the description for each code or look it up online. Only some codes are standard, others are vehicle specific. I agree, this would be an excellent thing to create. I could do it tomorrow. I’ll figure out the outstanding GIT stuff tomorrow too.

1 Like

I was fixing to post the exact same question…I’m a mechanic and have bought the M2 to help pull trouble codes…specifically the ones that a cheaper code readers will NOT pull…body codes etc…Looking for info on how to…
Is there some data somewhere on the web that show the format etc of this data? Essentially I know nothing and am starting from scratch.

Thanks for any and all help
Rick

The Diagnostics and Logging chapter of The Car Hacker’s Handbook may be helpful.

1 Like

I have acquired a copy of this book…the fact that it makes no mention of the M2 hardware is disappointing.

Yeah, the book was created probably a year before the M2 even existed. Though, technically the book does have my program SavvyCAN in it and SavvyCAN supports the M2 so you can bridge the gap a bit that way. Also, M2RET should allow you to create a serial CAN device from the M2 and then you can run the socketcan functions you find in the book (provided you run LINUX that is.) The general information you find in the book is directly applicable to the M2. CAN hasn’t changed; you can take the information and apply it to whatever you are running on the M2.

The diagnostics chapter in the book does cover some of what you need to know. It kind of glosses over some details. For instance, you are likely to end up with a multi-frame ISOTP reply when you ask for the DTC codes. ISOTP is mentioned in that chapter but you don’t really quite get enough details to put it all together. I suppose if you do use LINUX you can just use the socketcan utilities like they show in the book and then you don’t need to do anything special.

The most irritating part of DTC is that very many codes are not standard. You could end up getting a B2024 code and have zero idea what that means or how to fix it. I wish that manufacturers were good about releasing this info but they lock it up as tightly as they can. You pretty much don’t get any more information than they’re legally required to give you. The emissions related DTC’s are open because they had to but all the fancy stuff like transmissions and body control is much more likely to be non-standard and hard to find info on. But, there are websites like: http://www.obdii.com/codes.asp where you just might find the code anyway.

1 Like

Thanks for the reply. While pulling codes on a 2011 Chevy w a Snap on high dollar scanner it was able to do things like tell when the code was 1st set, how many start cycles since etc…any chance we might figure this stuff out?

Any chance? Sure, there’s some chance. In standard OBDII you can get the distance traveled and clock time with the engine light on. You can get number of starts since the faults were last cleared. Those things are kind of close to what you were getting reported. But, they’re for any fault at all, not stored for specific faults. I don’t believe there is any standard for getting how long a specific fault has existed for. Snap-On might be able to retrieve such information through OEM specific codes that they know about. They probably paid the money to get them. The good news is that OBDII is not secured even in the slightest so the easiest approach to snag such stuff is to tap into the CAN bus as the expensive scanner is doing its thing and then find the OBDII PIDs that are not standard. You’ll get to see the request and the reply and you can probably figure out what each super secret PID code does based on when it is sent and what the reply is. I’ve written tools to help with such things and I’m perfectly willing to help anyone give this a shot. If you want to do this you’ll need the under the dash version of the M2 and then tap into the wires in your dash that go to the OBDII plug. Then you can plug your fancy snap-on scanner in and snoop on everything it does.

I think a lot of people are totally missing the point of the Macchina and/or not understanding what its all about.

Its not an off the shelf code reader, its not a diagnostic tool…

It is a vehicle hardware layer interface, and YOU write your own software to tell the hardware what to do.

Not to sound like an ass, but if you dont know anything about Arduino, writing software/C, and the detailed operation of automotive databus architecture/messaging AND you dont want to start at the beginning and spend hundreds of hours learning about this stuff from scratch…sell the Macchina and buy an automotive scan tool…

Ben

I’m curious, what is the legality of doing such a thing and publishing the results?

Well, I’m not a lawyer and this isn’t legal advise. But, sometimes you’ve got to kind of do things and ask for forgiveness later. I’ve been party to publishing an awful lot of things gleaned by looking at CAN traffic and trying different things to see what happens. Technically the codes are secret but they’re transmitted in the clear over CAN. That’s sort of like saying something is a secret and then writing it on a wall. That’s not very secret. Maybe it’s like writing on the wall in a secret code. If I can crack that code and figure out what it means then what can you do? You did, after all, write it on the wall.

So, I guess it’s kind of a gray area. I’m sure they don’t want you to do it. I’ve probably burned all the bridges this side of the Mississippi by now. But, will anyone stop you? It’s pretty unlikely. Maybe a fit would be thrown if you tried to do this sort of reverse engineering and then put it into a 10 million dollar project. Maybe auto makers aren’t terribly fond of people like me constantly publishing details that they had left secret but they don’t seem so worried that they’re willing to do anything about it directly.

I know about arduino and writing software…am basically looking for info on developing my own scan tool and learning a bunch in the process. This is only 1 of many possible uses of the M2. I understand this.

Cool. I was struggling with what area of law this would be covered under… all hardware (and cars) is still pretty new to me.

If the is a secret code that needs to be cracked, then perhaps there would be some risk of violating the DMCA, beyond that I couldn’t think of anything unless there is some sort of contract involved in using the scanner. I was more worried about the scan tool makers than the auto manufactures, but perhaps that was naive of me.

If one has the funds, buying a scanner seems like it could be a good way to make quick progress on figuring things out.

Note: I am also not a lawyer and none of this was legal advice.

Luckily there is a DMCA exception carved out specifically to say that it’s OK to reverse engineer your own car for the purposes of self repair or allowing things to inter-operate that weren’t designed to. So, the DMCA is effectively defanged when it comes to CAN hacking. However, existing laws still apply for other things. You’re allowed to reverse engineer CAN protocols so you can put a different charger in your electric vehicle but you can’t reverse engineer wifi protocols and take over other people’s cars. That’s still stealing. You can’t do malicious things, just get the info you need to fix things and/or make them work. Luckily, I’d say none of us here are trying to steal other people’s cars or crash them into trees.

Hey 528hemi,

If you’re wanting to get data like freeze data, or things like how many runs since ___ happened… You’re going to want to look into mode 06, and mode 09. For pulling the codes you’re going to want to look into mode 03. Here is a great read on how all of this works, and how to do it yourself.

1 Like

Hey all,

I’m trying to get used to these forums… I replied to one person reply, but it appeared to just go to the bottom of the page…? So I’m just going to post the general answers here that the original poster was looking for…

How do I get OBD2 codes using M2? Well I don’t have my M2 yet, to create an example. But, I can explain how to get the codes, and how to understand them… To start, you need to go to this link, and read up on Mode 03, Mode 06, and Mode 09.

Mode 03, is a request, that will get you the OBD2 codes from the vehicle. You will use your M2, to send a request to the vehicle. The message will simply be “03”. In return to this message, you will get a message back. It’s been a while, so I will have to confirm the EXACT message. But, you will get something like “43 11 22 33 44” back from the vehicle. the “43” will be your response from the “03”. Every two bytes (ex. “11 22” or “33 44”), will be a DTC code. The first half, of the first byte, will be how you tell if it’s a P, B, or U code. You look at the first two left bits. So the first half of the first byte(“1”), converted to binary is “0001”. The first two bits are “00”. This means it is a P code. So if our code is “11 22”, it would then be P0122. This is generally how you would get, and process codes from a vehicle. Like I said, it’s been a year since I’ve written software to do this, so don’t quote me on it :stuck_out_tongue:

Everything is explained in the link I’ve provided above though. I’ve also got the software I’ve written over a year ago. I am happy to release the source, and project to the Macchina family here if requested. I will have to clean up my source code a little bit of course, before I release it (Was in a hurry writing it). Here is a little teaser:

(By the way, when I typed all of this out… and then chose to upload the picture… Everything I wrote into this reply was deleted, and replaced with a link to the picture. (Good thing I copied it all before lol).

1 Like