BlueWave Studio forum
  • Login
  • Register
  • Login Register
    Login
    Username:
    Password:
  • Home
  • Help
  • View Today's Post
  • More
    • BlueWave Studio
    • Shop
User Links
  • Login
  • Register
  • Login Register
    Login
    Username:
    Password:

    Quick Links Home Help View Today's Post
    More
    • BlueWave Studio
    • Shop
    BlueWave Studio forum OpenAuto Pro Documentation, User Manuals How to add custom OBD-II gauge?

    Thread Closed 
    How to add custom OBD-II gauge?
    BlueWave
    Offline

    Administrator

    Posts: 2,813
    Threads: 64
    Joined: Jun 2019
    Reputation: 71
    #1
    09-21-2020, 01:31 PM (This post was last modified: 01-30-2022, 06:58 PM by BlueWave.)
    All gauges are stored in /home/pi/.openauto/config/openauto_obd_gauges.ini file. Count parameter corresponds to number of configured gauges.

    [ObdGauges]
    Count=9

    Below please find example of gauge configuration:

    [ObdGauge_0]
    MinValue=-40
    MaxValue=215
    Limit=90
    Formula=getPidValue(1)
    Label=Temp °C
    ;Formula=(getPidValue(1)*1.8)+32
    ;Label=Temp °F

    [ObdGauge_X] - Each configured gauge has its own section. X value is the 0-based index.
    MinValue - Minimum value of the gauge.
    MaxValue - Maximum value of the gauge
    Limit - Maximum "safe" value of the gauge, e.g. maximum RPM value of the engine is 8000 but maximum safe value is 6800. If there is no such value for the gauge, it must have the same value as MaxValue parameter.
    Label - Label of the gauge that will be displayed on a gauge.
    Formula - Formula for calculation of the value displayed on gauge. Use getPidValue(index) function to get the value of a PID defined in openauto_obd_pids.ini file. It is also possible to enable/disable special diagnostic mode (e.g. in Nissan's cars) by executing queryPid(index) function.


    Capabilities of the formula:

    Quote:Operators: +, -, *, /, %, ^
    Functions: abs, avg, ceil, clamp, equal, erf, erfc,  exp, expm1, floor, frac,  log, log10, log1p,  log2, logn,  max,  min,  mul,  ncdf,  nequal,  root, round, roundn, sgn, sqrt, sum, swap, trunc
    Trigonometry: acos, acosh, asin, asinh, atan, atanh,  atan2, cos,  cosh, cot,  csc, sec,  sin, sinc,  sinh, tan, tanh, hypot, rad2deg, deg2grad,  deg2rad, grad2deg
    Special Functions:
    • getPidValue(index) - get value (by index) of the PID defined in openauto_obd_pids.ini file
    • queryPid(index) - query the PID by index that corresponds to definition in openauto_obd_pids.ini file. This function always return 0. May be helpful to trigger special diagnostic mode (in e.g. Nissan's cars). Example usage: queryPid(0) + getPidValue(2) + queryPid(3) with assumption that PID with index 0 is the one that starts special diagnostic mode and PID with index 3 is the one that stops special diagnostic mode.
    • getInjectedValue(id) - get value indjected by the API. Value of (id) parameter should corresponds to value used on client side of the API.
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)



    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Help · BlueWave Studio · Shop

    Copyright © bluewavestudio.io. All rights reserved.

    Linear Mode
    Threaded Mode