Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 42

Thread: OBDSim now supports multiple ECUs and trouble codes

  1. #21
    VENDOR - ScanTool Vitaliy's Avatar
    Join Date
    Dec 2006
    Location
    Phoenix, AZ
    Posts
    624
    Just tried it with the CES logfile. Is there a way to throttle the refresh rate?
    OBDLink MX: world's smallest, fastest, most advanced OBD/Bluetooth adapter with SW and MS CAN support. Read the review to learn more.
    Need to look up a diagnostic trouble code? Try the most up-to-date, free DTCsearch.com!

    You cannot send me a private message using this forum. Use my email instead: vitaliy[@]scantool.net.

  2. #22
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    Currently the refresh rate is limited in a couple ways:
    1) ATST{n} is honored fairly literally,
    and varies a little based on
    2) ATAT{n}

    Code:
    timeouttime.tv_usec=1000l*e_timeout * 5 / (e_adaptive +1);
    Where e_adaptive is literally the number as provided by ATAT [default 1], and e_timeout is the number of ms [the value passed from ATST multiplied by four] [default 200].

    I'm not entirely sure why that *5 is in there...

    On the other hand, it skips the deliberate delay altogether if you pass the third parameter to the ELM, ie:
    01 00 4

    Did that answer the question?

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  3. #23
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    Just added error code support. There are a couple calls into the data generator API to get and clear trouble codes, they're explicitly handled separately by the sim.

    I then added a data generator that does nothing but spit out a few [for now] hardcoded errors. Next up is adding error code stuff to the gui data generator so it can be done on demand. In the interest of simplicity, the error generator continues to generate the same errors, even after 0x04 is called.

    Note that the error data generator is "just another ecu". You can load it up with a bunch of ECUs like usual, and just make one of them an error reporter. For clarity, with only one ecu:

    Code:
    chunky@mills:~/src/obdgpslogger/build$ ../bin/obdsim -g Error
    SimPort name: /dev/pts/7
    Successfully initialised obdsim, entering main loop
    Code:
    >ATH1
    OK
    >0100
    7E0 06 41 00 80 00 00 00
    >0101
    7E0 06 41 01 83 00 00 00
    >03
    7E0 07 43 01 04 80 03 41 23
    >
    [I'm not sure what to put in those other three bytes on 0101, mostly because I haven't checked the spec yet]. I also don't yet gracefully handle the fact that it's meant to be a specific number of bytes returned.

    There is a [small] disjoint in the API. I have decided not to treat 0101 specially, so that's passed to the generator in the usual way [mode 01, PID 01, the generator responds as it pleases], but modes 03 and 04 are handled via a pair of separate functions. After much consideration, this seems the best way to do it. It's worth noting that they all go through the generator, but there are potentially two entrypoints to talk about trouble codes, so it's just the responsibility of the generator writer to get it right.

    Have fun,
    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  4. #24
    VENDOR - ScanTool Vitaliy's Avatar
    Join Date
    Dec 2006
    Location
    Phoenix, AZ
    Posts
    624
    It makes sense to have the generator control 0101 and 03. In ECUsim, a "fault" event acts on both mode objects (add DTCs to mode 3, and set DTC count for 0101). In some instances you may not want the DTC count to be correct. Certain apps did some funny things when we tried it. ))

    Will you be adding stored and permanent DTCs (modes $07 and $0A)?
    OBDLink MX: world's smallest, fastest, most advanced OBD/Bluetooth adapter with SW and MS CAN support. Read the review to learn more.
    Need to look up a diagnostic trouble code? Try the most up-to-date, free DTCsearch.com!

    You cannot send me a private message using this forum. Use my email instead: vitaliy[@]scantool.net.

  5. #25
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    The generator is strictly in control of 0101 and 03 and 04, it's just that obdsim is in control of the actual output to the scantool. Since that can change around a bit [eg, ATS0/1], obdsim is the one that actually "renders" the string to send back. This was the best way to get that rendered.

    And sure. Modes 07 and 0A are doable, it's all just a question of ... actually getting it done :-)

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  6. #26
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    As far as what features get added at the moment, I'm mainly motivated by either
    1) It being needed for a coming OBDGPSLogger development
    2) Anyone actually using using it explicitly requests something

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  7. #27
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    The gui_fltk plugin now understands error codes:


    Note that "Report DTCs" is off by default - 03 returns nothing, and 0101 says no errors and no MIL. Check the checkbox and it enables reporting of the errors you see. Sending "04" just disables the checkbox. That way if you painstakingly add a few error codes to the box, you don't have to re-add them every time your software sends 04.

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  8. #28
    Low Bitrate remus08's Avatar
    Join Date
    Mar 2010
    Location
    FRANCE
    Posts
    56
    Waov good work.. I have to test this new feature!

    I wanna add a remark about CAN ID... OBDSim should send 7E8, 7E9, 7EA instead of 7E0, ... It doesn't a matter but that's just to be conform to the SAE.

    Another thing. Do you support the ELM ATD0/1 command? Have you already test it? It disables DLC information in the ELM frame, doesn't it?

    I hope, my feedback will help.
    Thanks.

  9. #29
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    OBDSim should send 7E8, 7E9, 7EA instead of 7E0
    Oh, yeah. Now that I re-read what Vitaliy said, you are correct. I've committed that to svn.

    Code:
     /// First ECU is at this address. Subsequent ECUs immediately follow it
    -#define OBDSIM_FIRSTECU 0x7E0 
    +#define OBDSIM_FIRSTECU 0x7E8
    I'm slowly working towards supporting multiple protocols, so some of this will have to change, but for now it's just CAN.

    I don't support ATD0/1 yet [easy enough to add]. I'll look at adding it. The whole main loop of obdsim has become a little unwieldy towards the end, I'm thinking of rewriting that little bit to take different protocols into account at the same time. That would make ATD0/1 easier to work too.

    The full list of AT commands I currently support is in the obdsim manpage. online text version here

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  10. #30
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    Now when you request trouble codes, the results are grouped in threes, and padded if necessary. Hopefully I did it right *fingers crossed*

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

Page 3 of 5 FirstFirst 12345 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •