-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I just discovered that I "reinvented" the wheel #15
Comments
Hi!
Yeah, it was merged last summer, so after you started work on your library. I also think the name of this library may not make it immediately clear that it also support KWP :) Maybe it is feature creep..? 🤔
Hmm, you seem to send:
Whereas my init sequence sends:
The
The initial work I did on the init function was a blind implementation, (I don't remember what I based it on, probably some quick googling), in 6622e8e and #5, someone requested it, but I never heard back. Finally in #11, a collaboration paid off and with some back and forth we managed to get it to work. Take a read through #11 , there's some information in there that was used to get it to work. I've never owned a vehicle that used KWP, so that thread is all the information I have used. The original development of this library was done by looking at the 9141-2 communication from cheap bluetooth OBD dongle, the logic analyzer traces are in this repo as well.
Always happy to hear something like that. Yeah, I also really like the timing in my library, it's almost always as fast as it can be, without having to tune any values. So definitely take the concept of using |
@aster94 Does your library work with KWP Fast Protocol ? |
True! tecnically (in KWP) it should be between hex 10 and 17 the other values are reserved but I think you are right it "can be anything"
They are there because at the beginning I had a lot of troubble to make it working 😂
thanks! If you want i have a few documentations about the KWP, I think that i have an old version of this document that cost around 140€! I found it on google but i didn't add in my repo because i wasn't sure if i was allowed to pubblic it 😅
Really i was also thinking to join the efforts and make a unique library that under the hood uses some basic functions like I already abstracted my library, for example with a general function BUT my lib is only tested on suzuki motorbikes! I never had the possibility to test on other even if the basic methods would be the same and only the PIDs should be changed |
hi @zakirsheik I was writing while you posted your comment, i implemented only the fast init, but be aware that, as i wrote in the last comment, you would need to discover some pids that are specific for your vehicle (what is it by the way?) this is the real problem of KWP every manufacter made what they wanted! have a look here so for example in my suzuki motorbike i can get the rpm asking to the ECU 0x71 while on a honda motorbike i would need to ask 0x90 (not real values) But even before starting all this if i were you i would start by checking with the logic analyzer how your chip manages the baud at 10400, for example using the esp32 with the arduino framework i found that the problem was outside my library espressif/arduino-esp32#2004 |
I'm pretty sure their legal team will go after you if you make it public or share it. I thought ISO norms were bound to a person or organisation on purchase and non transferable. So I'd stay clear or distributing it.
I expect there's already libraries out there to do OBD with a CAN bus. I'm not too interested in doing more development on reading from OBD ports myself. This library in its current form is well tested, mature and simple to understand. It's MIT license, so feel free to fork it, or reuse parts, as long as you adhere to the license everything is fair game.
Ah, you used I do believe simple and small libraries are preferable, because changing them is doable even if you haven't build them yourself. Same with one or multiple protocols, I'll pick the single protocol one, simply because the additional protocols will only take up more memory or add layers of abstraction which are unnecessary in my use case. My projects target just one vehicle (the one that's mine). Now, I'm not saying one is better than the other, it's just different design goals and personal preferences. If you do end up building something generic, the folks at https://www.macchina.cc/ may be interested in hearing about it, their hardware supports multiple physical buses. I think they point to my library for 9141-2.
That's pretty bad, good to know that custom baud rates may be problematic! That's not something you expect to fail. |
yeah that is true, yesterday i had this idea but i also understand pretty well all the limitation and cons that it has. Mainly i like the idea because i am a fan of standardized API 😅
exactly, but to make the library more user friendly i may switch to normal
I lost 4 days for this reason, I also already drawed a pcb with esp32 (luckly i didn't make it) then i had to completely change architecture 😢 as you said i didn't expect it to fail. The sad part was that none from the esp32 developers looked into the problem because "no one needs custom baud rates" |
Hi |
Yes it does, I think... I only implemented KWP fast init, I don't know what the slow init would look like.
The Arduino IDE isn't the greatest when it comes to this, it keeps a copy of the library in a temp folder. I don't know where this resides on windows, on linux it's somewhere in Having debug enabled should give different output. Not sure if the marine engine would have a different handshake though... I don't know anything about those :) |
Thanks for your advice Ivor. Presumably (if I can learn the finer details of coding) I could do a bit of cutting and pasting and combine the KWP fast init handshake into the 5 baud slow init sketch or vice versa. |
Nope, for now I will just focus only on KWP2000, after suzuki now i am working on the kawasaki side! my library is compatible with all the architectures so if your boards are compatible with arduino they would work without problems 🙂 |
Hi Ivor,
I had a GSX-R 600 2011, which uses the K-line. Almost a year ago i started writing some code to comunicate with the ECU, probably i didn't found your library because you implemented the KWP recently. Anyway I see a few differences between your init sequence and mine (especially with the init message, the sequence is almost the same)
Could i ask you were did you found the resources to write them?
I am writing also because I am sure i will take some idea from your code, i really like your management of the delay 😃
here it is my library if you would like to have a look: https://github.com/aster94/Keyword-Protocol-2000
The text was updated successfully, but these errors were encountered: