IFCT - Improved Flexcan Teensy Library

Status
Not open for further replies.
Hi Tony

After a couple of days of searching I finally found the right CAN_ID for the Hyundai Sonata (2006 probably to 2011, think that's the year the changed design). For anyone interested its 0x7E0 not the standard 0x7DF. Among the spew since I didn't have filtering on I was able to get the engine RPMs:
Code:
RPM:	652
RPM:	652
RPM:	652
RPM:	651
RPM:	651
RPM:	651
RPM:	651
RPM:	652
RPM:	652
RPM:	652
RPM:	652
RPM:	651
RPM:	651
RPM:	652
RPM:	652
RPM:	651
RPM:	651
RPM:	651
RPM:	651

As a double check I tested it against the ODBLink-MX and pretty much matched, by pretty much is that they were off by 1 or 2 but I am attributing that to different times I tested.

I only ran into one problem - it only worked for a few seconds as is shown in the following run when I fist tested it:
Code:
*HEARTBEAT* 6301
*HEARTBEAT* 10302
*HEARTBEAT* 14303
RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

RPM: 973.00

*HEARTBEAT* 18304
RPM: 973.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

*HEARTBEAT* 22305
RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

RPM: 972.00

*HEARTBEAT* 26306
*HEARTBEAT* 30307
*HEARTBEAT* 34308
*HEARTBEAT* 38309
*HEARTBEAT* 42310
*HEARTBEAT* 46311
*HEARTBEAT* 50312
*HEARTBEAT* 54313
*HEARTBEAT* 58314
*HEARTBEAT* 62315
-- end test

Any ideas why it would just stop? RPM data is being requested every 1 second. Either way it does work.
 
Probably the termination on your receiver needs to be removed, the bus on a vehicle is already terminated so extra terminations may cause issues. Also The data from the ECU requests like RPM can be ever so slightly off on the regular can traffic as the data is recalibrated before going to the cluster which causes latency of very minuscule timeframe. Ex. the speedometer on my vehicle has a 1Hz refresh on the cluster, which uses both BCAN and HSAN busses. The BCAN bus contains realtime RPM & speedometer but I presume the manufacturer preferred using BCAN for RPM and HSCAN for speedometer as they didnt want the speedo jumping more realtime than a 1hz refresh.

I would deduce that the stopping is from a baudrate / termination issue as during bench testing it has run for weeks on end :)
 
IFCT and ODD II Implementation?

Hi Tony.

Didn't remove the terminator yet. Noticed that the returned message packet didn't conform to the PID packet format or the return message ID. So I ok maybe its the unit. So I changed the requested message to module voltage (42) and it came out to be on the order of 4.15 volts. Think it should be reading close to the battery voltage (not really sure what it should read maybe 5?). But I also notice I did get some rpm readings as well even though I did not request it so conclusion not sure whats going on.

I attached an odblink mx and used the android app and battery voltage was around 13.5 volts when the engine is running and rpm as around 1200. I think the obblink was using the K/L lines to query the ECU (KWP standard). If I looked under the hood it said it was ODB II compliant (there is a sticker under the under that shows that, requirement in all cars I guess).

For the heck of it I tried a different can-id code and didn't get any data. Think the big problem is that for me until I can get the right can-id code don't think I am going to be able to query the ECU.

If anyone has any suggestions please feel free to jump in here and help test the library. Or if someone else wants to give it a try please let me know if it works for you (assuming you have one set up using the Flexcan library :))

Thanks
Mike
 
Have you got any logs of the odbmxtool? I never used the PC end software, I too used the MX with an iPhone 5 and an android phone (Yeah, contrary to the MX supporting Ford and GM but doesn't support the iPhone, where a WiFi version exists specifically for iphone that has NO GM/FORD support... lol)... My iPhone 5 was jailbroken and theres a BT stack available in cydia that enabled OBD over IP which DashCommand used, so even though the MX was NOT supporting iPhone, it did actually work :p

are you able to run the odbmxtool in parallel with the teensy, and have teensy view all the stream while the MX is running on your android? This should let you see all the details the MX is talking to

Last year I was capturing in serial monitor the stream when i plugged the obdmxtool running dashcommand, its how i got the ecu address, but i hardwired my canbus to the back of the obd port wiring (6 & 14)
 
IFCT and ODD II Implementation?

Last year I was capturing in serial monitor the stream when i plugged the obdmxtool running dashcommand, its how i got the ecu address, but i hardwired my canbus to the back of the obd port wiring (6 & 14)
No haven't tried to get both working at the same time yet :) I actually have seen splitter cable.

I never used the PC end software, I too used the MX with an iPhone 5 and an android phone
Haven't tried with a PC yet.

I did finally find a partial answer to my question but haven't finished yet :) I got it off the Hyundai forum.
Buyer beware, the 06-07 sonata's ECU's speak ISO 9141 & KWP 2000. Not untill 08 will they speak CAN ….

more work to do
 
funny they dont speak CAN yet your receiving data, im not familiar with cross-protocols but the controller wouldnt pick up data if it wasnt supported :eek:

don't believe some people on forums as not everyone could be correct *grin*

heres an idatalink document for your vehicle sonata 2006-2010

http://cdncontent2.idatalink.com/corporate/Content/Manuals/RR-HYU/ADS-RR(SI)-HYU01-DS_20150423.pdf

According to the documentation, the module connects to 6 & 14 of the CAN lines, not 7 & 15 of ISO9141/KWP2000...

It's also possible the car supports both, 2006 was the first year car's started implemented CAN as standard

KLine requires a transceiver on a UART port, not same as CAN :eek:
 
Last edited:
One of things I was thinking and reading is that is an implementation of KWP over CAN bus. Can't find much in terms of addressing though. What I've seen on line is implementations for using the K and L lines. Still have to play some more with the ODBlink with the pc attached and see what the logs are really showing. The logs on the app seem to be limited.

The doc you linked to are for a 2012-2016 Hyundai accent. In those years CAN should have been fully implemented on Hyundai's.
 
Got it. Missed it on first go around. :)

EDIT: By the way where the heck did you find that
 
i googled your car and idatalink, which are bypass modules for remote starters for your car, they usually work off proprietary data over canbus and transponder system :)
 
Hi all

@ tonton81
I believe you were messing with Honda Civic before, I need Engine temperature - Current voltage - Engine oil pressure on a 2014 Honda Civic.
I'm not a big fan with the red warning light in instrument cluster, most likely the damage will be done before you see any dummy lights.

The question: Do you have the PIDs with the calculated conversion I need, I hope you can point me in the right direction.
 
i currently have a 2007 dxg civic, but the 8th gens are from 2006-2011, dont expect 2014 to have same pids as the modules are different along with the ecu, the best way is to capture the current temp/fuel via ecu request, and while having the value on hand, try to compare it to one of the other canids on the bus. the fuel and engine temp are a single byte of one of the canids streaming (no conversion needed), and in my case, that module for the upper cluster is on the network in ~5Hz postings, not repetitive like the other ids, same with the VIN, about every 5 secs its posted. easiest thing to do for me was to reject all ids except the one i want (pick any) and let it scroll in serial monitor, then start touching buttons, blinkers, climate,radio, gas/clutch (and gas throttle position) are there for me, even drive very slow to see if data changes and take notes. then try again with another id to see what that id is being used for (ac compressor, handbrake,headlight,etcetc,) keep in mind that some of the bytes are bitstuffed, like one of the bytes in my canid (1 of 8 bytes), 4 bits represent headlight, drl, highbeams, and handbreak, another byte represents wiper switch position (intermittent, low, high, fluid, etc)
 
my moms 2015 civic might be similar but i wouldnt have time to devote it for testing use as she needs it :p once im done paying that one off ill get another civic for myself

i spent the last week installing 2x dei535t modules and 1x pke2102T module in her car for keyless and auto windows roll up when locked, with all window one-touch capability for up and down :)
 
yes, im sure all transceivers work but i got that one cuz of its nice form factor :)

take note that the enable pin of that transceiver should be GND for the tranceiver to work

other transceivers i believe are set high to enable
 
I hear you man this is for new to me DD driver, I had the 2009 @305k miles but I lost the car recently (deer and headlight combination) on the highway doing 75mph at 4 a.m. lucky I'm still alive:rolleyes:
 
Last edited:
Well I think I found the issue with my getting ecu data from my Car. Trolling on the Hyundai website for the last couple of days and googling a ton of info I found:
Starting in 2008 all vehicles sold in the US were required to use the CAN bus (ISO 15765-4). The previous years used the K-Line. That could be the issue...
and that my car has both available. It appears that still are CAN IDs that flow across the can bus but not 100% sure what they are yet. Still going to do some testing just in case.
 
Hi Tony,
Using a splitter cable with the OBDLink/mx I was able to retrieve watch what was going on with the can bus and the data on dashboard. Log wasn't really much good just recorded the rpm and oil temp (that is all I requested). But when I turned the car off but left the ignition on I was able to get two can messages that kept repeating every two heart beats:
Code:
**** MB 0  LEN: 8 EXT: 0 REMOTE: 0 TS: 13506 ID: 2015 Buffer: 2 1 0 0 0 0 0 0 
**** MB 0  LEN: 8 EXT: 1 REMOTE: 0 TS: 63739 ID: 417018865 Buffer: 2 1 0 0 0 0 0 0
2015 is 0x0DF which is what I originally using to request data. The format I was following for transmitting data request was
Code:
0x02, 0x01, PID_CODE
where 0x01 is the mode.

Not sure what the second message id is for though - any ideas :)
 
my car uses iso 15765-4 as well, thats normal. also with the key off it does the same thing with the repetitive outputs, i believe they use that to notify the modules that the vehicle is off, usually on mine when removing the key it does that for about 10 seconds before the car’s bus “sleeps”.

however that packet 02 01 00 is most likely the odbmxtool, 02 01 00 is a request for the supported PIDs of your vehicle, the ecu should respond back (if its available) with the supported PIDs and the software would use it in the application.
 
btw, did you try sending to 0x18DB 33F1 as the ecu address (with the msg.ext = 1) ? the identifier is similar to the normal ecu addressing of 8th gen civics
 
however that packet 02 01 00 is most likely the odbmxtool, 02 01 00 is a request for the supported PIDs of your vehicle, the ecu should respond back (if its available) with the supported PIDs and the software would use it in the application.
I did have the key in and in the on position. Interesting thing is that when I have the tool on and data transmitted I am getting a few additional messages that I didn't have before but have no clue what the can ids are. Oh, heck here is the whole spreadsheet, maybe you can make heads or tails of it.

EDIT: I did find this instructable for using a uC with the k-line, http://www.instructables.com/id/Low-Cost-OBD2-Communications-on-K-line-ISO-9141-2-/ may give it a try if I feel ambitious.
 

Attachments

  • TyLong.zip
    402.8 KB · Views: 86
btw, did you try sending to 0x18DB 33F1 as the ecu address (with the msg.ext = 1) ? the identifier is similar to the normal ecu addressing of 8th gen civics
no not yet. Was looking at the log from teensy after the fact and then it started getting too hot again :)

UPDATE: Will give it a try later or tomorrow. By the way what addresses does it reply on?
 
you can sort in excel and slight to right side to get a better idea but:

theres at least 2 or more ID's that can see non-random data, or mostly none, those are most likely status messages for things like climate controls, lights, etc

I can't really tell what the data is used for without a physical setup but, in the ISO 15765-4, not all can broadcasts need to follow the standard, where the first byte depicts the length of the data structure.

The best way would get a clean capture of 1 ID at a time like in Serial monitor while it's live, and see what values change (if any) when using the car's features (playing with AC, windows, locks, flashers, stepping gas, etc)
Then when I see that a data field is changing based on the event (after consecutive repeat tests), I can assume I captured the data field in the ID for that event

Take for instance ID 0x2A0 (672), where only 1 byte field is changing (byte 2), between 68 and 69. This could be the actual coolant temperature for your gauge cluster. (no conversion needed, its normally 1 byte)
You could always cross-verify by requesting the ECU the coolant temp to see if it matches (Request: 02 01 05), the calculation over the ECU is (value - 40) for the coolant temperature
If you get a match, and test it while car is cold starting up to see the data rising, or stepping down a bit on gas to "heat the engine" to see if the value rises, your pretty much will know you have the correct data
 
Status
Not open for further replies.
Back
Top