Page 1 of 40 123456789101126 ... LastLast
Results 1 to 25 of 986

Thread: E46 Can bus project.

  1. #1
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6

    E46 Can bus project.

    Hello. There has been much discussion about the Can Bus as it relates to engine swaps. I have stated this thread to discuss or share my findings and progress on creating a Can Bus solution.

    Edit: Everyone would like the answers first right?

    Here is a link to the Analog to Can solution
    http://forums.bimmerforums.com/forum...4#post26219044

    Here's a link to the OBDII to Can solution
    http://forums.bimmerforums.com/forum...4#post26219044
    Summary of ID's and data for E46 [edit added this section to keep things together]

    The can bus is 500kb/s
    In the data for each ID there are 8 bytes. Labeled Byte 0,1,2,3,4,5,6,7

    ARBID: 0x153 (ASC1)
    -B0
    -B1 Speed LSB
    -B2 Speed MSB [Signal startbit: 12, Bit length: 12, 0x0008 = 1 km/hr]
    -B3
    -B4
    -B5
    -B6
    -B7

    ARBID: 0x316 (DME1)
    -B0
    -B1
    -B2 RPM LSB
    -B3 RPM MSB [RPM=(hex2dec("byte3"&"byte2"))/6.4]
    -B4
    -B5
    -B6
    -B7

    ARBID: 0x329 (DME2)
    -B0
    -B1 is Temp [Temp in C = .75 * hex2dec(byte01) - 48.373]
    -B2
    -B3
    (bit0 == LSb)
    bit 7 Cruise 1/0
    bit 6 Cruise -
    bit 5 Cruise +
    bit 6&5 Cruise Resume

    -B4
    -B5 Throttle position (00-FE).
    -B6 kickdown switch depressed is value (4) Brake pedal depressed is value (1).
    -B7

    ARBID: 0x338 (DME3?), Only MS45 (and presumably MSV80)

    -B0
    -B1
    -B2
    0 = Sport on (request by SMG transmission)
    1 = Sport off
    2 = Sport on
    3 = Sport error


    ARBID: 0x545 (DME4),
    combinations work to get multiple lights
    -B0 Check engine light (binary 10), Cruise light (binary 1000), EML (binary 10000), Check gas cap 2002+ cars (hex 40).
    -B1 Fuel consumption LSB
    -B2 Fuel consumption MSB. Values just cycle from 0 to FFFF then start over at zero. Fuel consumiption is the rate of change.
    -B3 Overheat light (binary 1000, Hex 08), oil level 2002+ cars, (binary 0010, hex 02), On M3's 0x10 7K and Up RPM lights, 0x20 6.5K and up RPM lights, 0x40 5.5K and up RPM lights.
    -B4 Oil Temp [Temp in C = hex2dec(byte04) - 48.373]
    -B5 Charge light, 2002+ cars (Binary 0001)
    -B6
    -B7

    ARBID: 0x610 also sent from the instrument cluster if a 0x610 "remote frame" is recieved. Appears the remote frame is sent by the ABS
    This data contains the last 7 digits of the vin number in the ECU.
    -B0 as is but drop the last zero and it is the last number in the vin
    -B1 as is (in hex) the 3rd and 2nd number from the end in the vin
    -B2 as is (in hex) the 5th and 4th number from the end in the vin
    -B3 in ASCII the 6th from the end in the vin
    -B4 in ASCII the 7th from the end in the vin
    -B5 0
    -B6 0
    -B7 0
    Example B4 = 4B (or K in ASCII) B3 = 43 (or C in ASCII) B2 = 71, B1 = 80, B0 = 90. Vin = KC17809

    ARBID: 0x613 also sent from the instrument cluster if 0x615 is acknowleged.
    -B0 Odometer LSB
    -B1 Odometer MSB [Convert from Hex to Decimal. Multiply by 10 and that is Odometer in Km]
    -B2 is fuel level. Full being hex 39 Fuel light comes on at hex 8. Then values jump to hex 87 (or so) and then go down to hex 80 being empty.
    -B3 Running Clock LSB
    -B4 Running Clock MSB minutes since last time battery power was lost.
    -B5
    -B6
    -B7


    ARBID: 0x615 sent from the instrument cluster.
    -B0 AC signal. Hex 80 when on (10000000) Other bits say something else (Load, Aux fan speed request? system pressure?)
    -B1
    -B2
    -B3 Outside Air Temperature: x being temperature in Deg C, (x>=0 deg C,DEC2HEX(x),DEC2HEX(-x)+128) x range min -40 C max 50 C

    ARBID: 0x1F0 (ABS)
    Individual wheel speeds:
    Signal wheel 1: startbit 0, bit length 12, Intel LSB, unsigned, gain 1/16 (0.0625) (byte0 + next 4 bits of Byte1)
    Signal wheel 2: startbit 16, bit length 12, Intel LSB, unsigned, gain 1/16 (0.0625) (byte2 + next 4 bits of byte3)
    Signal wheel 3: startbit 32, bit length 12, Intel LSB, unsigned, gain 1/16 (0.0625)
    Signal wheel 4: startbit 48, bit length 12, Intel LSB, unsigned, gain 1/16 (0.0625)

    The above translated to .xls syntax. (corrected)
    Wheel speed 1: (HEX2DEC(B0)+HEX2DEC(RIGHT(B1;1))*256)/16 = Kph
    Wheel speed 2: (HEX2DEC(B2)+HEX2DEC(RIGHT(B3;1))*256)/16 = Kph
    Wheel speed 3: (HEX2DEC(B4)+HEX2DEC(RIGHT(B5;1))*256)/16 = Kph
    Wheel speed 4: (HEX2DEC(B6)+HEX2DEC(RIGHT(B7;1))*256)/16 = Kph
    (multiply by .621 to get MPH)


    ARBID: 0x1F5 (steering Angle Sensor)
    Angle:
    angle startbit: 0, length: 15 bit order and type: Intel LSB, unsigned, gain: 0.045
    angle sign bit: bit 15

    Velocity:
    velocity startbit: 16, length: 15 bit order and type: Intel LSB, unsigned, gain?: 0.045
    velocity sign bit: bit 31


    ARBID: 0x1F8
    -B2, Brake Pressure.


    Equipment I'm using
    Now using Ardunio Mega's and my custom made shields

    But also use:
    -Arduino Uno http://arduino.cc/en/Main/ArduinoBoardUno (other Arduinos should work. The Leonardo is terrible though)
    -Spark fun "can bus shield" https://www.sparkfun.com/products/10039
    Requires:
    Header pins PRT-10007 - Arduino Stack-able Header Kit
    Chord CAB-10087 - OBD-II to DB9 Cable. For E46 OBDII will have to have Can pins added to the OBDII socket.

    Have also used instead of the spark fun sheild: http://www.seeedstudio.com/depot/can...ld-p-1240.html which works too.
    This shield http://fazjaxton.net/products/fazcan/main.html should work instead of the spark fun for sending to the instrument cluster. But I have not tested.

    One could also be built from bare chips. For can sniffing I'd recommend something similar that can dump data to an SD card (USB connection is too slow).

    Also used during the project:
    -ELM327 clone
    -PA soft style Coding tool and software.

    Project detail:


    What we really need to do is "reverse engineer" the can bus messages on the E46. Many people seem to call this hacking. Reverse engineering can bus messages has been done on several cars and there is software and hardware available to make the process easier.

    First step of any project. Research. Here are some links to some of the information I found the most useful.

    Basic where to start in Can Bus reverse engineering
    http://www.canbushack.com/blog/index.php
    From the above website don't miss this presentation:
    http://www.canbushack.com/defcon19/workshop.pptx

    After capturing a data stream with a method described in the above the data needs to be decoded. The presentation below describes how this can be done:
    http://bobodyne.com/web-docs/robots/...ion/index.html [edit: RPM and temperature data seem to be the same as E46. Many others may match as well]

    Reverse engineering by DIYers has been done on various cars. [edit: here is a link to my latest can bus video][ame]http://www.youtube.com/watch?v=UqB4xqDC14c[/ame]

    Here is some BMW specific information on the can bus for several models.
    http://share.qclt.com/bmw%E8%B5%84%E6%96%99/Bus%20&%20Power/BUS%20_en.pdf
    Page 3 what cars have what bus, Page 6 bus speeds.

    I attempted to communicate with my E46 a few weeks ago. Looks like the can bus speed is 100 KB/s when I was trying 500KB/s So that explains that. Wish I had the car handy to try again. [edit: after testing it appears it is really 500 kb/s]

    This link is information on what signals arrive at the instrument cluster. Not specifically needed for can bus hacking but is interesting on the engine swap side of things.
    http://www.bmwtech.ru/pdf/e46/ST034/2%20Driver%20Information%20Internet-1.pdf

    Page 4 and 5 of this link show how to identify the can bus wires in E46.
    http://www.e-ope.ee/_download/euni_r...TION_GUIDE.pdf


    If you like reading here are some other links I found useful

    Mix of can bus and other bus info
    http://marco.guardigli.it/2010/10/hacking-your-car.html

    Arduino and can bus:
    http://modelrail.otenko.com/arduino/...ea-network-can

    Other Can bus projects:
    Nissan Leaf:
    http://blog.lincomatic.com/?p=423

    Mazda 6:
    http://www.madox.net/blog/projects/mazda-can-bus/
    Last edited by Thaniel; 07-18-2017 at 04:55 PM. Reason: updating with discovered informationB

  2. #2
    Join Date
    Nov 2004
    Location
    The Black Hills (Souf Dak
    Posts
    9,349
    My Cars
    Diesels and a 04 M3
    subscribed
    I'm a ROLEX wear'N
    Diamond ring wear'N
    KISS steal'n
    WHEELIN DEAL'N
    Limousine RIDE'N
    JET PLANE FLY'N , SON OF A GUN!
    And I'm havin a hard time holdin these alligators down!!!!!!
    WHOOOOOO!!!!!!

  3. #3
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6

    Just the detail of getting started.

    Ok so first step is research. Me being me I skipped step one for the most part and started with buying hardware and trying things. I bought a "can bus shield" from spark fun. Why this hardware? A guy that knows more than me recommended it. I was busy and wanted to skip some of the research part. For me skipping the research never goes well. Here's a bit of what happened. You can skip to ***** if you just are looking for technical data. Life is a journey so I'll share some more story.

    Right now I'm temporarily living in Sweden. This summer I went back to the states for 5 weeks. When at home I ordered the can bus shield and chord to hook it to the OBDII port. It arrives and I try to figure out how to work it. (skipped the research so no clue) Turns out the card (Sheild) comes with no "header pins" and I had failed to notice. I start doing some "Research" on how to work it. Better late than never. Turns out it needs a micro controller. So I order header pins and the Arduino Leonardo micro controller. All set now.

    After the new supplies arrive I solder the header pins in and proceed to try and install the software and get the thing to work. After a number of frustrating evenings I find out that the Leonardo board has some pin routings different than what the can bus shield is designed for (know issue could have found with some research). So Take a quick trip to radio shack (of all places) and pick up a Arduino uno. The Arduno uno uses the large USB chord like for a printer. No problem I have one at home. When I get home I discover that the chord I thought of was taken with us to Sweden. Ugh. One more trip to the store.

    Ok now I have my PC talking to the Can bus shield properly. At this point I'm still struggling with the software and only have one more day before leaving to return to Sweden. I try to interface with the E46 can bus only to learn that the OBDII port does not have can bus wires there. So I tap them at the ECU but no luck. I give up for the moment and throw it all in the suitcase and bring it with me to experiment with.

    End of Story telling. On to information.
    ************************************************** ****************************************
    This is the equiptment I'm using
    -Spark fun "can bus sheild" https://www.sparkfun.com/products/10039
    Requires Header pins (PRT-10007 - Arduino Stackable Header Kit) I'm also using this chord to interface with my rental car CAB-10087 - OBD-II to DB9 Cable. For E46 OBDII will have to have Can pins added to work.
    -Arduno Uno http://arduino.cc/en/Main/ArduinoBoardUno


    So far this hardware seems like it will work great for the Can bus solution. The controller is programmed in C programming language (I've programmed in C before and its a nice language in my opinion). Writing our own code will give us great flexibilty on what can be done post engine swap. It will take a little more work, perhaps, to get the data out than with the GUI programmed fancy sniffers, but not much. But for implementing the solution I think it will work great.

    After a lot of reading and some playing with the Ardunio's programming I've gotten a pretty good handle on the software and how the can bus codes work. Since my E46 is on the other side of the Atlantic I hooked the thing up to my rental car. (The car is a Renault Laguna.) Good news is I have been able to comunicate with the car over the can bus. So the hardware and software is all working. Bad news is it's not an E46 and more bad news is it appears to have a gateway between the OBDII connector and the ECU. The gateway is blocking the data stream between the ECU and the other modules. But the ECU does respond to inquires sent to it.

    If you've read all the documents in the first post you've read that there are two ways to read the RPM over the can bus. The first way is to just listen to the bus and watch when the ECU tells the instrument cluster the RPM. This is what we need to get and decode to make the tach move. The 2nd way is to send a "PID" (more or less a query) to the ECU telling it what we want to know and it'll tell us the parameter. If I understand right that is what the Can Bus OBDII scanners do. This works perfect on the rental car. I can query all I want and it responds.

    Next steps:
    1. See if I can easily tap the Can Bus lines near the ECU on my rental car. I could get some practice decoding the data.
    2. Try and talk someone into letting me borrow their E46 to do sampling on. This could be difficult. But perhaps I could take one for a test drive

    I've also considered buying an E46 inst cluster. I'd be good to test if the codes found are correct. But I need a functioning Car to get a good data stream to decode.

    Anyone want hook up a system to their car and send me data?
    Last edited by Thaniel; 09-10-2012 at 06:32 AM. Reason: Automerged Doublepost

  4. #4
    Join Date
    Mar 2004
    Location
    USA
    Posts
    3,241
    My Cars
    96 328is 6.0L
    Thaniel, I can't thank you enough for starting on this project and as always, sharing so much of super valuable information!

    Time for lots and lots of reading... Can't wait to see your findings and tests!
    - 96 328is 6.0L. (LS1 to LS2 build thread: http://forums.bimmerforums.com/forum...ad.php?2098938)
    - 96 328is 5.7L. (LS1 build thread: http://forums.bimmerforums.com/forum....php?t=1289987)
    - 95 ///M3 6.0L. (LS2 build thread: http://forums.bimmerforums.com/forum....php?t=1619249)

    - 97 ///M3. (e46 Fender Flares/track car build thread: http://forums.bimmerforums.com/forum....php?t=1727098)
    - 96 328is (Dual Fuel Pump to Surge Tank thread: http://www.bimmerforums.com/forum/sh...ad.php?1964025)

  5. #5
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6
    Quote Originally Posted by bimerok View Post
    Time for lots and lots of reading...
    Yes lots of reading in this project. And it seems there is always another layer of deeper information each time I turn around.

    Update for today. Since it was saturday I took some time to try things out on my rental car again. Much to my surprise this time we actually managed to get data from the Laguna. Problem last time was I didn't have my helper with me (My son now 12 years old). Must have been the difference. Actually I think it was the can bus sheild can filter some signals. I hadn't set any filters and assumed that would mean all the messages would come through. But I tried some different program which happened to configure the filters to wide open on the sheild prior to listening and it worked. And so I tried the program that I tried last week (that didn't configure filters) and it now reported a changing data stream too where previously only reported one ARBID. (The filter settings stay stored in the shields memory)

    So I have a data stream to look at. But from the bit I've seen I don't think the Laguna is a good cadidate for decoding. First it has a 32 bit ARBID instead of 12 bit like the E46. And it being a newer car MANY more devices are on the Can Bus instead of seperate bus. To give you an idea of how bad it is. In the example above where the guy decodes the Canbus of the mini he gets 13 different message ID's on a short drive. On my short drive with the Laguna I got 884 different ARBID's. Still not impossible but the Laguna looks like it'll be much more difficult to decode than a much older car like the E46. [EDIT: turns out the program being used was garbling the ARBID's and so many more were being reported. Put together another program to read the data and there are fewer ARBID's and most if not all were standard format]

    It for today.
    Last edited by Thaniel; 09-14-2012 at 12:59 PM.

  6. #6
    Join Date
    Nov 2008
    Location
    White Plains, NY
    Posts
    193
    My Cars
    1992 535iA (Winter DD)
    And what does this do?
    Current:
    1992 535iA
    2000 540i/6 sport

    Past:
    1990 535iA (R.I.P.)
    1994 325i/5 (Sold)






  7. #7
    Join Date
    Dec 2006
    Location
    Los Angeles, CA
    Posts
    4,146
    My Cars
    #Project333Ti & Z3 Coupe
    Quote Originally Posted by stacks View Post
    And what does this do?
    Based on the research and findings with the tachometer, my guess would be to get the e46 /e46 m3 instrument cluster to work in the e36 chassis.

    Thanks for all your hard work! I'm eagerly waiting these results as we have 2 s54 e36s we built that would love to run an e46 m3 instrument cluster!

    Also, if you figure out how to work it in the e36, how hard would it be to do the same for my E30 M3?

  8. #8
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6
    Quote Originally Posted by stacks View Post
    And what does this do?
    Ah yes. If jumping in the middle I could see how you would wonder. The problem is if a person were to remove the original BMW DME Or ECU the Tach and temperature guages can only be activated by Can bus. Things like traction control and DSC etc do not recieve responses from the DME and some throw codes. Why would anyone remove the ECU? That's a whole different topic Most common would be engine swaps or running a stand alone computer.

    Quote Originally Posted by e30polak View Post
    Based on the research and findings with the tachometer, my guess would be to get the e46 /e46 m3 instrument cluster to work in the e36 chassis.
    I hadn't really thought of removing the cluster from the car and putting it in another car. Suppose the work here would apply. At least some of it would. Not sure how the I/K bus would go but the Can bus part could be made to work.


    I had thought about giving an overview on the project goals and direction. Here is a good a place as any.

    Part I (complete)
    ** Gather can bus data from E46. [edit: have Data]
    ** Decode the data. Get the Arbid's and values necessary to actuate the Temp and RPM guages. Identify other interesting data. MIL light etc. [Edit: complete]
    ** Prove that the data is correct by bench testing a Instrument cluster like in the linked video. [edit: complete]
    ** Write a some code to take an analog temperature input and outside tach signal and output values on the can bus to make tach and temp read. [edit: complete]

    Depending on how long that takes and how interesting it is, could move to more complicated parts.

    Part II
    ** Gather bus data from LS1 car then read LS1 can bus, translate values and put on BMW can bus. [edit: Think I have the method. Now need to take the samples]
    ** Gather data from BMW traction control computer and DSC etc that would go to ECU. Formulate proper response from Can controller to keep the devices from throwing a code.
    ** Gather data From BMW for response during wheel spin or slide.
    ** Gather data from LS1 car for same. Write code to make appropriate responses for the LS1 computer to invoke traction control etc.

    Right now I'm pouring over lines and lines of programing code. And starting to write up my own Can bus "listener" program. Little because i haven't found the exact software I'm looking for and a little because I like things "my way". (Betting a lot of engine swappers suffer from this too)

    Some fellow forum members look to be joining me in this project and will help get data samples. This should speed up the R&D time. Hopefully in a few weeks we'll have some kind of additional results to report..
    Last edited by Thaniel; 03-15-2013 at 08:34 AM.

  9. #9
    Join Date
    May 2012
    Location
    Bay Area (707/415)
    Posts
    667
    My Cars
    2003 M3
    If this could work out for the E36s with S54s that would be amazing!
    "Sucking at something is the first step to being sorta good at something!"

  10. #10
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6
    Still in need of some data sample from an E46. So I watch the video at the bottom bunch of times and extracted about all I can.

    Looks like what the author is trying to show us on the screen is:
    ARBID : DLC : Data : Cycle (m/s) : Count
    613h : 8 : FC 2F FF 5D 01 00 00 00 : 200 : 95350
    615h : 8 : 00 00 00 FF 00 00 00 00 : 200 : 95353

    And that he multiplies the RPM times 6 then 1.07 to get 35310 then converts it to hexidecimal to get 89 EE. Then sends this over ARBID 613h in byte 3 and 4 to make the RPM read. [edit: RPM is on ARBID 316 byte 2 and 3 (LSB first), Temp appears to be on 329 byte 1]

    I have a instrument cluster being shipped to me. Should be here next week. I'll give those values a try and see what happens.
    Last edited by Thaniel; 12-20-2013 at 11:21 AM. Reason: fixed formating

  11. #11
    Join Date
    Oct 2005
    Location
    Lawrenceville, GA!
    Posts
    10,460
    My Cars
    Many Broken Ones
    Epic.
    460whp/515wtq wifes MMW tuned 335i

  12. #12
    Join Date
    Apr 2010
    Location
    Leicester, MASSHOLE
    Posts
    209
    My Cars
    99 323i?
    In an E46 do you need the can-bus system to run the climate control, exterior lighting (headlights, taillights, brake lights, & turn signals), power windows, etc? Or is it mainly related to the gauge cluster, tach signal, & temp gauge? My interest is in having climate control and exterior lights, so the car can be street-able. I don't have any issue removing the stock cluster and running after market gauges.

  13. #13
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6
    Got my instrument cluster yesterday. It's from a Right hand drive 2001 320ci from the UK. In looking up wiring diagrams for it I found a "Scope of function" description in the WDS wiring Diagram System under Body -> Displays and information -> instrument Cluster. Attached a copy as well.

    Does anyone have a parts car that could supply me with the connectors that go to the instrument cluster? Shoot me a PM. Would be a lot simpler than what I'll do other wise.

    Quote Originally Posted by greenmonster138 View Post
    In an E46 do you need the can-bus system to run the climate control, exterior lighting (headlights, taillights, brake lights, & turn signals), power windows, etc?
    A short answer is you need the instrument cluster.
    Check out this link (from post 1): http://www.bmwtech.ru/pdf/e46/ST034/2%20Driver%20Information%20Internet-1.pdf
    Also some good info here: http://forums.bimmerforums.com/forum....php?t=1876487

    Thaniel
    Attached Images Attached Images
    Last edited by Thaniel; 09-13-2012 at 04:26 PM.

  14. #14
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6

    We have Data!

    It has not even been a month and I think this project has made some good progress. Latest step is a big one. Fellow forum member and engine swapper zr6sbc connected up a can bus shield and Ardruino to his E46 and was able to extract a data sample! Here is an short bit from the sample. (The entire sample is 22,000 lines long)

    len : ARBID : Ext? : Data
    8:316:0: 5 14 F9 31 14 17 0 16
    8:329:0: 11 9A 8C 8 0 1A 0 0
    8:1F5:0: B2 10 0 0 21 B1 0 0
    8:43F:0: 0 8 A0 FF 0 80 FF 0
    8:1F0:0: 0 0 0 0 0 0 0 0
    8:329:0: 11 9A 8C 8 0 1A 0 0
    8:1F5:0: B2 10 0 0 21 C1 0 0
    8:43B:0: 70 CC 3D 0 0 0 0 0
    8:329:0: 11 9A 8C 8 0 1A 0 0
    8:316:0: 5 14 19 32 14 17 0 16
    8:613:0: 3F 46 23 10 19 0 0 0
    8:1F5:0: B2 10 0 0 21 D1 0 0
    8:329:0: 11 9A 8C 8 0 1A 0 0
    8:43F:0: 0 8 A0 FF 0 80 FF 0
    8:1F5:0: B2 10 0 0 21 E1 0 0
    8:316:0: 5 14 6 32 14 17 0 16
    8:329:0: 11 9A 8C 8 0 1A 0 0
    8:43B:0: 70 D2 3D 0 0 0 0 0
    8:1F5:0: B2 10 0 0 21 F1 97 EE
    8:1F3:0: 60 80 0 FF 9 81 0 8
    8:316:0: 5 14 19 32 14 17 0 16
    8:1F5:0: B2 10 0 0 21 1 0 0
    8:43F:0: 0 8 A0 FF 0 80 FF 0

    There is nothing like having real world data to validate information. This is what has been validated. I recieved information from the person with the E46 cluster video and he directed me that the E46 data is much like the mini cooper data that I have previously linked to. So with that information and the valid data stream I can now say:

    The can bus is 500kb/s
    ARBID: 0x316 byte 02 and 03 contain the RPM (LSB is 02, MSB 03)
    ARBID: 0x329 Byte 01 is Temp Byte 5 is Throttle position.

    I need to do a bit more data crunching to come up with the injector pulse width value for the MPG guage. (wasn't identified by the previous information)

    Also need to wire up the Guage cluster I have and try sending it these values to test. But seems to me it's just a matter of time to get this to work. May also have to sort out some other values too but this I think gets a good start.


    ************************************************** ****
    More tedious details if interested:
    Much to my surprise what appeared to be proven can listener programs on the web turned out to not be all that successful. The program provided with the can bus shield only polled the ECU for data and wasn't a listener program at all. So I searched the web and found a couple others. Program A when connected to my rental car only showed one ID and never changing data. Program B showed lots of data but the ARBID's after awhile seemed suspicous (switching between standard and normal format) and it had errors in the data fields (A particular message was 3 bytes long but showed 8 bytes of data). Quite by accident I found that if I ran program A after I had run program B it would stream good reasononable looking data. Humm. Program B set the masks and filters in the can bus shield to wide open where program A did nothing with filters and masks. So it seems the sheild resets the masks to some default after power down. And when I switch programs without shutting down the masks and filters from program B allowed program A to work. Nice. So I could debug program B or Jam the masks and filter subroutines into program A. I did the later. And this is the program that was used to get the data stream above. I'll have to see if the original program authors would like this information.
    Last edited by Thaniel; 09-21-2012 at 06:23 AM.

  15. #15
    Join Date
    Jul 2006
    Location
    Arizona
    Posts
    797
    My Cars
    2003 Z4 Roadster
    Add some more data to the mix, this is out of an E85 Z4:

    8:545:0: 0 A3 45 0 4F 1 0 3E
    8:316:0: 4 C 0 0 30 15 0 C
    8:329:0: 11 6E B7 1 0 0 1 FF
    8:545:0: 0 A3 45 0 4F 1 0 3E
    8:316:0: 4 C 0 0 30 15 0 C
    8:329:0: 11 6E B7 1 0 0 1 FF
    8:545:0: 0 A3 45 0 4F 1 0 3E
    8:316:0: 4 C 0 0 30 15 0 C
    8:329:0: 11 6E B7 1 0 0 1 FF
    8:545:0: 0 A3 45 0 4F 1 0 3E
    8:316:0: 4 C 0 0 30 15 0 C
    8:329:0: 11 6E B7 1 0 0 1 FF
    8:545:0: 0 A3 45 0 4F 1 0 3E
    8:316:0: 4 C 0 0 30 15 0 C
    8:329:0: 11 6E B7 1 0 0 1 FF
    8:545:0: 0 A3 45 0 4F 1 0 3E

    Now we need to figure out how to decipher it all and pick out what specific info we need to emulate.

    Based on Thaniel's info, if 316: bites 2 and 3 are RPM, then:

    8:316:0: 4 C 0 0 30 15 0 C

    would be RPM. However, that converts to 3072 which is WAY too high (all my data was logged sitting in the garage at less than 2K). Furthermore, I went just ran a quick log of the CAN with key on/engine not running and I consistently get:

    8:316:0 5 C 0 0 C 19 0 C (ie: again saying 3072RPM, which is impossible)....

    soooo... guess we are missing something...

    I'm using the same modules (Arduino Uno and CAN Shield) and software (written by Thaniel). I tapped in behind the gauge cluster in my car (CAN-HIGH/CAN-LOW/POWER/GROUND).

    My plan is to drive the gauges/SES light off the GM ECU and use EFILive to code the BMW Vehicle VIN into the GM ECU. This should allow everything to work as factory and get me through an OBDII emissions test.
    Last edited by V8Z4; 09-15-2012 at 02:40 PM.
    Chris

  16. #16
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6

    More success.

    Hadn't planned on working with the instrument cluster until we got the right connectors. But Garrett said "surely we could put power to it and see the lights come on". So I scavanged a few connectors and wire around the house (and duct tape) and we did just that. Then well it's only 2 more pins to connect up the Can Bus. One thing leads to another and...



    Like the E36 the temperature guage is not happy unless there is some RPM on the tach. We messed with it a bit and feel we have pretty good values to move the Tach and Temp guage. Oh also learned the instrument cluster sends OUT ARBID 0x615. We "listened" to the bus and with the cluster just by it self we got 0x615 0:0:0:A8:0:0:0:0
    Last edited by Thaniel; 03-15-2013 at 08:39 AM.

  17. #17
    Join Date
    Jul 2006
    Location
    Arizona
    Posts
    797
    My Cars
    2003 Z4 Roadster
    Quote Originally Posted by Thaniel View Post
    Hadn't planned on working with the instrument cluster until we got the right connectors. But Garrett said "surely we could put power to it and see the lights come on". So I scavanged a few connectors and wire around the house (and duct tape) and we did just that. Then well it's only 2 more pins to connect up the Can Bus. One thing leads to another and...

    http://www.youtube.com/watch?v=FTOrUbbu_RU

    Like the E36 the temperature guage is not happy unless there is some RPM on the tach. We messed with it a bit and feel we have pretty good values to move the Tach and Temp guage. Oh also learned the instrument cluster sends OUT ARBID 0x615. We "listened" to the bus and with the cluster just by it self we got 0x615 0:0:0:A8:0:0:0:0

    Very nice.
    Chris

  18. #18
    Join Date
    Aug 2011
    Location
    Salt Lake City
    Posts
    265
    My Cars
    '95 M3, 97' E39 540i-LS3
    After sending Thaniel my data, he sent back a RPM vs. time graph and it very much minicked what I did with the throttle. Seems that he's pulled the correct data.
    540i-LS3-TR6060 swap thread

  19. #19
    Join Date
    Jul 2006
    Location
    Arizona
    Posts
    797
    My Cars
    2003 Z4 Roadster
    Quote Originally Posted by zr6sbc View Post
    After sending Thaniel my data, he sent back a RPM vs. time graph and it very much minicked what I did with the throttle. Seems that he's pulled the correct data.

    Hmm... can you confirm I'm looking at the right section of the line? Perhaps I'm missing something. I just know that I can't have an "RPM" when the engine is not running
    Chris

  20. #20
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6
    Quote Originally Posted by V8Z4 View Post
    Based on Thaniel's info, if 316: bites 2 and 3 are RPM, then:

    8:316:0 5 C 0 0 C 19 0 C (ie: again saying 3072RPM, which is impossible)....
    What you have is right but have missed byte 0. in can bus they start at zero so decoded is
    Data Length 8
    ARBID 316
    Extended format 0 (meaning standard)
    Byte 0 = 5
    Byte 1 = C
    Byte 2 = 0
    Byte 3 = 0

    Etc...

    Then the other trick is they put the Least significant byte first. So say Byte 2 is FF and byte 3 is 12. This is actually hex 12FF (not FF12). Then to convert to RPM is convert to decimal and divide by 6.42 or 757.5 RPM

    Easy right?

    Oh and sorry guys for not sending any new programs today. As you see from the video I got a little distracted.
    Last edited by Thaniel; 09-15-2012 at 03:47 PM.

  21. #21
    Join Date
    Aug 2011
    Location
    Salt Lake City
    Posts
    265
    My Cars
    '95 M3, 97' E39 540i-LS3
    At this point, I'm only the messenger. We'll have to wait on Thaniel for the key.

    I'm guessing those in the know will start a running translator document?
    540i-LS3-TR6060 swap thread

  22. #22
    Join Date
    Jul 2006
    Location
    Arizona
    Posts
    797
    My Cars
    2003 Z4 Roadster
    Quote Originally Posted by Thaniel View Post
    What you have is right but have missed byte 0. in can bus they start at zero so decoded is
    Data Length 8
    ARBID 316
    Extended format 0 (meaning standard)
    Byte 0 = 5
    Byte 1 = C
    Byte 2 = 0
    Byte 3 = 0

    Etc...

    Then the other trick is they put the Least significant byte first. So say Byte 2 is FF and byte 3 is 12. This is actually hex 12FF (not FF12). Then to convert to RPM is convert to decimal and divide by 6.42 or 757.5 RPM

    Easy right?

    Oh and sorry guys for not sending any new programs today. As you see from the video I got a little distracted.
    So is it always byte 3 before byte 2?

    If you can fix up the SD card version, that would be a big help.

    Have you had any luck figuring out the Speed signal coming out of the ABS?

    I have removed the ABS pump/block on my car but had to leave the ABS "brains" to feed MPH. I'd like to remove the ABS entirely and just convert the MPH output from the GM ECU to CAN. That way I can just edit for changes in tire size/gearing/etc in the ECU to change the speedo calibration.
    Last edited by V8Z4; 09-15-2012 at 04:16 PM.
    Chris

  23. #23
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6
    Quote Originally Posted by zr6sbc View Post
    I'm guessing those in the know will start a running translator document?
    Right now I'm using a translator called "Garrett" . He's using excel and graphing things all sorts of ways. Think he's found the injector pulse width (for MPG)

    Quote Originally Posted by V8Z4 View Post
    That's cool. If you can fix up the SD card version, that would be a big help.

    Have you had any luck figuring out the Speed signal coming out of the ABS?
    I'll try to add the the SD card logging tomorrow. It shouldn't be hard. Just some copy paste from the Listerner_three program. Oh and forgive the poorly slapped together code (if you start digging into it) Especially in the last one. I cobbled it up quickly and know it's poorly formated. But it worked and we just need it until we get the data sorted.

    Haven't looked at speed signals at all. All the data I've been given is at zero MPH .

  24. #24
    Join Date
    Jul 2006
    Location
    Arizona
    Posts
    797
    My Cars
    2003 Z4 Roadster
    Quote Originally Posted by Thaniel View Post
    Haven't looked at speed signals at all. All the data I've been given is at zero MPH .
    Guess I have an excuse to go drive around this evening.... darn.... I just hate driving around on back roads for "no reason"



    edit:
    finally gotexcel working easy and the RPMs looks better. The formula I'm using is:

    =(hex2dec("byte3"&"byte2"))/6.42
    Last edited by V8Z4; 09-15-2012 at 04:25 PM.
    Chris

  25. #25
    Join Date
    Nov 2005
    Location
    Kilmarnock, VA
    Posts
    1,873
    My Cars
    E53, E90, Triumph GT6
    Went out of town so didn't to much on this except read some more. Found some interesting things. But home today so could do more testing. From my reading saw that the instrument cluster can be put in Test mode and in one mode will put up the engine temp in digital. With a little program my son whipped up we were able to have the cluster go through the entire temperature range 00 - FF and we recorded the values. Then did a best fit which pretty much exactly matches (with the exception of FF which is an invalid number).

    The formula for Temperature is: Temp in C = .75 * x - 48.373. where x = the can bus value (ID 0x329 Byte 1) converted to decimal.

    Wanted to find the value that would turn of the check engine light. So I took a value for each ARBID and sent it to the instrument cluster. Light went out. So then just a process of elimination finds that ID 0x153 Byte1 sets the engine light when it is an ODD value. Or in other words.

    Bit1 of Byte 1 of ID 0x153 turns off the check engine light when it is zero.

    Instrument cluster is happily running in front of me with no check engine light, the tach and temp at standard values.

    About all the values really needed is the injector pulse signal (not real critical but who wants a dead gage). Think I have a good guess at what it is but I need to input a speed signal to get the gauge to move. From my recent reading seems the speed signal input to the Inst cluster (DME and cruise) is not on the canbus. The value might be repeated over the bus but it comes direct from the ABS unit as a square wave signal. I'll have to set up a pulse generator to feed the inst cluster a speed signal then experiment to get the value that move the MPH gage.

    It for now.

Page 1 of 40 123456789101126 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •