ESP32 web pages and bluetooth are always something to remember. However, if problem is the range (especially with car plugs being often quite low and car metal shielding it), it won't give more distance. Cars are very difficult sometimes for radio link unless it antenna is near car windows (or external antenna on roof or whatever).
As a hint from someone who had access to a full datasheet with every value and formula for a different brand, don't think in full bytes, some values like temperatures can be odd bits long and can start at odd bits. So as an made up example, engine coolant temp is pid 123, starting at bit 8 and is 12 bits long with a formula like value/10-20.0 so a value of 0 is -20°C, a value of 1100 is 90°C. Also there are already lots of efforts to decode popular vehicles, maybe you are lucky and most of the values you look for are already found and in those databases. Once decoded you can do a lot of fun stuff with can-bus data. way more than the manufacturer intended. I had full logs of days of driving on a modern car with different drivers and such. Several gigabytes ;) Happy Christmas
In my digging over the last few days I've found a few resources where people have been doing the 350z, and it's confirmed that I'm correct on the speed and rpm I found, and has highlighted a couple more that people have flagged, but most of it isn't there yet. No worries, just means I can be the one to suss it and create the resource
I'm curious if the RPM being off in the dashboard is a miscalibration in the dash display and not the bus reporting, it seems most people don't realize that indicators aren't calibrated, the only reason I know is I have a pursuit vehicle which has a factory calibrated speedometer and it's noted on the display.
@@Iamdebugthat does appear to be the case. Using my car scanner shows the CANBus reports the RPM about 20% lower than the gauge display. It should be a simple 3x multiplier to get the true value.
@@Iamdebug I can only tell from my limited experience with a sample size of 1: on my car it's off and delayed (my newest car is almost 27 years old). it's a rough indicator, but nowhere near exact. But I'm not doing racing where I need to shift at exact points, so I don't mind. I assume, most cars have some of damping to avoid being twitchy.
@@Iamdebug it is quite well known that speed on dash is reported 10% more than the real one measured with GPS, that has been true for a lot of modern German vehicles, probably a "safety hack", because setting tire sizes (when it is possible) or using factory recommended sizes (when you can't set it in OBD) still results in speed being off by +10%, and it is true in range of 0-150, not an equation, but straight up *1.1 temperature gauge is a lot of German vehicles starts to show 100% warm (~90C) already starting at 65-70C for some reason, not sure the logic behind that, but CAN values match up to 50ish C, but then it just speeds up and stays at 100% warm when actual temp is 70-95C just thought about the speedometer, and that I haven't checked if the odometer is counting distance correctly and not adding 10% also, which would benefit people providing service for those vehicles 😁
I thought people were pretty much done with canbus youtube videos. I was looking the other day for something like this and realized I had watched all the good ones so thank you for this video. Very cool
Damn, after me using numerous ODB2 readers and apps over the years, I didn't realise how fast the CANBus can send data. This is quite a revelation lol. I must admit, my coding experience is far south of what you're able to do here, and I'm in awe of this project. Great stuff man, great stuff!!
Yeah. Lots of the data points come in at 25ms, and some of the less time sensitive are at 100ms, so it's all really responsive. Plus an ESP32 can extract everything and broadcast it all on ESPNow with basically zero packet loss. It's really impressive. I actually noticed that my gauge responded to speed changes faster than the OEM one in the centre console. Guess that's down to 20 years of technological advances.
@@GarageTinkering I'm wondering if the reason my ODB2 readers/apps are so slow is just down to being economical with the amount of data coming in. I'm curious to see what my old Accord Type R would output if the receiver was faster than the ebay readers lol Excellent stuff man, this makes me rather excited to try something out next year. I did clock your Honda comment btw, and laughed :P
This is so cool, keen to see more to come. For testing/debugging, it may be worth pre-recording a drive and serialising the data into a file that you can restream later on, save some petrol!
Someone else actually suggested that I make a web front end and it made me realise I can just dump all the data to a web endpoint and download at home. Extra advantage there that I can bundle the GPS data in with it which should make identifying things much easier if I can keep a log of what I do at which point of the drive.
Actually have a better idea. I'll just use a screen I have with an integrated microSD slot and create a simple data capture tool that self verifies and then stores all the data dump on a card. Simple.
I’ve made a gauge with micropython code utilising a pico, waveshare 1.29” GC9A01 touch display and MCP2515 CAN board. It is programmed to read Haltech CAN bus using a neat CAN protocol file I made in TOML syntax. It could do with loads of improvements but it works, I have a multifunction gauge with good refresh rate. I should update my git repo and probably do a video on it.
It really isn't. It's just lots of data. Most of the time it's just 8 bytes on a certain id. But it comes in faster than you can read. Unless it's CAN FD. Then it's more bytes. Everyone on the bus can send, lower IDs get higher priority. Termination is a bit of a thing.
Wow, I need this kind of tutorial video for Off-Grid Solar-Inverter/Charger Canbus sniffing. That was awesome how you were able to find the solutions. Great video!
this is literally the same project I've been working on lately. I have an esp32 with an external ADC for analog sensors, 2 can bus controllers for CAR ECU can bus and Transmission TCU can bus (8hp swap) and last a 433mhz receiver for aftermarket TPMS sensors since my can doesnt have it. This first ESP32 will send all the info I want to 2 other ESP32s with LCDs via ESPNOW
Sounds great. I think I'm going to incorporate a midpoint device at some point to take in all the sensors and the CAN before making it broadcast to the screens so the data only comes in from one serialised source.
This is wonderful! I'm starting the same project on my 2011 Subaru Forester XT. I have no knowledge and I found your explanation very educational. My idea is to use a larger, taller display, similar to 400x400px, to be able to display more information at the same time, such as oil temperature and oil pressure, which will come from external sensors. There's a guy who made a dash for an Infinity. You might want to take a look. If you want, I'll send you the channel. Thanks for the explanation, and I'll get to work soon!
Amazing video!! , i need that so much, I'm working on a DIY remote start for my Hyundai i40, implementing CANbus to detect lock, unlock, rpm, speed, gear position, break status and more .. so that will help me a lot , thanks man 🎉
might have missed it in the video, but its also possible to use both cores of the ESP32, so you could have one dedicated to a webserver, and the other to CAN and the screen, or even have one core dedicated to the CAN if you think its sending data at a fast enough rate to require an entire core.
Nice! There's that CANBus project you commented about on that spoiler LED light video 8 months ago 😃 I haven't even tried doing this on my car yet. A lot of great tips here, so maybe I'll give it a try in 2025 😅 Happy new year BTW 🎉
Thank you for the great video! You've made more progress than I have and have really pointed me in the right direction. I plan to receive updates on things like whether the car is locked, if the lights are on, etc., sent to my phone via SMS. I often walk away from the car and wonder if I locked it.
Great idea. You could potentially add in writing messages to the CAN so it automatically puts up the windows and locks when you leave a certain proximity
@tonylamb3906 The problem is, CAN port always has power and you will drain car's battery if you don't disconnect the CAN reader interface. You have to add a high-side transistor to cut the power after car is off for let's say 5 minutes.
@aljaz55 the shield that I used in this video does exactly that and drops the power consumption to practically 0. There are tech specs on his linked website if you're interested
Very cool! I’m working on a very interesting, yet similar, situation I’m working through. I own a 2004 Gillig Phantom bus that I converted to a mobile communication, office and sleeping platform. It communicates using j1708 and j1939 CANbus. The problem is that there’s no fuel gauge. There’s a module behind the driver seat that is connected to the CANbus and the radio system previously used by the bus company. I suspect the telemetry is transported via radio to alert the depot regarding problems and, potentially, fuel level to address maintenance issues. I picked up a package that allows me to talk to the CANbus properly, although I haven’t been able to locate the bodybuilder module to talk to the fuel tank sender. Your video provided an alternative method to address the issue - grabbing the raw data across the CANbus, manipulating the sender and watching for something that could be the fuel tank. Since I’m just looking to build a monitoring gauge, this may be the easiest approach. Much easier than trying to drive down the road with a laptop full of changing data when all I want is a small part of what’s being sent. Nicely done!
Sounds like a great project. And yeah when I get to that bit I'm going to let it run mostly empty, grab a snapshot, fill it up, and see what changes. Should give me an shortlist at least to then see what slowly depletes over time.
This was an amazing video so thanks for sharing, 99% of what you did was beyond my understanding but I enjoyed watching and will now have a look at your older videos to try and learn a bit more coding. I made a video a month or two ago about using an ESP32 with Savvycan to read the CANBUS so please have a look at that. My setup was way more simple than yours but I also have a spare gauge that I was playing with in the office, being able to play back CAN dumps in your office makes life a little easier/warmer.
@@GarageTinkering Oh wow, thanks for mentioning ESP Mesh! I didn't know about that before, but i have a MASSIVE use-case for this in a project of mine ♥ That didn't exist back in the day, so i used regular infrastructure, but this will be a game changer 😁
@@jangrewe FOR REAL. I stumbled across it last week and haven't had a chance to play with it yet, but the fact you can just add new nodes to the network and not have to inform your current ones that it exists I think is really interesting. Just going to be a case of seeing how fast it is, and how good the message filtering and data types are
Well done indeed. I was investigating whether to log parameters from my Volvo and I found that there are multiple accelerator and other parameters, quite confusing. It would be interesting to compare, but I have too little time.
There is a serial plotter in Arduino IDE, if you have data with labels, like you do, just open the serial grapher thing in arduino and it will plot it for you. Sometimes you have to tweak the format of your serail log
It is sad that I don't have a car anymore to experiment on, but what you want to do is write a packet filter that throws away everything you flagged as known! That way you can relatively quickly cleanup the CAN messages you do not need to work on!
I noticed a pattern on the RPM numbers, 2250, 3500 and I bet the 4700 is actually 4750. Essentially what you end up with is an extra 125 RPM for every 1000 RPM.
So spoiler alert for an upcoming video, but turns out the drivers gauge over reports compared to what the ECU is actually saying. I used a 3.4ish scaling ratio in the end, but it should have been 3.
Excellent video. Something Im getting into. Suggestion for a video RSPB have spring Garden bird watch coming up, What about a video on collecting the data images times ID of the birds etc and sending it to the RSPB systems?
Fantastic video! At first this had me wondering if I could use this method to read out my fuel gauge. I have on 06 G35x, and the resistors on the cluster board that provide the proper voltage for my fuel gauge are likely the culprit behind my fuel gauge not reading properly, as I've verified that everything from the variable resistor inside the tank up to the back of my cluster is in working order... but the fact that the nav system is also unable to provide an MPG makes me think that those resistors are a component of preprocessing before providing the information under the designated canbus ID.
As far as I'm aware, that's something that should totally be doable without needing to attach any resistors or anything. It's something I'm going to be taking on in a couple of videos time so we'll have the answer soon enough.
@ Awesome. Look forward to it. The resistors are actually the components that cause the fuel gauge error… the solder on them cracks over time. I haven’t felt inclined to actually open my cluster up to verify it yet though.
Correction: By flipping GPIO4 and 5 you did not flip the CAN H and CAN L pins. Those are always the same as per the OBD2 standard. You flipped which pins are connected to the Receive and Transmit pins of the CAN transceiver. The transceiver takes CAN H and CAN L signals and level-shifts them into the data you see and/or turns your data into CAN signal to be sent.
Given that GPS speed measurement is pretty reliable, perhaps loop in a GPS to obtain the actual speed, then use that as an off-set to correct the OBD numbers... Could run that loop a few times a min to get a continuous correction factor. Also, during your earlier test: I perhaps would have wired up that screen and placed it near the dashboard screen; filmed both then review at your leisure when reviewing the footage. Keeps plod happy too as you can focus entirely on driving rather than looking at screens...
I have a 2008 350Z and I recently got a BlueDriver Bluetooth Pro - which I don't really like, HOWEVER, one thing that device does give me that I haven't seen anywhere else, is it can tell me which tire pressure sensor has reported low air whereas on the dash, I just get one light without any indication of which tire is low. It would be nice if this project were able to report which tire pressure sensor has triggered. The single light on the dash is of course, useful, but not as useful as it could be.
Nice project. From the developer's point of view I'd rather limit the screen FPS to keep it in one place, rather than limit the transmission rate of every other sensor that you will want to add. Or during the handshake between screen and sensor, the screen can request specific data rate.
Good question. I don't know is the honest answer. I'm being suuuuper careful and doing prep before I write anything to the BUS. Don't want to brick the car
@@GarageTinkering The world of canbus is pretty extensive, on BMW's you can control AC, radio and other stuff, they don't run over the normal OBD2 canbus tho, the car as a couple of different BUS, K-CAN(Karosserie CAN) for interior lights, climate, steering wheel controls(you can even intercept the controls and do some cool stuff) as mentioned, and other stuff, and D-CAN(Diagnostics CAN), just like you are plugged in. Not sure how it goes in the Nissan world but really wouldn't be surprised if they have something similar ish.
this might be saving my projects, you drive a 350z and I've got a g35 so they should use the same nissan can id's, once I get my hands on a can sniffer I'd love to help contribute can message streams if it would help the decoding process, hopefully eventually we might be able to do it all.
@GarageTinkering that's awesome, I did some research on the canbus in our cars few years ago, but there seems to be a lot of progress made since I've last looked into it, I had people telling me it was a lost cause but now it seems doable, just bought me the shield so I'll be doing experiments once it comes in, I also found a monolithic github repo (iDoka/awesome-automotive-can-id) for reporting canbus IDs for as many manufacturers they can collect so ill also try to put my findings there
I highly dought that the rpm multiplicator is as a randomly value. Usualy are whole values. On CAN bus you can have multiple signals that can be similar with the rpm one, but with a slight offest. For example throttle pedal, throttle valve an RPM will fluctuate mostly in the same time.
You're probably right. Over the next few weeks I need to do a full deep dive into the data and try and figure out what everything is, so I suspect if it's wrong I'll find the proper one amongst all the numbers.
funny to see this; I had spent a month or so in 2024 to make a triple can shield for esp32 without using its builtin CAN controller, to connect to my Nissan Leaf (which has 3 CAN buses on the OBD2 port). Didn't get around to testing it in car, or writing code yet... so let's watch the whole thing :) @11:39 and that's exactly why I haven't tried it yet. Same fear.
Can you find the PID for "headlights on" and turn them on using the OBD port? There are companies like ultrabrightlightz that sell devices that plug into your OBD port and can flash your turn signal and headlights. I think they sell them to volunteer first responders that don't have access to emergency vehicles so they can get through traffic. Teslas also (at least used to) do this whole light show and play a song over the radio while they flashed their lights and opened the doors and what not. I'm sure they were using OBD commands. Vehicle speed and RPM is pretty neat but I was wondering how hard it'd be to do everything else. I think it'd be neat to show up to a car meet and hit a button on your phone and have your vehicle do something cool.
Yup. You can absolutely do this. Once I get around all the security concerns I'm going to design and integrate remote start and heat, as well as designing a plug and play voice control module and some other bits
@@GarageTinkering I sub'd. Looking forward to it. I didn't even think about remote start but that's a good use case. Might have to order the board next paycheck and start messing with it.
two thoughts: - speed is probably calculated by multiplying a frequency that is read off the axle by a supposed tire diameter. - that number at 42:15 is awfully close to Pi, and since your speedometer always reports a higher number, this pseudo-Pi is probably that
Man i would love to have a small display in my car showing my engine temp as it doesnt have a gauge for that *sigh*.. I would also love to have a sign tell me that it has started the dpf regeneration process. Maybe i need to look into this.. would be really awsome!
Great video. Can you send can bus messages to the car to change the default behavior of the car? For example, we want to turn on a certain light when the door is open. If the car sends a door opened message, we can catch that and then if we figure out how to turn on a certain light, we can turn on a light when the door is opened, right?
@@GarageTinkering I think it is very hard or impossible but i want to know is there a way to stop the default behaviour. For example car sends a message to the light for turning on and we want to stop this message.
@@volkanozdemir2847 I'm not sure that you could stop it, but, you could listen out for the command that the car is sending when the action happens, and then send an opposing one. Like, if a door opening sets a certain bit from 0 to 1 which turns that light on, you send a command to set it back to zero. Would all happen within a fraction of a second so you'd probably never see the light come on
We're doing the same thing at the same time and the algorithm has united us; quick question are you going to use OBD port, or splice straight into the Can wires?
In the old port you have one of the can networks of the e car. If you splice near the old port will be the same as plugin. For freeing the port there are passthrough obd plugs.
@@GarageTinkering be careful if a vehicle gets into an accident and it was deemed to be a communication failure potentially you could be criminally liable for the accident when otherwise your insurance could have paid out it’s happened before
I was intrigued by this video since I want to do some simple odb2 sniffing and I must say I was not disappointed, it took the me the complete video to realize it was an hour long video. Apart some small misinformations or misunderstanding about the hardware on your side, it was exactly what I was looking for. Thank you for the great content you provided.
"Like a little gemlin" made me laugh. Been there, done that 😁 All OEM speedometers are 'optimistic'. Apparently to avoid liability - "But my speedo said I was doing 30 officer!" Like the RPM, there's probably a 'magic' number (also used for various tyre/wheel sizes).
Speedometers are legally required to show within a certain band of the actual speed - with the actual speed being the lower limit. So if they aim to make it accurate there is no margin for errors, and simply overinflating your tires could make your car illegal.
I feel like some of that is built in at the CANBus level, as at around 30mph the OEM speedo and mine (which run off the same data) both report around 1mph over the GPS. Really though, speed of wheel cadence is a really outdated concept of measuring speed. I can see why things like GPS are becoming more the standard
rpm and any other data displayed on analog needles may not be the same as real engine rpm, etc. You should compare it to data received over obd (another obd scanner). Not that the difference will be that great, but worth to check anyway. (matter of adjusting the scaler value)
@@GarageTinkering I got this in a suggested video, as I was working on can sniffer, and injector. tried with arduino and can shield but could not get it to connect. CAN line swapping is what I will try to maybe get back on the track! thanks!
@@GarageTinkering Just be careful buying an odb-splitter as not all (Chinese) are fully wired and some "Advanced" readers will not work through a splitter
You should use a short rolling-average, releasing display at every Nth interval of the internal tick. You can even flip-flop between RPM and SPD. NOTE: Most vehicle dash representations for speed, are purposely indicating a faster speed than you are actually traveling. Your tires, at max inflation, should be the closest to actual speed, as that is the MAX diameter, resulting in the correct RPM, relative to the expected traveled distance. A lower inflated tire should show as you going even faster, when you are going even slower, as 1 RPM is truly less distance, from the smaller diameter tire. To get true speed, you would need the estimation of GPS, or an "adjusted wheel RPM value", which takes into account, the distance of the axle from the ground. (That determines the wheels true "surface circumference", for each associated RPM of the drive axle. A flat tire vs a full one vs an over-inflated one vs an incorrectly sized tire.) The reason a car is normally displaying a "faster speed" than you are actually going, is for safety and removed liability. They would rather let you THINK you are going faster than you are, as opposed to letting you THINK you are going slower, when you are actually "speeding", without realizing you are speeding. Also, Speed displays tend to "ramp-up" to display fast and "fall-off", with a bit of a delay. Again, it makes you look like you are traveling faster than you are, and steadies "foot-drift" and short decay-dips from making the gauge jump around. RPM's have a similar, two-way "softening" or decay or rolling-average, to limit sporadic displays. Sometimes it is a physical part of the "mechanical clusters", and sometimes it is a simple data-buffer, in "digital clusters". (OBD2 should always be showing RAW data, unedited, unbuffered, etc.) Now you need to display the rough "efficiency" value. Based off of Speed vs RPM, for simplicity. You can actually obtain the "duty cycle" and "pressures" of the injectors, to get a real decent "MPG rating", which would need some tweaking, as you won't know the true volume of fuel dumped at those duty cycles and pressures. It is not hard to estimate the values by basic consumption of fuel, compared to the "logged data". (Drive a highway length, with high RPMs, and again with lower RPMs, doing the same relative speeds. Then get another set of data at idle. Then another set at a steady 35-45mph. All the while, compare to your fuel-levels that your car reports. You will eventually have a duty-cycle that closely matches your fuel-level consumption, when you have the correct values.) Contrary to popular belief, it is NOT just low RPMs and driving slower that gives better MPGs. Most cars are "tuned" for specific speeds, to get the best MPG at those speeds. All that really matters is if you are "riding the gas", vs "back-drifting to a settled speed". (To back-drift, you first go past your desired speed and then ease-off the gas, slowing to your true desired speed. Also, instead of speeding up to a stop, you drift to a stop instead, way in advance. People like to drive all the way up to stopped traffic and break at the last few seconds, sitting idle longer and burning through break-pads and being forced to hard-accelerate back up to speed. Everyone is in a rush to stop!)
You're right. I emailed MrDIY and he said it was likely flipped as the sample code hadn't been updated with the newest (flipped) high and low values. He's updated the repo now so noone else should have that issue.
@ you replied before I finished the video 🙂 great car enthusiastic project, well done with the reverse engineering! As a foot note: the CAN ID might change by car brands, that’s why on a professional OBD tool a licence is needed for each car brand.
Researching it over the last couple of days I think it's because I'm getting the none-standard PIDs because I haven't sent a request to the CANBus. Hoping that sending a specific request for the PIDs will get me the standards ones. Going to try it after Xmas
@ wouldn’t recommend to do that. CAN bus is like a neural network in our bran, it transfer information between ECUs. CAN bus is event triggered as you mentioned, you are not using this feature, just listen in. If you drop a request too often to the bus then the bus capacity might be reached and you could face with issues on those ECUs on the car which don’t receive the data because the bus is overloaded. To stay on the safe side only listen in to a complete system (even cut the TX pin of transceiver in case of a SW bug :) ).
Yeah. The bandwidth is irrelevant really. You can broadcast EVERYTHING that the CANbus spits out in realtime, and any number of gauges can listen out for that data. Next video will be showing two at once
Thanks, and I appreciate the concern, but she's fine. It's just a combination of the position of the key light and the shadow making it look inflamed, even though it isn't. She's all good.
You would think so, and delving into it it looks like it should be using the generic PID values, but doesn't seem to be the case. I might need to dig into the can_common plugin and see how it's extracting IDs
Regarding your RPM, isn't it counting pulses and there's a difference between a 4 and 6 cilinder? BTW: there's an engine light and you need to refuel 🤣
Works great of you want to create a phone app to monitor oil pressure ect. I'm sure it's more complicated than this, but if you sniff it successfully as an event happens, you can record it and play it back. As an example, I can fully lock the differentials and transfer case on my jeep with one button. Normally, that's something only handled by the transfer case module(no user input).
@@TheAbevalleperhaps it's not for you then, and that's fine. Not everybody wants to make custom things for their car or piggy back off the inbuilt systems
@@GarageTinkering c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp: In constructor 'ESP32CAN::ESP32CAN(gpio_num_t, gpio_num_t, uint8_t)': c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp:46:5: error: 'bus_handle' was not declared in this scope 46 | bus_handle = nullptr; | ^~~~~~~~~~ c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp: In constructor 'ESP32CAN::ESP32CAN()': c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp:57:5: error: 'bus_handle' was not declared in this scope 57 | bus_handle = nullptr; | ^~~~~~~~~~ exit status 1 Compilation error: exit status 1
@@GarageTinkering c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp: In constructor 'ESP32CAN::ESP32CAN(gpio_num_t, gpio_num_t, uint8_t)': c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp:46:5: error: 'bus_handle' was not declared in this scope 46 | bus_handle = nullptr; | ^~~~~~~~~~ c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp: In constructor 'ESP32CAN::ESP32CAN()': c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp:57:5: error: 'bus_handle' was not declared in this scope 57 | bus_handle = nullptr; | ^~~~~~~~~~ exit status 1 Compilation error: exit status 1
I just brought it in via the text file from the serial logs. I did similar things to you, doing patterns etc and then trying to find them. This was 2020 and after seeing your video I’ll be using Ai and giving savvy can another go. I want to do more things like lock and unlock a van from the inside, basically replicating some of the buttons which are already found within the car so finding those command are fairly easy. But I’d like to decode more, perhaps horn and flashing lights etc to simulate an alarm going off if needed. Thanks for the video it’s sparked my curiosity again
find it a little odd that you are having to apply a conversion factor to the rpm - i would expect it to put out the exact value without conversion. I wonder if you are looking at some other rpm related data.
Someone else posed that question, and I took a cursory glance into the data to see if there was another candidate but I didn't see an obvious one. I'm going to make an extensive data capture and analysis tool over Xmas so perhaps having much more data will reveal something useful.
thats cool you an also get a cluster and if you play sim racing games send game signals convert them con canbus and have a actual cluster in your simrig if seen this done before for a bmw cluster i guess.. you know there are stand alone ecu's that will do tis stuff for you car and allow you to have these digital clusters and all the fail saves and stuff as seen in drifting a lot. not sure replacing a cluster and going wireless is a good idea but hey its a good project :) i personaly have played with drive by wire pedals what are basicly pod meters 2 way so its has redundancies build in. you can easly connect them to arduino :) for fun there not to expensive like a one from a scoda fabia or something for like 20/30 euro works fine :)
That is interesting. I have a custom display in my car and that gives me some ideas for DIY better. (Yes, I know it'll take a lot of time, be buggy and probably not even better than the one I have now like all projects :) I like to have some custom data like temperatures, my car only displays one data like temperature OR speed OR fuel level etc. But.. getting to code it myself gives me some new ideas that could be useful.
You know they sell HUDs for under $20. They come in 2 versions GPS and OBD2. I respect the work you fix there but accessories are widely available which you me indicates this is information the manufacturer shares. Did you think to ask for it? I know with ebike ESC stuff using some obscure one wire type communication all you had to do was shoot them an email and they provided a PDF...believe it or not. I'm stubborn too and I will at times continue doing something the hard way sometimes just for the experience of doing it too. Maybe we should ask chatGPT why we like to do things the hard way. Guilty as charged. lol I hate email but I think in this case one well placed email might have trumped all the ESP32 shenanigans. But where's the fun in that?
Off the shelf won't work. Won't fit the space I plan to put the screens. Won't give the customisation I want. Won't make good content. Plus the process is the thing that makes this interesting as opposed to necessarily just the final result.
Obd2 data is awfully slow compared to canbus, if he gets the code so far to use it with standalone canstream this would be awesome ! Free mini gauges for everyone
You could create a little web server on the esp32. You could then navigate to it using your phone to live view data instead of the laptop.
I am absolutely PAINED that I didn't think of that. Guess I'll be doing that next
@@GarageTinkering a tutorial perhaps please?
On it
ESP32 web pages and bluetooth are always something to remember. However, if problem is the range (especially with car plugs being often quite low and car metal shielding it), it won't give more distance. Cars are very difficult sometimes for radio link unless it antenna is near car windows (or external antenna on roof or whatever).
Or maybe just a lcd would be fine
As a hint from someone who had access to a full datasheet with every value and formula for a different brand, don't think in full bytes, some values like temperatures can be odd bits long and can start at odd bits. So as an made up example, engine coolant temp is pid 123, starting at bit 8 and is 12 bits long with a formula like value/10-20.0 so a value of 0 is -20°C, a value of 1100 is 90°C. Also there are already lots of efforts to decode popular vehicles, maybe you are lucky and most of the values you look for are already found and in those databases. Once decoded you can do a lot of fun stuff with can-bus data. way more than the manufacturer intended. I had full logs of days of driving on a modern car with different drivers and such. Several gigabytes ;) Happy Christmas
In my digging over the last few days I've found a few resources where people have been doing the 350z, and it's confirmed that I'm correct on the speed and rpm I found, and has highlighted a couple more that people have flagged, but most of it isn't there yet. No worries, just means I can be the one to suss it and create the resource
I'm curious if the RPM being off in the dashboard is a miscalibration in the dash display and not the bus reporting, it seems most people don't realize that indicators aren't calibrated, the only reason I know is I have a pursuit vehicle which has a factory calibrated speedometer and it's noted on the display.
@@Iamdebugthat does appear to be the case. Using my car scanner shows the CANBus reports the RPM about 20% lower than the gauge display. It should be a simple 3x multiplier to get the true value.
@@Iamdebug I can only tell from my limited experience with a sample size of 1: on my car it's off and delayed (my newest car is almost 27 years old). it's a rough indicator, but nowhere near exact. But I'm not doing racing where I need to shift at exact points, so I don't mind. I assume, most cars have some of damping to avoid being twitchy.
@@Iamdebug it is quite well known that speed on dash is reported 10% more than the real one measured with GPS, that has been true for a lot of modern German vehicles, probably a "safety hack", because setting tire sizes (when it is possible) or using factory recommended sizes (when you can't set it in OBD) still results in speed being off by +10%, and it is true in range of 0-150, not an equation, but straight up *1.1
temperature gauge is a lot of German vehicles starts to show 100% warm (~90C) already starting at 65-70C for some reason, not sure the logic behind that, but CAN values match up to 50ish C, but then it just speeds up and stays at 100% warm when actual temp is 70-95C
just thought about the speedometer, and that I haven't checked if the odometer is counting distance correctly and not adding 10% also, which would benefit people providing service for those vehicles 😁
Thanks for sharing the code!
@GarageTinkering Did you get stung on import duty? Im reluctant to buy Things of value internationally since Brexit.
I thought people were pretty much done with canbus youtube videos. I was looking the other day for something like this and realized I had watched all the good ones so thank you for this video. Very cool
Appreciated. I've only just started scratching the surface of what I plan to do. So much good stuff coming
Can you recommend some of the other good ones pls?
Looking forward to the next episode on here as well! You sir got a new sub
@nissanv6tt got any recommendations for other good canbus videos?
Man this is the exact video what I looking for last 4 years.. you are great
Damn, after me using numerous ODB2 readers and apps over the years, I didn't realise how fast the CANBus can send data. This is quite a revelation lol. I must admit, my coding experience is far south of what you're able to do here, and I'm in awe of this project.
Great stuff man, great stuff!!
Yeah. Lots of the data points come in at 25ms, and some of the less time sensitive are at 100ms, so it's all really responsive. Plus an ESP32 can extract everything and broadcast it all on ESPNow with basically zero packet loss. It's really impressive. I actually noticed that my gauge responded to speed changes faster than the OEM one in the centre console. Guess that's down to 20 years of technological advances.
@@GarageTinkering I'm wondering if the reason my ODB2 readers/apps are so slow is just down to being economical with the amount of data coming in. I'm curious to see what my old Accord Type R would output if the receiver was faster than the ebay readers lol
Excellent stuff man, this makes me rather excited to try something out next year.
I did clock your Honda comment btw, and laughed :P
@@StoobersI'm allowed to say that as I have a Civic lol
CANBUS can do 1Mbps and the newer CAN FD can do up to 8Mbps.
@@affieuk cool info, sadly my old car doesn't do CANBUS. Bugger :D
Greetings from Canada!
👆The guy that made it all possible, folks
This is so cool, keen to see more to come. For testing/debugging, it may be worth pre-recording a drive and serialising the data into a file that you can restream later on, save some petrol!
Someone else actually suggested that I make a web front end and it made me realise I can just dump all the data to a web endpoint and download at home. Extra advantage there that I can bundle the GPS data in with it which should make identifying things much easier if I can keep a log of what I do at which point of the drive.
@@GarageTinkering Did something very similar myself, but for simracing telemetry, would love to see how you get on with it!
Actually have a better idea. I'll just use a screen I have with an integrated microSD slot and create a simple data capture tool that self verifies and then stores all the data dump on a card. Simple.
I’ve made a gauge with micropython code utilising a pico, waveshare 1.29” GC9A01 touch display and MCP2515 CAN board.
It is programmed to read Haltech CAN bus using a neat CAN protocol file I made in TOML syntax.
It could do with loads of improvements but it works, I have a multifunction gauge with good refresh rate.
I should update my git repo and probably do a video on it.
@@HAZZA24937 sounds like a great project! Post here if you do the video
Great video, its like literally the exact type of video i have been looking for!
Well done, didn't realise the can bus data was slightly complex
It really isn't. It's just lots of data. Most of the time it's just 8 bytes on a certain id. But it comes in faster than you can read. Unless it's CAN FD. Then it's more bytes. Everyone on the bus can send, lower IDs get higher priority. Termination is a bit of a thing.
Great job mate. Looks like a fun project. That's a lot of progress in 3 day.
Wow, I need this kind of tutorial video for Off-Grid Solar-Inverter/Charger Canbus sniffing. That was awesome how you were able to find the solutions. Great video!
Now this has got me thinking about making a Heads Up display for my car, could be used to display a lot of useful information
love the project! the idea of own dials sounds super hard, but youre stepping closer to a really nice solution in every video.
this is literally the same project I've been working on lately. I have an esp32 with an external ADC for analog sensors, 2 can bus controllers for CAR ECU can bus and Transmission TCU can bus (8hp swap) and last a 433mhz receiver for aftermarket TPMS sensors since my can doesnt have it. This first ESP32 will send all the info I want to 2 other ESP32s with LCDs via ESPNOW
Sounds great. I think I'm going to incorporate a midpoint device at some point to take in all the sensors and the CAN before making it broadcast to the screens so the data only comes in from one serialised source.
This was so good! I had this planning for my Golf 1 with a new engine but had no idea how to make this work.. But this really helps! So thank you!
So glad you found it useful!
It’s killing me seeing it as “ODB” and people copying that in the comments 😂 it’s “OBD” - On-Board Diagnostics
Ha yeah. Apparently I've been chopping and changing between the two with reckless abandon.
@ easy mistake to make to be fair 😂. Brilliant video mate. Merry Christmas to you and yours!
hey! Dirty!
@@AFishyExperience ol' Dirty Bastard. Rip
@@vadimm6432 same thought i had haha
Very cool project! Definitely like seeing the CAN sniffing stuff.
This is wonderful! I'm starting the same project on my 2011 Subaru Forester XT. I have no knowledge and I found your explanation very educational. My idea is to use a larger, taller display, similar to 400x400px, to be able to display more information at the same time, such as oil temperature and oil pressure, which will come from external sensors. There's a guy who made a dash for an Infinity. You might want to take a look. If you want, I'll send you the channel.
Thanks for the explanation, and I'll get to work soon!
This looks a great channel,I will spend some time checking it out
This was so interesting to watch! Thanks for sharing. Can’t wait to try it one day
Dumping the raw data into excel with a few little formula's to do various data conversions is also great for a quick analysis!
Wow a great 1st look, at Can Bus.
Amazing video!! , i need that so much, I'm working on a DIY remote start for my Hyundai i40, implementing CANbus to detect lock, unlock, rpm, speed, gear position, break status and more .. so that will help me a lot , thanks man 🎉
Glad it helped. I'm about to launch in to try and finding all that myself and I'm kind of not looking forward to it LOL.
might have missed it in the video, but its also possible to use both cores of the ESP32, so you could have one dedicated to a webserver, and the other to CAN and the screen, or even have one core dedicated to the CAN if you think its sending data at a fast enough rate to require an entire core.
Nice! There's that CANBus project you commented about on that spoiler LED light video 8 months ago 😃 I haven't even tried doing this on my car yet. A lot of great tips here, so maybe I'll give it a try in 2025 😅 Happy new year BTW 🎉
Thank you for the great video! You've made more progress than I have and have really pointed me in the right direction. I plan to receive updates on things like whether the car is locked, if the lights are on, etc., sent to my phone via SMS. I often walk away from the car and wonder if I locked it.
Great idea. You could potentially add in writing messages to the CAN so it automatically puts up the windows and locks when you leave a certain proximity
@tonylamb3906 The problem is, CAN port always has power and you will drain car's battery if you don't disconnect the CAN reader interface. You have to add a high-side transistor to cut the power after car is off for let's say 5 minutes.
@aljaz55 the shield that I used in this video does exactly that and drops the power consumption to practically 0. There are tech specs on his linked website if you're interested
Very cool! I’m working on a very interesting, yet similar, situation I’m working through. I own a 2004 Gillig Phantom bus that I converted to a mobile communication, office and sleeping platform. It communicates using j1708 and j1939 CANbus. The problem is that there’s no fuel gauge. There’s a module behind the driver seat that is connected to the CANbus and the radio system previously used by the bus company. I suspect the telemetry is transported via radio to alert the depot regarding problems and, potentially, fuel level to address maintenance issues.
I picked up a package that allows me to talk to the CANbus properly, although I haven’t been able to locate the bodybuilder module to talk to the fuel tank sender.
Your video provided an alternative method to address the issue - grabbing the raw data across the CANbus, manipulating the sender and watching for something that could be the fuel tank. Since I’m just looking to build a monitoring gauge, this may be the easiest approach. Much easier than trying to drive down the road with a laptop full of changing data when all I want is a small part of what’s being sent.
Nicely done!
Sounds like a great project.
And yeah when I get to that bit I'm going to let it run mostly empty, grab a snapshot, fill it up, and see what changes. Should give me an shortlist at least to then see what slowly depletes over time.
This was an amazing video so thanks for sharing, 99% of what you did was beyond my understanding but I enjoyed watching and will now have a look at your older videos to try and learn a bit more coding. I made a video a month or two ago about using an ESP32 with Savvycan to read the CANBUS so please have a look at that. My setup was way more simple than yours but I also have a spare gauge that I was playing with in the office, being able to play back CAN dumps in your office makes life a little easier/warmer.
Wait until you see what I'm building for the next video lol
@@GarageTinkering Looking forward to it. Subbed. 🙂
Finally a good real world use-case for ESPNow! Great video to follow along, with all those trials and tribulations - thanks! 🙂
Ironically might swap it out to ESP Mesh. I'm about to compare them, but yeah it's generally a nice use case.
@@GarageTinkering Oh wow, thanks for mentioning ESP Mesh! I didn't know about that before, but i have a MASSIVE use-case for this in a project of mine ♥
That didn't exist back in the day, so i used regular infrastructure, but this will be a game changer 😁
@@jangrewe FOR REAL. I stumbled across it last week and haven't had a chance to play with it yet, but the fact you can just add new nodes to the network and not have to inform your current ones that it exists I think is really interesting. Just going to be a case of seeing how fast it is, and how good the message filtering and data types are
Well done indeed. I was investigating whether to log parameters from my Volvo and I found that there are multiple accelerator and other parameters, quite confusing. It would be interesting to compare, but I have too little time.
Super cool. Also beautiful z33!
There is a serial plotter in Arduino IDE, if you have data with labels, like you do, just open the serial grapher thing in arduino and it will plot it for you. Sometimes you have to tweak the format of your serail log
Nice one mate, new subscriber ✌🏻
With ESPNow, you could broadcast stuff to your home like your gas tank level or odometer value, which would make maintenance planning easier
You may have stumbled onto part of the reason I started this and where the series is going ;)
It is sad that I don't have a car anymore to experiment on, but what you want to do is write a packet filter that throws away everything you flagged as known! That way you can relatively quickly cleanup the CAN messages you do not need to work on!
Good shout
You can simply use map() to assign a value to a range!
I noticed a pattern on the RPM numbers, 2250, 3500 and I bet the 4700 is actually 4750. Essentially what you end up with is an extra 125 RPM for every 1000 RPM.
So spoiler alert for an upcoming video, but turns out the drivers gauge over reports compared to what the ECU is actually saying. I used a 3.4ish scaling ratio in the end, but it should have been 3.
Is it possible you are looking at the throttle position or MAF instead of RPM?
In the follow up video to this I dig in a lot more to ranged data and talk about this
@@GarageTinkering I'll check it out thanks! Great content, keep crushing it
Nice this has always been such a cool subject for me
Excellent video. Something Im getting into.
Suggestion for a video
RSPB have spring Garden bird watch coming up, What about a video on collecting the data images times ID of the birds etc and sending it to the RSPB systems?
Sounds neat but I do automotive tinkering I'm afraid.
@GarageTinkering and they are very good videos. Thanks
THIS IS THE ONE IVE BEEN WAITING FOR!!!
IT'S HERE!
Very cool!, subscribed
Great detailed video. Thanks for sharing this!
Fantastic video! At first this had me wondering if I could use this method to read out my fuel gauge. I have on 06 G35x, and the resistors on the cluster board that provide the proper voltage for my fuel gauge are likely the culprit behind my fuel gauge not reading properly, as I've verified that everything from the variable resistor inside the tank up to the back of my cluster is in working order... but the fact that the nav system is also unable to provide an MPG makes me think that those resistors are a component of preprocessing before providing the information under the designated canbus ID.
As far as I'm aware, that's something that should totally be doable without needing to attach any resistors or anything. It's something I'm going to be taking on in a couple of videos time so we'll have the answer soon enough.
@ Awesome. Look forward to it. The resistors are actually the components that cause the fuel gauge error… the solder on them cracks over time. I haven’t felt inclined to actually open my cluster up to verify it yet though.
Correction: By flipping GPIO4 and 5 you did not flip the CAN H and CAN L pins. Those are always the same as per the OBD2 standard. You flipped which pins are connected to the Receive and Transmit pins of the CAN transceiver. The transceiver takes CAN H and CAN L signals and level-shifts them into the data you see and/or turns your data into CAN signal to be sent.
Given that GPS speed measurement is pretty reliable, perhaps loop in a GPS to obtain the actual speed, then use that as an off-set to correct the OBD numbers... Could run that loop a few times a min to get a continuous correction factor.
Also, during your earlier test: I perhaps would have wired up that screen and placed it near the dashboard screen; filmed both then review at your leisure when reviewing the footage. Keeps plod happy too as you can focus entirely on driving rather than looking at screens...
I have a 2008 350Z and I recently got a BlueDriver Bluetooth Pro - which I don't really like, HOWEVER, one thing that device does give me that I haven't seen anywhere else, is it can tell me which tire pressure sensor has reported low air whereas on the dash, I just get one light without any indication of which tire is low. It would be nice if this project were able to report which tire pressure sensor has triggered. The single light on the dash is of course, useful, but not as useful as it could be.
Easy once you Isolate the individual signals. It's something we'll look at when we create the main drivers dash
Nice project.
From the developer's point of view I'd rather limit the screen FPS to keep it in one place, rather than limit the transmission rate of every other sensor that you will want to add.
Or during the handshake between screen and sensor, the screen can request specific data rate.
Valid thought. I'll look into doing it that way
I would like to know, key on engine off, if you wrote those packets back to the bus, would the car gauges move?
Good question. I don't know is the honest answer. I'm being suuuuper careful and doing prep before I write anything to the BUS. Don't want to brick the car
@@GarageTinkering The world of canbus is pretty extensive, on BMW's you can control AC, radio and other stuff, they don't run over the normal OBD2 canbus tho, the car as a couple of different BUS, K-CAN(Karosserie CAN) for interior lights, climate, steering wheel controls(you can even intercept the controls and do some cool stuff) as mentioned, and other stuff, and D-CAN(Diagnostics CAN), just like you are plugged in.
Not sure how it goes in the Nissan world but really wouldn't be surprised if they have something similar ish.
@@GarageTinkering I really don't think you would brick the car, the most you could do is trigger a CEL.
this might be saving my projects, you drive a 350z and I've got a g35 so they should use the same nissan can id's, once I get my hands on a can sniffer I'd love to help contribute can message streams if it would help the decoding process, hopefully eventually we might be able to do it all.
The mod of the 350z Reddit is just starting a wiki about the car. Could be a good place to contribute all the findings. Let me reach out to him
@GarageTinkering that's awesome, I did some research on the canbus in our cars few years ago, but there seems to be a lot of progress made since I've last looked into it, I had people telling me it was a lost cause but now it seems doable, just bought me the shield so I'll be doing experiments once it comes in, I also found a monolithic github repo (iDoka/awesome-automotive-can-id) for reporting canbus IDs for as many manufacturers they can collect so ill also try to put my findings there
dude ,is genuine.like it!
I highly dought that the rpm multiplicator is as a randomly value. Usualy are whole values. On CAN bus you can have multiple signals that can be similar with the rpm one, but with a slight offest. For example throttle pedal, throttle valve an RPM will fluctuate mostly in the same time.
You're probably right. Over the next few weeks I need to do a full deep dive into the data and try and figure out what everything is, so I suspect if it's wrong I'll find the proper one amongst all the numbers.
funny to see this; I had spent a month or so in 2024 to make a triple can shield for esp32 without using its builtin CAN controller, to connect to my Nissan Leaf (which has 3 CAN buses on the OBD2 port). Didn't get around to testing it in car, or writing code yet... so let's watch the whole thing :)
@11:39 and that's exactly why I haven't tried it yet. Same fear.
Can you find the PID for "headlights on" and turn them on using the OBD port? There are companies like ultrabrightlightz that sell devices that plug into your OBD port and can flash your turn signal and headlights. I think they sell them to volunteer first responders that don't have access to emergency vehicles so they can get through traffic. Teslas also (at least used to) do this whole light show and play a song over the radio while they flashed their lights and opened the doors and what not. I'm sure they were using OBD commands. Vehicle speed and RPM is pretty neat but I was wondering how hard it'd be to do everything else. I think it'd be neat to show up to a car meet and hit a button on your phone and have your vehicle do something cool.
Yup. You can absolutely do this. Once I get around all the security concerns I'm going to design and integrate remote start and heat, as well as designing a plug and play voice control module and some other bits
@@GarageTinkering I sub'd. Looking forward to it. I didn't even think about remote start but that's a good use case. Might have to order the board next paycheck and start messing with it.
two thoughts:
- speed is probably calculated by multiplying a frequency that is read off the axle by a supposed tire diameter.
- that number at 42:15 is awfully close to Pi, and since your speedometer always reports a higher number, this pseudo-Pi is probably that
That PID was just the wrong one. I found the right one and it's a simple calculation in line with all Nissans.
Man i would love to have a small display in my car showing my engine temp as it doesnt have a gauge for that *sigh*..
I would also love to have a sign tell me that it has started the dpf regeneration process.
Maybe i need to look into this.. would be really awsome!
Great video. Can you send can bus messages to the car to change the default behavior of the car? For example, we want to turn on a certain light when the door is open. If the car sends a door opened message, we can catch that and then if we figure out how to turn on a certain light, we can turn on a light when the door is opened, right?
Depends on the car, but for the most part yes. I'll be covering this in a video soon.
@@GarageTinkering I think it is very hard or impossible but i want to know is there a way to stop the default behaviour. For example car sends a message to the light for turning on and we want to stop this message.
@@volkanozdemir2847 I'm not sure that you could stop it, but, you could listen out for the command that the car is sending when the action happens, and then send an opposing one. Like, if a door opening sets a certain bit from 0 to 1 which turns that light on, you send a command to set it back to zero. Would all happen within a fraction of a second so you'd probably never see the light come on
@@GarageTinkering Yes you are right. Very clever. As soon as possible i want to try on my car. Thanks for your answers.
We're doing the same thing at the same time and the algorithm has united us; quick question are you going to use OBD port, or splice straight into the Can wires?
Probably splicing. Could do with retaining the ODB2 access for error codes etc (damn sports cats)
In the old port you have one of the can networks of the e car. If you splice near the old port will be the same as plugin. For freeing the port there are passthrough obd plugs.
@@GarageTinkering be careful if a vehicle gets into an accident and it was deemed to be a communication failure potentially you could be criminally liable for the accident when otherwise your insurance could have paid out it’s happened before
I was intrigued by this video since I want to do some simple odb2 sniffing and I must say I was not disappointed, it took the me the complete video to realize it was an hour long video. Apart some small misinformations or misunderstanding about the hardware on your side, it was exactly what I was looking for. Thank you for the great content you provided.
This is awesome!
"Like a little gemlin" made me laugh. Been there, done that 😁
All OEM speedometers are 'optimistic'. Apparently to avoid liability - "But my speedo said I was doing 30 officer!" Like the RPM, there's probably a 'magic' number (also used for various tyre/wheel sizes).
🙈
@@GarageTinkering Sorry, added a bit! I doubt you'll need to send the CAN data more than a couple of times a second.
Yeah. I've just got so used to driving a couple of mph over on the speedo as I know it runs faster than true. Just wanted to have them true again.
Speedometers are legally required to show within a certain band of the actual speed - with the actual speed being the lower limit. So if they aim to make it accurate there is no margin for errors, and simply overinflating your tires could make your car illegal.
I feel like some of that is built in at the CANBus level, as at around 30mph the OEM speedo and mine (which run off the same data) both report around 1mph over the GPS.
Really though, speed of wheel cadence is a really outdated concept of measuring speed. I can see why things like GPS are becoming more the standard
Great video. Thanks.
wow this is awesome!
I need to do this for my 240sx. Been looking for a way to do it.
rpm and any other data displayed on analog needles may not be the same as real engine rpm, etc. You should compare it to data received over obd (another obd scanner). Not that the difference will be that great, but worth to check anyway. (matter of adjusting the scaler value)
You're correct. I actually address this in a later video. RPM is out by about 20%
@@GarageTinkering I got this in a suggested video, as I was working on can sniffer, and injector. tried with arduino and can shield but could not get it to connect. CAN line swapping is what I will try to maybe get back on the track! thanks!
I'm doing this on my truck !!!!! I have lots of esp32 but never did obd2 I only want milage recording lol :)
Use the find command and look for 0x0c and 0x0d?
They're not there
will a obd scan tool still work if you tap directly into the signal wires? Like behind the connector. Amazing work for 3 day!
Apparently so. Or you can use an OBD splitter so you can have this one plugged in and still be able to put another one in if you need.
@GarageTinkering oh I see. Thank you for the quick response.
@@GarageTinkering Just be careful buying an odb-splitter as not all (Chinese) are fully wired and some "Advanced" readers will not work through a splitter
@@garymetheringham4990 Noted, thanks
You should use a short rolling-average, releasing display at every Nth interval of the internal tick. You can even flip-flop between RPM and SPD.
NOTE: Most vehicle dash representations for speed, are purposely indicating a faster speed than you are actually traveling. Your tires, at max inflation, should be the closest to actual speed, as that is the MAX diameter, resulting in the correct RPM, relative to the expected traveled distance. A lower inflated tire should show as you going even faster, when you are going even slower, as 1 RPM is truly less distance, from the smaller diameter tire.
To get true speed, you would need the estimation of GPS, or an "adjusted wheel RPM value", which takes into account, the distance of the axle from the ground. (That determines the wheels true "surface circumference", for each associated RPM of the drive axle. A flat tire vs a full one vs an over-inflated one vs an incorrectly sized tire.)
The reason a car is normally displaying a "faster speed" than you are actually going, is for safety and removed liability. They would rather let you THINK you are going faster than you are, as opposed to letting you THINK you are going slower, when you are actually "speeding", without realizing you are speeding.
Also, Speed displays tend to "ramp-up" to display fast and "fall-off", with a bit of a delay. Again, it makes you look like you are traveling faster than you are, and steadies "foot-drift" and short decay-dips from making the gauge jump around. RPM's have a similar, two-way "softening" or decay or rolling-average, to limit sporadic displays. Sometimes it is a physical part of the "mechanical clusters", and sometimes it is a simple data-buffer, in "digital clusters". (OBD2 should always be showing RAW data, unedited, unbuffered, etc.)
Now you need to display the rough "efficiency" value. Based off of Speed vs RPM, for simplicity. You can actually obtain the "duty cycle" and "pressures" of the injectors, to get a real decent "MPG rating", which would need some tweaking, as you won't know the true volume of fuel dumped at those duty cycles and pressures. It is not hard to estimate the values by basic consumption of fuel, compared to the "logged data". (Drive a highway length, with high RPMs, and again with lower RPMs, doing the same relative speeds. Then get another set of data at idle. Then another set at a steady 35-45mph. All the while, compare to your fuel-levels that your car reports. You will eventually have a duty-cycle that closely matches your fuel-level consumption, when you have the correct values.)
Contrary to popular belief, it is NOT just low RPMs and driving slower that gives better MPGs. Most cars are "tuned" for specific speeds, to get the best MPG at those speeds. All that really matters is if you are "riding the gas", vs "back-drifting to a settled speed". (To back-drift, you first go past your desired speed and then ease-off the gas, slowing to your true desired speed. Also, instead of speeding up to a stop, you drift to a stop instead, way in advance. People like to drive all the way up to stopped traffic and break at the last few seconds, sitting idle longer and burning through break-pads and being forced to hard-accelerate back up to speed. Everyone is in a rush to stop!)
CAN high and low can’t change between cars, standardised for OBD interface
You're right. I emailed MrDIY and he said it was likely flipped as the sample code hadn't been updated with the newest (flipped) high and low values. He's updated the repo now so noone else should have that issue.
@ you replied before I finished the video 🙂 great car enthusiastic project, well done with the reverse engineering!
As a foot note: the CAN ID might change by car brands, that’s why on a professional OBD tool a licence is needed for each car brand.
Researching it over the last couple of days I think it's because I'm getting the none-standard PIDs because I haven't sent a request to the CANBus. Hoping that sending a specific request for the PIDs will get me the standards ones. Going to try it after Xmas
@ wouldn’t recommend to do that. CAN bus is like a neural network in our bran, it transfer information between ECUs. CAN bus is event triggered as you mentioned, you are not using this feature, just listen in. If you drop a request too often to the bus then the bus capacity might be reached and you could face with issues on those ECUs on the car which don’t receive the data because the bus is overloaded. To stay on the safe side only listen in to a complete system (even cut the TX pin of transceiver in case of a SW bug :) ).
hi please use an esphome setup..
Interesting, would you be able to set Temp, Fan speed and all this things as well?
Or only reading and displaying?
Yeah, you can send those same messages you receive back in order to change things. Technically you can control everything that is managed by the ECU.
It's better to solder all pads on odb plug to decrease mechanical loads and chances to bracket the soldering joint
OBD?
ODB is the new chinese type lol
can i use 2, 3, or four different gauges? is the bandwidth enough?
Yeah. The bandwidth is irrelevant really. You can broadcast EVERYTHING that the CANbus spits out in realtime, and any number of gauges can listen out for that data. Next video will be showing two at once
Seems like you’re kinda reinventing the wheel. There exist wireless Bluetooth ELM327 modules is there a reason you didn’t want to use one of them?
Insufficient speed, wrong format and none-customisable to name just three.
SUPER COOL!
Hey,
Thank you for your video!
Urgently!
Please, ask your partner/ assistant to do health check with an endocrinologist for her thyroid
Thanks, and I appreciate the concern, but she's fine. It's just a combination of the position of the key light and the shadow making it look inflamed, even though it isn't. She's all good.
I love it
Cool to figure it out, but can't you get your hands on something that shows the values on the CANbus for your specific car?
You would think so, and delving into it it looks like it should be using the generic PID values, but doesn't seem to be the case. I might need to dig into the can_common plugin and see how it's extracting IDs
Regarding your RPM, isn't it counting pulses and there's a difference between a 4 and 6 cilinder? BTW: there's an engine light and you need to refuel 🤣
Engine light is due to the sports cats, and I haven't had it tuned out yet. It's coming :D
why would someone want to sniff the canbus on a car? What can i do with it?
Watch the video.
Also. Everything. You can do everything.
Works great of you want to create a phone app to monitor oil pressure ect.
I'm sure it's more complicated than this, but if you sniff it successfully as an event happens, you can record it and play it back. As an example, I can fully lock the differentials and transfer case on my jeep with one button. Normally, that's something only handled by the transfer case module(no user input).
@@GarageTinkering watching the video does nothing for me to explain what a can bus is or why I would want to do anything with it.
@@rjlkc4668 Thank you for the helpful explanation. that's really cool! Sounds like some cool automations or scripts can be made with this.
@@TheAbevalleperhaps it's not for you then, and that's fine. Not everybody wants to make custom things for their car or piggy back off the inbuilt systems
Sweet!
Your soldering iron tip is not fastened well
I ordered the MrDiyca can shield, installed the proper libraries and for the life of me cannot get your code to compile.
What error are you getting?
@@GarageTinkering c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp: In constructor 'ESP32CAN::ESP32CAN(gpio_num_t, gpio_num_t, uint8_t)':
c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp:46:5: error: 'bus_handle' was not declared in this scope
46 | bus_handle = nullptr;
| ^~~~~~~~~~
c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp: In constructor 'ESP32CAN::ESP32CAN()':
c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp:57:5: error: 'bus_handle' was not declared in this scope
57 | bus_handle = nullptr;
| ^~~~~~~~~~
exit status 1
Compilation error: exit status 1
@@GarageTinkering c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp: In constructor 'ESP32CAN::ESP32CAN(gpio_num_t, gpio_num_t, uint8_t)':
c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp:46:5: error: 'bus_handle' was not declared in this scope
46 | bus_handle = nullptr;
| ^~~~~~~~~~
c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp: In constructor 'ESP32CAN::ESP32CAN()':
c:\Users\bagge\OneDrive\Documents\Arduino\libraries\esp32_can-master\src\esp32_can_builtin.cpp:57:5: error: 'bus_handle' was not declared in this scope
57 | bus_handle = nullptr;
| ^~~~~~~~~~
exit status 1
Compilation error: exit status 1
@@GarageTinkering YT won't let me paste it here I'll put it in your codes Github.
I start the day shortly so will take a look
A better way is to use a dealer tool for Toyota, have a splitter attached, send commands to the vehicle and record the results.
I used excel to sort out the data, and you can use it to filter each hex
Ant example of the format? I don't really use it
I just brought it in via the text file from the serial logs. I did similar things to you, doing patterns etc and then trying to find them. This was 2020 and after seeing your video I’ll be using Ai and giving savvy can another go. I want to do more things like lock and unlock a van from the inside, basically replicating some of the buttons which are already found within the car so finding those command are fairly easy. But I’d like to decode more, perhaps horn and flashing lights etc to simulate an alarm going off if needed. Thanks for the video it’s sparked my curiosity again
find it a little odd that you are having to apply a conversion factor to the rpm - i would expect it to put out the exact value without conversion. I wonder if you are looking at some other rpm related data.
Someone else posed that question, and I took a cursory glance into the data to see if there was another candidate but I didn't see an obvious one.
I'm going to make an extensive data capture and analysis tool over Xmas so perhaps having much more data will reveal something useful.
thats cool you an also get a cluster and if you play sim racing games send game signals convert them con canbus and have a actual cluster in your simrig if seen this done before for a bmw cluster i guess.. you know there are stand alone ecu's that will do tis stuff for you car and allow you to have these digital clusters and all the fail saves and stuff as seen in drifting a lot.
not sure replacing a cluster and going wireless is a good idea but hey its a good project :)
i personaly have played with drive by wire pedals what are basicly pod meters 2 way so its has redundancies build in. you can easly connect them to arduino :) for fun there not to expensive like a one from a scoda fabia or something for like 20/30 euro works fine :)
What you made is AWESOME!!!! but.... I was expecting oil and water temp and oil pressure. All more important than weather....
They're still to come on the third gauge
*"ODB2"???* Huh? 😲 1:19
What is that stands for?
_"On Diagnostics Board"?_
Typos happen.
@@GarageTinkeringpedants gonna pedant.
Engine light ✅
Low fuel light ✅
Lol yeah. Sports Cats but haven't tuned it yet
Throttle House, Middle Lane, Car Throttle, Salvage Nation, Shiny Nine, Redracing, Popcornbus
Its OBD.. O B D.. On Board Diagnostics Generation2! What the heck is this odb stuff?
That is interesting. I have a custom display in my car and that gives me some ideas for DIY better. (Yes, I know it'll take a lot of time, be buggy and probably not even better than the one I have now like all projects :) I like to have some custom data like temperatures, my car only displays one data like temperature OR speed OR fuel level etc.
But.. getting to code it myself gives me some new ideas that could be useful.
Creative WHAT stuff?
Gauge
You know they sell HUDs for under $20. They come in 2 versions GPS and OBD2. I respect the work you fix there but accessories are widely available which you me indicates this is information the manufacturer shares. Did you think to ask for it? I know with ebike ESC stuff using some obscure one wire type communication all you had to do was shoot them an email and they provided a PDF...believe it or not.
I'm stubborn too and I will at times continue doing something the hard way sometimes just for the experience of doing it too. Maybe we should ask chatGPT why we like to do things the hard way. Guilty as charged. lol
I hate email but I think in this case one well placed email might have trumped all the ESP32 shenanigans.
But where's the fun in that?
Off the shelf won't work. Won't fit the space I plan to put the screens. Won't give the customisation I want. Won't make good content.
Plus the process is the thing that makes this interesting as opposed to necessarily just the final result.
Obd2 data is awfully slow compared to canbus, if he gets the code so far to use it with standalone canstream this would be awesome ! Free mini gauges for everyone
M32 ftw :D
How the hell did you recognise that?
@@GarageTinkering Fishponds on the sign as you floored it out of the 40 ;) I used to live nearby lol.
@@GarageTinkering Did youtube remove my comment about me knowing the road or is it just not showing me my comment lol
I don't see it, other than the initial spotting
@@ValentineAutos Oddness, but that's interwebs for you lol. I used to live nearby, so yeah, spotted that :)
Thank bro