Git Product home page Git Product logo

Comments (9)

domnulvlad avatar domnulvlad commented on June 12, 2024

I just tried it and indeed it is slow, but that is just how this protocol is.

First it takes 2 seconds to perform the 5baud init, then it takes some time to get the module's info (which cannot be skipped), and then when you disconnect, it is required to wait 1 second before connecting to something else (actually it happens automatically with the connect() function when an attempt fails).

And also the module's baud rate influences the time taken, for example data will be much quicker on a 10400 baud device than on 4800. Again, you can't change any of this.

On my setup I have a cluster at 10400 and radio at 9600, and I can get about one measurement every 8.5 seconds if I switch between modules. Unfortunately there is nothing you can do differently with KWP1281.

Personally, I would say that if you have a project where you show data on a screen, you should have a separate page for each module, not trying to mix multiple modules at once, because you can see how slow it is. Every connection attempt has its own "overhead".

from klinekwp1281lib.

domnulvlad avatar domnulvlad commented on June 12, 2024

You can technically shave off a few seconds by saving a 5baud attempt if you manually delay about 1s between disconnect() and connect(), or you could find some other delay that still works.

from klinekwp1281lib.

emtepe35 avatar emtepe35 commented on June 12, 2024

from klinekwp1281lib.

domnulvlad avatar domnulvlad commented on June 12, 2024

No, the protocol only supports one connection at a time. Everything happens on a single wire so there is nothing to do.

You could actually maybe get to the connector on the CCM and cut the K-line from the bus so it isn't connected to the other K-lines anymore. Then you could use a dedicated adapter for the CCM and another one for the rest of the modules.

from klinekwp1281lib.

domnulvlad avatar domnulvlad commented on June 12, 2024

I haven't done it before because I only have one adapter but I think you would have to use you own custom5baudWaitFunction, in which you update the other connection so it doesn't break while the code is delay()-ing. Also you should avoid the normal connect() function and instead use attemptConnect() so you can avoid the other connection breaking while one is waiting after a failed attempt.

I will try to write such an example for two adapters when I have the time.

from klinekwp1281lib.

emtepe35 avatar emtepe35 commented on June 12, 2024

from klinekwp1281lib.

domnulvlad avatar domnulvlad commented on June 12, 2024

Ok. So for the future, the most reliable way to get your door data to update quickly is to isolate the CCM's K-line and use a separate adapter. Then of course you won't be able to diagnose the CCM with VCDS, you could maybe add a hidden switch that reconnects it to the K-line bus if you want.

from klinekwp1281lib.

domnulvlad avatar domnulvlad commented on June 12, 2024

Hi again, @emtepe35. If you are still interested in this, I have written up a little page about your issue here with a bit more explanations. The conclusion is the same, there is no way to do what you wish to do without having to modify something, but if you are ok with modifications, then the solution is simple enough.

from klinekwp1281lib.

domnulvlad avatar domnulvlad commented on June 12, 2024

I have updated that wiki page. I had completely overlooked the multitasking capabilities of the ESP32, which would be the best solution to your problem. No need for any additional microcontrollers.

from klinekwp1281lib.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.