Closed Heiner1967 closed 10 months ago
Okay! I think there is a little missunderstanding about the Sniffer. It´s intention was to read the bluetooth commands, which an ELM327 App/or compatible device would usually send. That was my startingpoint to figure out, which PID´s I have to convert from "Kawasaki" to "OBD". So basically it´s the other way around,. But changing it should not be big deal. You just have to send the signal from the hardware serial to the software serial:
void setup() {
// initialize both serial ports:
Serial.begin(9600);
Serial1.begin(9600);
}
void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
Serial1.write(inByte);
}
}
Arduino ID -> Examples -> 04 Communication -> MultiSerial This example was made for an Arduino Mega with two hardware serials. Just change Serial1 to the Softwareserial.
RX / TX is exactly like you understood. But some manufacturers were clever enough, to lable what you should connect to. In that case it´s not twisted.
To use
SoftwareSerial bluetooth(8, 7);
Connect HC06 RX to D7 and TX to D8.
The L9637D must be connected RX to RX and TX to TX.
With that setup, you can listen to what´s happening on the line now. Identifying which sender and receiver is important for you and which data will activate/deactivate you fan and stuff. It should be possible to directly send messages into that connection.
PS: I´ve also seen your answer on the other Issue.
Hi, ok I can report some progress, I add a resistor towards HC-06 RX and another one toward grownd to reduce teh Voltage on RX of HC-06 to about 3.3V. The HC06_Sniffer I get to work, so I see how the ELM 327 SW talk and what it believes by Car should respond to.
So far so good and it shows the comms work. /based on ECU-Reader I get ELM to connect but now Feedback from ECU, neither any chance to see what is going on.
Here I hoped for the sniffer modul to help out but have no clue how this would work. I miss in the ECU-Reader to see a kind of Log, I only have the Feedback from the ELM327 SW talking to Bluettoth and need it to give the right requests via Bluettogh to the car.
I would like to try your code above which makes sence, but need first to initislise, I would doubt that without anything that there is any communication from K-Line.
I guess I need now based on the Log from HC-06 Sniffer to add those commands into Code to see where and when it stops functioning.....
I hope that makes sense, hmmmm more complex then expected.....
Have you thought about the arduino library for Torque Pro. It allows you to assign custom PIDs to drive gauges on the Torque dashboard and log them. I have it on my radar for when I get round to building a custom dash for one of my streetfighter builds.
On Thu, 18 Feb 2021 at 18:28, Heiner notifications@github.com wrote:
Hi, ok I can report some progress, I add a resistor towards HC-06 RX and another one toward grownd to reduce teh Voltage on RX of HC-06 to about 3.3V. The HC06_Sniffer I get to work, so I see how the ELM 327 SW talk and what it believes by Car should respond to.
So far so good and it shows the comms work. /based on ECU-Reader I get ELM to connect but now Feedback from ECU, neither any chance to see what is going on.
Here I hoped for the sniffer modul to help out but have no clue how this would work. I miss in the ECU-Reader to see a kind of Log, I only have the Feedback from the ELM327 SW talking to Bluettoth and need it to give the right requests via Bluettogh to the car.
I would like to try your code above which makes sence, but need first to initislise, I would doubt that without anything that there is any communication from K-Line.
I guess I need now based on the Log from HC-06 Sniffer to add those commands into Code to see where and when it stops functioning.....
I hope that makes sense, hmmmm more complex then expected.....
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HerrRiebmann/KDS2Bluetooth/issues/3#issuecomment-781547929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE5DW52BZK2ZRQBNF22F653S7VL6HANCNFSM4XPIXWNA .
Hi, ok I can report some progress, I add a resistor towards HC-06 RX and another one toward grownd to reduce teh Voltage on RX of HC-06 to about 3.3V. The HC06_Sniffer I get to work, so I see how the ELM 327 SW talk and what it believes by Car should respond to.
That is good news :)
Here I hoped for the sniffer modul to help out but have no clue how this would work. I miss in the ECU-Reader to see a kind of Log, I only have the Feedback from the ELM327 SW talking to Bluettoth and need it to give the right requests via Bluettogh to the car.
Like I´ve said, the intention from that sniffer was to see what´s up on the Bluetooth OBD-side. So there is not much you can reuse from that.
I guess I need now based on the Log from HC-06 Sniffer to add those commands into Code to see where and when it stops functioning.....
Hmm, I see two possibilities:
- Take the code from above and "sniff" whats going on between two working devices. Send the data via Bluetooth to a Phone or PC
- Digg in the deep and take parts from "ECU Reader", like initialization sequence, checksum calculation, read and send functionality.
The second approach would presume knowledge about sender and receiver address. A possible initialization message and then the data messages themself. If there would be any documentation, great. If not, there is not other possibility to skip approach no. 1.
However you will go on, you cannot just copy some code from here and make it work. It indeed will require some coding and try ´n error.
Have you thought about the arduino library for Torque Pro. It allows you to assign custom PIDs to drive gauges on the Torque dashboard and log them. I have it on my radar for when I get round to building a custom dash for one of my streetfighter builds.
This would be a nice feature for data, which is not supported by OBD2. Like gear, which I cheated into engine load. But I wanted to support as much ELM327 or OBD2 compatible devices as possible. So I stayed on the supported values. And the most important thing for me was my Garmin Virb, which records videos and those data.
This version of my solution is aged quite well ;-) I currently have a newer version, which supports Kawasaki and Suzuki. And maybe in the future it will support Honda. It´s possible to enable some kind of a "raw-mode". With that, you can use f.e. RaceChrono and calculate the data inside the application. For Torque it would be a lot of work to add all those values with id´s, type and values. From my perspective a different project :-)
Nice to know that this exists. And where some requests might come from, which I could not identify in the past. Because I was only listening to "AT"-commands and expected anything else to be a hexadecimal value... Thanks :D
This is the forum for Torque pro. I am only posting it as it is a mine of information for can bus and setting up custom pids and so on. https://torque-bhp.com/forums/?wpforumaction=viewforum&f=1.0
@Heiner1967 - I am also working with a Porsche 996 that is being converted to electric (mine is a 2003 Carrera 4S) and am attempting to communicate with the various control units to keep the car operating fully with the electric motor/controller. Some communication is on CAN bus, but I am also trying to reed, decipher and communicate with the K-line transmissions. Have you made any progress with the Porsche K-line? Do you have any advice or direction that you can share?
Thanks Brian
Hi @bc996, no unfortuniatly I came no step further. I assume as many Controllers are removed in my car that this cause the nofunction of K-Line at all. However my aim was to read from the Climatronic to get heating, AC and fan switched better fro the electric use, now i discovered there is a serial port, which might do the trick ( I still need to check but have no time in the moment) My Electric engine controller feeds via serial connection a little display showing rotating values of various temperatures of the controller and engine. Thoe I read via Arduino nano and send a correspnding analog signal to my analog instruments. The old watertemp is now engine Temp, the original Oilpreassure is now controller temp divided by 10 ( value 0-5 represent 0-50 degree celsius.
Thanks @Heiner1967 - sorry to hear that you were not able to get further with the K Line. I'm not sure what year your 996 is, but the mark 2's (996.2 - from 2002+) have the climatronic on a CAN bus. That might be easier than K line anyway
Nice to read from you two guys :) For newer motorbikes I´ve created some kind of sniffer, based on an ESP32. It writes anything from K-Line and/or CAN-Bus onto a SD card. Similar schematic with the L9637D, connected to Rx2 & Tx2 and a CAN-Shield (MCP2515). Maybe it would help to also create one of these and just see what´s happening on the wire(s).
From my point of view, that´s the most important part, to record some data. Before everything is torn apart ;)
Hi,
first of all many thanks to your great work. I have a similar but different problem around K-Line and KWP2000. In my case I have a old Porsche 996 converted into an electric car, and I like to read some K-Line information of the Klimacontroller to adjust its operation. Due to the conversion some ECU are simply not their anymore as there is no engine anymore ...only a new electric one. I found out Porsche at the time works with K-Line and KWP2000. Basically I need now to find out the rest like you did for your bike.
I installed the ECU Reader but nothing arrieves at the Bluetooth Device - it would have been to easy I assume.
I get somehow the Code of ECU-Reader but have here a basic question, typically RX TX from one device should be connected to the opposite TX RX of a second device. Does this principle shall apply for the K-Line Chip as well as for the bluetooth Device? I see it differently in the documents and get confussed.
Then you have the file of K-Line and Sniffer, but I miss them being called from somewhere else, or I miss the definition of the pins whcih are needed nd which I only saw in ECU_Reader - what do i miss here.
In principle I would assume K-Line does the initialisation, then the sniffer would see whats their, only once this is recorded I could adjust ECU Reader with the relevant codes to do it's work. Is this basically right?
Many Thanks for your help on this one
kind regards