@henk_kuipers - woa blowing fuses... scary. Yeah this definitly should not be happening. Here are a couple of things to check:
- If you rewired the OBD cable that came with your CBT. Be careful as the wires do not seem to tin (take on solder) very well. you may have had a connection come lose that is now shorting things out. You might want to open it up and give it a visual inspection.
- Again if you are rewiring the cable that came with the CBT. Be careful that you have not rotated the PCB inside the plastic shroud that mates with the cars OBD port. If this some how got rotated... Pin 16 on the PCB will now be mating with the Pin 1 of your vehicle... you can check you have it the right way by looking at the shape of the shroud in this picture and making sure your pin 1 is in the right location. <a href="http://developer.mbed.org/media/uploads/fossum_13/xobdii_port1070929671.jpg.pagespeed.ic.GdyXCBV7-t.jpg">OBD-II Pinout </a>
- If you have a simple DMM you should do some voltage and short circuit tests.
- Make sure you get the pin numbers right going into the CBT. That two row male header can be confusing. See the below pinout with more pin numbers shown.
<img src="http://i57.tinypic.com/vrajc8.jpg" />
Also I just found something strange. It appears filtering is only paying attention to the last two numbers of the bus id value.
Ex. if you do 03010106120612 to filter for id:612 (also I believe 0301010612 will work if you are only interested in filtering one ID).
it will filter for "x12" so if you had say a device id of say 312 also on the bus that will still come through the filter.
Is this a bug or am I doing something wrong?
Never mind I found out what I was doing wrong. The message ID needs to be full 16bit i.e. 01E3 not 1E3. So the serial packet would be "020101E3F1FF0000000000008", Looks like I am getting the response right after I send the packet, so I guess that also answers question "C"
Question B, still unanswered. Anyone know the answer?
WooHoo!! I can now turn on and off my cabin light. Might seem like a small win, but I'll take it :)
Hey Yishi, and anyone else this can help ;)
I am going to make the assumption you just got your CBT and you are wanting to hook it up to the OBD port of your car and read out all the data that is flying around on that CAN bus.
- Connect the CBT with the OBD cable you got.
- Issue the "01 10 01" command. This will print out the status of Ch1
You should see "0" errors. However you will likely see errors "b".
This means there was a baud rate error.
- If you get the baud rate error, go and edit the code where it says "CANBus1.baudConfig(cbt_settings.busCfg.baud);" to be "CANBus1.baudConfig(500);" or what ever your baud rate is. Note this value is in kbps i.e. 500 means 500 kbit/sec
*Note I think if you go and pull the latest code from git, Derek has got auto baud rate detection working.
- While you are in the code editing things you may want to turn on JSON formatting. This is done by removing the comment on this line "#define JSON_OUT" in the code
- Recompile and upload the FW to your CBT
- Now turn on logging on the channel you are interested in. ex ch1. 03 01 01 0000 0000
- Now sit back and admire all the data on the bus and start to try to figure out what it all means :)
What happens when you issue that command? Do you still see all unfiltered data? I have used the filter command with great success however I have noticed it can get in a weird state some times. I have found it works best to make sure to turn off all logging. 0x03 0x01 0x00 0x0000 0x0000, then turn on logging with just the filters I want. Like you did above. Also I didn't have much luck making that command work in Realterm it didn't seem to like the 16bit values. Maybe I was just doing something wrong. However when I use CoolTerm and send the data like "03010102900291" seems to work as expected.
Hope this helps!
Also just wanted to give a heads up. Incorrect Baud rate can cause a fault on the CAN bus even if you are not sending data!
Not sure if the CBT is trying to send some data on power on or what, but I connected to a 100k bus when my settings were still at 500k. Every time I connected the CBT to my car the car threw a bunch of CAN error fault codes.
Once I correctly set the CBT to the right baud rate this issue went away.
Derek - This might be a problem if you wanted to try to do auto Baud rate detection, some cars may not support it. Does your base code for the CBT right now try to send CAN data as soon as its powered on?
Got some more awesome links I wanted to share:
<a href="http://www.bmwmotorsports.org/pdf/e70/03a_E70 Voltage Supply and Bus.pdf">http://www.bmwmotorsports.org/pdf/e70/03a_E70 Voltage Supply and Bus.pdf</a>
I seem to be having some trouble sending CAN data. Can someone please help?
I have successfully tapped into the K-CAN on my e90 BMW. I am able to see data flying around no problem. I can even filter data with no issues. However when I go to send a CAN packet the I never see a response, in fact I no longer see any data. It is like the CBT is still waiting for me to send the rest of the CAN packet to it. BTW I am using coolterm to do this.
<b>Here are my steps:</b>
- Turn on filtered logging "030101021A01E3" //This is the center console light (1E3) and its control module (21A)
*Filtered data looks fine. I can see the button pushes and the responses with no issues.
- Attempt to turn on the light using this command "02011E3F1FF0000000000008"
*Now I see no response or any other data for that matter.
<b>So my questions are:</b>
A. Is my serial packet structured incorrectly?
B. If it is just a bad packet structure, how to recover from this without completely power cycling the CBT? Is there not some sort of timeouts build into the code?
C. Does the CBT go back into logging mode as soon as the CAN packet is sent so that it can catch the response?
I am an electrical engineer in Oregon, USA, and I am super excited about the possibilities of this device! Great idea Derek, or is it etx now? :P Also great forum address forum.canb.us haha, very clever :-B
If anyone is interested in BMW CAN go check out the thread I just started over in the Howto's
I wanted to start this discussion thread to bring all of us together who are interested in hacking into the CAN buses on BMW vehicles.
While we don't have our CANBus Triple's yet... (hurry up Derek, we are all dying to get our hands on one :) )
Lets get this thread started with some open discussion. I am interested to see how many BMW hackers we got out there? Respond with your project idea if you have one. I'll go first.
My project idea:
I want to hack into the BMW CAN buses so that I can replace my iDrive display with an Android tablet, and have the center console buttons / knob control it.
Also for anyone interested in BMW CAN hacking this e90post forum link has a bunch of great info!