onboardpi icon indicating copy to clipboard operation
onboardpi copied to clipboard

Clearing CEL/Imperial Unit Conversion

Open mycloudllc opened this issue 2 years ago • 7 comments

I was just wondering if there was any update on the imperial unit conversion, or the ability to clear cel? Love the software, it amazing, just really missing those 2 things. Anything that you need help with?

mycloudllc avatar Jan 08 '24 10:01 mycloudllc

Hi @mycloudllc, thanks for the support! I'd love to help you out with these improvements and have been meaning to get back to this project. I think we will split these two into separate PR's.

For CEL clearing, this should be a quick one, we can create a button on the toolbar when on the Diagnostics page. If you currently have an engine code and would be willing to test the feature, that would be an amazing plus 😃

For the unit conversion, I had done some digging into unit conversion using Pint, the library already used by python-obd to implement different unit systems. We could place a setting in the settings.json file which is already read by the OBD service and loaded into its configuration so the conversion takes place server-side. Thoughts? The only snag I remember with Pint was that some Quantities only had certain conversion available, e.g. a speed in KM/H weirdly only had conversions to "inches per minute" or similar and not "miles per hour" but perhaps they have updated the library.

bgunson avatar Jan 31 '24 15:01 bgunson

I think that would work perfectly. I can definitely do some testing for you. As far as pint and python-OBD(https://python-obd.readthedocs.io/en/latest/Responses/), the version of pint it's using does appear to be able to spit out "MPH" just fine.

mycloudllc avatar Jan 31 '24 21:01 mycloudllc

Hey again @mycloudllc, I just finished an initial "Clear DTC/CEL" function from the Diagnostics page. When you click the button you'll be hit by a disclaimer, yada yada, then once confirm I'd hope that the codes are cleared. image

I am working under the assumption that using python-obd's query method will perform the clear when those PID bytes (0x0400) are sent to the OBD device. If you're able to give it a try and let me know how it goes that would be awesome.

This version is available via Docker or GHCR @ version 0.4.3-beta. I have not tested the containers themselves yet but can load them up in my car asap. Hoping to get started on the unit conversions soon too. 😄

Thanks,

Bennett

bgunson avatar Feb 02 '24 04:02 bgunson

I see that that obd container has tag for 0.4.3-beta However the web container does not, at least on docker. With just the obd container updated I don't have the option to clear pids

mycloudllc avatar Feb 03 '24 13:02 mycloudllc

I will look into it and have just realized that using python-OBD Async class requires the command be watched before being able to query it so will need to rework the logic anyway so will push v0.4.3-beta.1 soon.

Edit: Sorry abou that @mycloudllc, should be all good now using tagname: 0.4.3-beta.1

bgunson avatar Feb 03 '24 19:02 bgunson

Clearing the CEL in the latest version works great!

mycloudllc avatar Feb 05 '24 20:02 mycloudllc

Great to hear @mycloudllc ! I have started the imperial units and just want to have you confirm if I am missing any conversions. So far I have:

  • kilometer to mile for distances
  • kph to mph for speed
  • kilopascal to psi for pressures
  • grams/sec to lbs/min for flow rates
  • °C to °F for temperatures

I think that covers most of the mode 1 PIDs bt if there are any others I have missed, let me know.

Eventually, I'd love to see the unit conversion by configurable on a command-by-command basis so these wouldn't have to be set in stone.

Edit: A beta version with these conversions is available in v0.4.3-beta.2. Note you will have to reconnect to the vehichle if changing the setting mid usage. Also if you use OAP, then there is a separate setting in its settings page.

bgunson avatar Feb 07 '24 01:02 bgunson