J1979, ISO15765, OBD-II
- catphish
- Posts: 959
- Joined: Fri Oct 08, 2021 11:02 pm
- Location: Dorset, UK
- Has thanked: 96 times
- Been thanked: 188 times
J1979, ISO15765, OBD-II
I'm looking at options to display my vehicle data on a display in my car, ideally an Android tablet. The simplest way to do this would seem to the the Torque app. Does Openinverter have any support for J1979 / ISO15765 / OBD-II, or would I need my VCU to buffer cache the data and provide the OBD-II responses?
- tom91
- Posts: 2393
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 207 times
- Been thanked: 563 times
Re: J1979, ISO15765, OBD-II
OBD-2 is very straight forward luckily. As it is a query response type structure.
I modified this arduino code to work for some testing: https://github.com/spoonieau/OBD2-ECU-Simulator
I modified this arduino code to work for some testing: https://github.com/spoonieau/OBD2-ECU-Simulator
- tom91
- Posts: 2393
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 207 times
- Been thanked: 563 times
Re: J1979, ISO15765, OBD-II
Orion is quite detailed on how they done it too. https://www.orionbms.com/general/retrie ... d2-canbus/
- catphish
- Posts: 959
- Joined: Fri Oct 08, 2021 11:02 pm
- Location: Dorset, UK
- Has thanked: 96 times
- Been thanked: 188 times
Re: J1979, ISO15765, OBD-II
Yep, shouldn't be too tricky to implement, and I guess it makes sense to have a single device collect the data and handle all OBD2 queries.
- tom91
- Posts: 2393
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 207 times
- Been thanked: 563 times
Re: J1979, ISO15765, OBD-II
I do not know if the Torque app allows you to connect to multiple ECUs, so you could be forced into collecting or atleast gatewaying.
- johu
- Site Admin
- Posts: 6719
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 369 times
- Been thanked: 1545 times
- Contact:
Re: J1979, ISO15765, OBD-II
I am currently refactoring the CAN module anyway to separate the hardware from the logic part, so I might add an OBD2 layer as well.
I'm kind of tired of my android radio not reliably connecting via wifi so this would be a good alternative.
I'm kind of tired of my android radio not reliably connecting via wifi so this would be a good alternative.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- catphish
- Posts: 959
- Joined: Fri Oct 08, 2021 11:02 pm
- Location: Dorset, UK
- Has thanked: 96 times
- Been thanked: 188 times
Re: J1979, ISO15765, OBD-II
My thought was that if each ECU only responds to requests it knows the answer to, and there's no overlap, there shouldn't be a problem with them all using the same address.
It would be fantastic if this is something that can be added. I love the web interface for programming / tuning / debugging, but once the vehicle is up and running, OBD2 would likely be the better option, at least for monitoring. The ESP8266 drives me a little mad.
-
- Posts: 28
- Joined: Sun Dec 01, 2019 7:46 am
- Location: Seattle, WA, USA
- Been thanked: 4 times
- Contact:
Re: J1979, ISO15765, OBD-II
I just sent a PR to add OBD2 support to the stm32-vcu code: https://github.com/damienmaguire/Stm32-vcu/pull/57
I just created a custom service that maps PID to Param num and let the displaying app deal with formatting it. This was a bit tricky since there appears to be some pretty bad bugs in the Torque code for dealing with signed 32 bit values, but I found a way to brute force it with the basics that do work.
I also mapped a few of the really basic SAE pids to existing params, but we could certainly add more.
I just created a custom service that maps PID to Param num and let the displaying app deal with formatting it. This was a bit tricky since there appears to be some pretty bad bugs in the Torque code for dealing with signed 32 bit values, but I found a way to brute force it with the basics that do work.
I also mapped a few of the really basic SAE pids to existing params, but we could certainly add more.
- uhi22
- Posts: 1116
- Joined: Mon Mar 14, 2022 3:20 pm
- Location: Ingolstadt/Germany
- Has thanked: 205 times
- Been thanked: 611 times
Re: J1979, ISO15765, OBD-II
The TorquePro definitely connects to multiple ECUs. I use it in Hyundai Ioniq. The gateway is just routing the requests and responses to/from the other buses. The gateway does not collect the data autonomously.
BTW: ISO15765 is only the transport layer, which makes it possible to transport up to 4095 bytes per PDU. Above is the diagnostic protocol, in these days usually UDS. I think it makes sense to implement this, it is a standard. In one of Damiens videos I even saw that he used ODIS as counterpart on PC side. This is a standard tool for measurement, parametrization, dealing with error memory and running io-control. (I have no idea where he found an unlocked version.)
Github: http://github.com/uhi22 --- Patreon: https://www.patreon.com/uhi22
Re: J1979, ISO15765, OBD-II
Does every electric vehicle have a standard pid list for obd2? Or is there a different pid list for the per vehicle? Do you have an example
- DaveEV
- Posts: 13
- Joined: Thu Nov 10, 2022 6:15 am
- Has thanked: 16 times
- Been thanked: 5 times
- Contact:
Re: J1979, ISO15765, OBD-II
This OBD-II data from the OpenInverter board is just what I was looking for. I'm using Torque for a digital dash, would like to pull PIDs from Thunderstruck MCU and OpenInverter. I'd really like the "DIR" info, but there is lots of good things I could add. I see the request, and it looks like it was committed to the code. I just updated to 5.35.R-foc so I would think it's in there... But I imported the CSV and I'm not seeing data. I'm not setup to hack the CAN and pinned my own connector, so there's a chance the OpenInverter board is not actually on the CAN.
Does anyone have this working? OpenInverter OBD2 messaging over CAN to Torque (or other app?) I'm getting data from Thunderstruck MCU over CAN...
Does anyone have this working? OpenInverter OBD2 messaging over CAN to Torque (or other app?) I'm getting data from Thunderstruck MCU over CAN...
Code: Select all
/* Example csv for Torque Pro
SIGNED32() doesn't appear to work so I brute forced proper handling of signed int32 values.
Name,ShortName,ModeAndPID,Equation,Min Value,Max Value,Units,Header,startDiagnostic,stopDiagnostic,scale,minimumRefreshDelayMillis
udc,udc,0x2a07d6,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,300,400,V,,,,1,0
opmode,opmode,0x2a07d2,LOOKUP(D/32::0='Off':1='Run':2='Precharge':3='PchFail':4='Charge'),0,4,,,,,1,0
veh_speed,veh_speed,0x2a07e1,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,0,200,kph,,,,1,0
torq,torq,0x2a07e2,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,-3500,3500,,,,,1,0
speed,speed,0x2a07e0,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,0,20000,rpm,,,,1,0
pot,pot,0x2a07e3,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,0,4096,,,,,1,0
pot2,pot2,0x2a07e4,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,0,4096,,,,,1,0
potnom,potnom,0x2a07e7,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,0,100,%,,,,1,0
dir,dir,0x2a07e8,LOOKUP(SIGNED(D)/32::-1='Reverse':0='Neutral':1='Forward'),-1,1,,,,,1,0
tmphs,tmphs,0x2a07ec,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,0,100,C,,,,1,0
tmpm,tmpm,0x2a07ed,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,0,100,C,,,,1,0
idc,idc,0x2a07dc,((BIT(A:7) * -256*256*256*256) + (A*256*256*256) + (B*256*256) + (C*256) + D)/32,-200,200,A,,,,1,0
- johu
- Site Admin
- Posts: 6719
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 369 times
- Been thanked: 1545 times
- Contact:
Re: J1979, ISO15765, OBD-II
The inverter firmware doesn't have OBD support in its current version
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- DaveEV
- Posts: 13
- Joined: Thu Nov 10, 2022 6:15 am
- Has thanked: 16 times
- Been thanked: 5 times
- Contact:
Re: J1979, ISO15765, OBD-II
Thanks! I also have Thunderstruck's CAN-OBD2 translator, so I'll see if I can figure out how to program it with OpenInverter CAN messages... Unless someone has that mapped already. I plan to use OBD PIDs from the stm32 code, probably have remove I upgrade to version with OBD2 messaging coded.