stanleyhuangyc / ArduinoOBD

OBD-II library and sketches for Arduino
http://freematics.com
973 stars 518 forks source link

Reading RPM Via UART Not Working #12

Closed azzamsaziz closed 9 years ago

azzamsaziz commented 10 years ago

Already sent an email about this. Plugged the UART wire into my Arduino Uno, nothing worked. I tried a different UART wire, nothing worked. Then I plugged in the 4884 LCD Screen with both UART wires. One didn't work, the other worked but it couldn't read RPMs. It did the same thing when it was just the Arduino by itself.

What's going on?

azzamsaziz commented 10 years ago

Also, my I2C works with the MegaLogger. It's just the UART that isn't working. I had to buy the I2C because the UART wouldn't work and now it seems like a code problem...

stanleyhuangyc commented 10 years ago
Make sure you are not using serial UART
  in your sketch. Or you can use an Arduino MEGA which has multiple
  hardware UART.
  On 3/07/2014 9:58 AM, Azzam Aziz wrote:

  Already sent an email about this. Plugged the UART wire into my
    Arduino Uno, nothing worked. I tried a different UART wire,
    nothing worked. Then I plugged in the 4884 LCD Screen with both
    UART wires. One didn't work, the other worked but it couldn't
    read RPMs. It did the same thing when it was just the Arduino by
    itself.
  What's going on?
  —
    Reply to this email directly or view
      it on GitHub.
azzamsaziz commented 10 years ago

You mean the Mega Logger? I already used that. That works. The Adapter that I have worked before perfectly fine but with the newer code it doesn't work anymore. I'm unsure by what you mean in serial UART but I followed this. It worked before but not anymore.

http://arduinodev.com/store/index.php?route=product/product&path=20&product_id=30

azzamsaziz commented 10 years ago

Well? I still have an issue?

azzamsaziz commented 10 years ago

Is this fixed?

azzamsaziz commented 10 years ago

https://drive.google.com/file/d/0B2lv8DOmk6rMd3lHSUE2Vjl5N2M/edit?usp=sharing

azzamsaziz commented 10 years ago

Okay I tried again. The code is from your sample so it can't be wrong. I tried with both of the UART wires you've provided me. First one finds connection to OBD but can't read RPM so it just sits there saying Waiting ECU Start.

The second one is a no go.

The first one has white, teal, blue and yellow. The second one has white and yellow.

I've put them in all kind of different ways and I still get no connection. When I put the first one only in yellow it connects to OBD but can't read RPM. What's going on?

novaspirit commented 10 years ago

stanleyhuangyc commented on Jul 2 Make sure you are not using serial UART in your sketch. Or you can use an Arduino MEGA which has multiple hardware UART.

can you explain this alittle more? i'm using nano and i don't know where i should be looking to make sure i'm not using serial.

but i do know that when nano checks for the obd device it finds it, and proceeds to the next screen then goes into "reconnecting" and that's about it. doesn't seem to get my car data (2004 subaru wrx).

azzamsaziz commented 10 years ago

Welcome to the club novaspirit. I have no idea what he meant by that either.

Both of our cars (Mine 2011 Nissan Altima SR) and yours (2004 Subaru WRX) are compatible with OBD-2 so it isn't from our end. The wiring in mine is connected right because I've had it working before. If it isn't the code, it HAS to be the wire.

Good luck buddy. Good luck. That's all I can say.

novaspirit commented 10 years ago

i'll dig into more while i wait for a response. i'll let you know what i come up with. now you say yours used to work before the update. what shield are you using? maybe i can help you and see what was commited before the break in code for you

novaspirit commented 10 years ago

update: so this code works perfectly on my 2013 mazda cx5, then when i plug it into my 2004 wrx. it wont read it. just to confirm my obd works i have a bluetooth dongle that i use on the wrx currently so it's not the obd port.

novaspirit commented 10 years ago

@stanleyhuangyc if it makes a difference i found that the data port for a 2004 wrx is on PIN 10 http://ken-gilbert.com/wrx/STi_Manual/02.%20ENGINE%20SECTION%20(STi)/11.%20ENGINE%20(DIAGNOSTICS)/07.%20Data%20Link%20Connector.pdf
that might be why it wont read the car's data

azzamsaziz commented 9 years ago

Hey sorry, I've been busy.

I have the Arduino Uno with the DFRobot LCD4884 Shield and OBD-2 with UART and Accelerometer and Gyro.

The layout of the OBD-2 Input.Output doesn't matter. I know that because the kit I have used to work and now all of a sudden it doesn't with either of my two UART wires. I used two different Unos, two different LCD Chips, two different OBD-2 wires and still nothing. From what I think happened since yours isn't working either is that his code is not working properly anymore. Something is broken and certain cars won't work anymore. I will try this on our 2011 Nissan Rogue and 2008 Chrysler Town & Country and report back.

Regardless, it should work and it is the code that is failing because it used to work perfectly fine before. I also have the Kit-2 that uses the I2C and it works well. It refused to work with UART but works with I2C just fine. Seems like something is wrong with UART.

As for getting him to respond, I hope you can man. I hope you can. He only gave in one response here and after millions of messages and proof that my wires aren't working I finally got a reply to resend the wire for replacement. This kind of crap makes you hate open source. Wasted so much money into this and I just want to learn but no support what so ever. Ridiculous and incompetent.

stanleyhuangyc commented 9 years ago
The UART version does not have
  accelerometer or gyro. Are you sure about what you are using?
  Stanley
  On 2014/9/11 22:11, Azzam Aziz wrote:

  Hey sorry, I've been busy.
  I have the Arduino Uno with the DFRobot LCD4884 Shield and
    OBD-2 with UART and Accelerometer and Gyro.
  The layout of the OBD-2 Input.Output doesn't matter. I know
    that because the kit I have used to work and now all of a sudden
    it doesn't with either of my two UART wires. I used two
    different Unos, two different LCD Chips, two different OBD-2
    wires and still nothing. From what I think happened since yours
    isn't working either is that his code is not working properly
    anymore. Something is broken and certain cars won't work
    anymore. I will try this on our 2011 Nissan Rogue and 2008
    Chrysler Town & Country and report back.
  Regardless, it should work and it is the code that is failing
    because it used to work perfectly fine before. I also have the
    Kit-2 that uses the I2C and it works well. It refused to work
    with UART but works with I2C just fine. Seems like something is
    wrong with UART.
  As for getting him to respond, I hope you can man. I hope you
    can. He only gave in one response here and after millions of
    messages and proof that my wires aren't working I finally got a
    reply to resend the wire for replacement. This kind of crap
    makes you hate open source. Wasted so much money into this and I
    just want to learn but no support what so ever. Ridiculous and
    incompetent.
  —
    Reply to this email directly or view
      it on GitHub.
azzamsaziz commented 9 years ago

%1000 sure. UART and it contains both Accelerometer + Gyro. I bought it long ago. This is the first OBD-2 Adapter you made.

http://i.imgur.com/sfHy0Ld.jpg

Even if I'm wrong, I also bought the new version

http://i.imgur.com/SSF9vfN.jpg

I already posted these pics on your forums. Now I have 3 Adapters lol.

stanleyhuangyc commented 9 years ago
Acc and gyro are provided by separated
  MPU6050 module. So they have nothing to do with OBD. The OBD
  library works with both UART and I2C adapter. Make sure to define
  the correct instance, that's, COBD for UART adapter and COBDI2C
  for I2C adapter.
  Stanley
  On 2014/9/11 23:12, Azzam Aziz wrote:

  %1000 sure. UART and it contains both Accelerometer + Gyro. I
    bought it long ago. This is the first OBD-2 Adapter you made.
  http://i.imgur.com/sfHy0Ld.jpg
  Even if I'm wrong, I also bought the new version
  http://i.imgur.com/SSF9vfN.jpg
  I already posted these pics on your forums. Now I have 3
    Adapters lol.
  —
    Reply to this email directly or view
      it on GitHub.
azzamsaziz commented 9 years ago

No one but you said the Acc/Gyro has anything to do with the OBD. I was just pointing out that was the adapter version that I had, they have nothing to do with the OBD connection.

Your code for the dashboard_4884 which is the one I was talking about does not have any support for I2C, only UART and that is what I was using. There is no way to get it wrong. There is no configuration to change. Please try to at the very least read up and understand what the problem is before throwing random answers. We've tried all of that.

If you are talking about the MegaLogger, I've tried both UART and I2C. Only I2C worked. I changed config and everything, no luck with UART. But for now, I want the 4884 example to work and it doesn't. UART is not working at all.

stanleyhuangyc commented 9 years ago
The dashboard_4884 sketch is no longer
  maintained. But you can modify it easily to let it use I2C
  version.
  The MegaLogger sketch requires you to connect UART to Serial1. Did
  you do that?
  On 2014/9/12 12:14, Azzam Aziz wrote:

  No one but you said the Acc/Gyro has anything to do with the
    OBD. I was just pointing out that was the adapter version that I
    had, they have nothing to do with the OBD connection.
  Your code for the dashboard_4884 which is the one I was talking
    about does not have any support for I2C, only UART and that is
    what I was using. There is no way to get it wrong. There is no
    configuration to change. Please try to at the very least read up
    and understand what the problem is before throwing random
    answers. We've tried all of that.
  If you are talking about the MegaLogger, I've tried both UART
    and I2C. Only I2C worked. I changed config and everything, no
    luck with UART. But for now, I want the 4884 example to work and
    it doesn't. UART is not working at all.
  —
    Reply to this email directly or view
      it on GitHub.
azzamsaziz commented 9 years ago

You could've told me that like months ago.

I could. But I don't want it to use I2C. I am using my I2C wire for something else. I want it to use the UART cables that I have. Plus, I don't think the Arduino can use I2C anyway.

I will do that with the MegaLogger later. For now it is working with I2C and I am happy with it. It's the 4884 that isn't working at all.

stanleyhuangyc commented 9 years ago

How did you come to the idea that Arduino can't do I2C?

On Sep 13, 2014, at 1:04 AM, Azzam Aziz notifications@github.com wrote:

You could've told me that like months ago.

I could. But I don't want it to use I2C. I am using my I2C wire for something else. I want it to use the UART cables that I have. Plus, I don't think the Arduino can use I2C anyway.

I will do that with the MegaLogger later. For now it is working with I2C and I am happy with it. It's the 4884 that isn't working at all.

— Reply to this email directly or view it on GitHub.

azzamsaziz commented 9 years ago

I assumed.

That's not the point. The point is that I, or both, have UART adapters that we got from you that we used on the 4884 example or something else and it is not working.

stanleyhuangyc commented 9 years ago
I said 4884 example is no longer
  maintained. It will be removed from the repository soon. Please
  use MegaLogger, UnoLogger or NanoLogger instead.
  On 2014/9/13 11:50, Azzam Aziz wrote:

  I assumed.
  That's not the point. The point is that I, or both, have UART
    adapters that we got from you that we used on the 4884 example
    or something else and it is not working.
  —
    Reply to this email directly or view
      it on GitHub.
azzamsaziz commented 9 years ago

Nevermind the 4884. I tried just using the OBD-2 example that blinks an LED when it hits 3,000 RPM. I changed RPM to 500 too and nothing. It absolutely does not work with UART no matter what I've tried. UART has an issue.

stanleyhuangyc commented 9 years ago
UART has no issue. You are not the only
  user. Hundreds of units have been shipped.
  On 2014/9/13 14:42, Azzam Aziz wrote:

  Nevermind the 4884. I tried just using the OBD-2 example that
    blinks an LED when it hits 3,000 RPM. I changed RPM to 500 too
    and nothing. It absolutely does not work with UART no matter
    what I've tried. UART has an issue. 
  —
    Reply to this email directly or view
      it on GitHub.
azzamsaziz commented 9 years ago

It used to work and now it doesn't. I thought it was the old wire being broken so I got a brand new one and it doesn't work either. Your code, your wires. What are you telling me here? It can't be the car because it used to work with the same exact code and same exact wire. It can't be the code because you yourself said it has no issues. Both adapters are all of a sudden broken?

This makes absolutely no sense what so ever and I am not the only user to have issues either. This guy up here us also seeing issues. I personally think something in the code changed that I don't understand. But that's just my thought. Give me your solution.

stanleyhuangyc commented 9 years ago

I don't know how you connect the adapter, whether it's due to wrong wiring, as you said kit works but adapter does not work with your Arduino.

azzamsaziz commented 9 years ago

You saw my wiring. I posted it up on your forum and you responded. Wiring is done correctly.

The Kit-2 works only with I2C. Last time I tried UART it didn't work. But that's not what I care about fight now.

I want the Arduino to work with UART. It used to work with the same adapter and same code. Now, all of a sudden, it doesn't anymore. It connects, but can't read RPM. It just gets stuck saying waiting for ECU. Look at the pictures in the forums.

azzamsaziz commented 9 years ago

What're we doing now?

azzamsaziz commented 9 years ago

novaspirit did you find a solution?

Stanley I've rolled back in your code to at least 9 months ago and compiled again. The same issue occurs. It runs, it detects OBD-2 but it just sits there saying "Waiting for ECU" because it can't read the RPM. All from UART.

NCWolfpack commented 9 years ago

I'm not sure if my issue is related, but I purchased the UART adapter and ran the RPM program. It did NOT work in my 2008 Acura TL Type S, however, it DID work in my neighbors 2005 Mazda3 and my roommates 2010-ish Scion tC. I'm just getting into this now, so I'm not sure if my car uses the UART or I2C protocol. Is there any specific place I can get this information, or any way I can check?

azzamsaziz commented 9 years ago

It is most likely related. The UART used to work on my car then all of a sudden after I updated the code it stopped working. When we mention the RPM program, he says it is not supported. Then why is it even on there? UART is supported and the parts are being sold for it.

I tried putting an I2C adapter and changed the code to use I2C. It still did not work. The I2C works with Kit 2 but it did not work with the 4884 example for that monitor.

All I want is to get my project working and I've been stuck here for months with absolutely no support and hundreds of dollars worth of items that are just sitting there. Join the club. If you find the answer, please let me know.

urun4fun commented 9 years ago

I think I have exactly the same problem. Posted a new thread before i saw this one.

Maybe I have done something different, but it does not work anymore with my Uart adapter.

Worked before, but now it does not.

Same adapter, same car, same IDE, identcal arduino.

Do you have an idea, what it could be?

azzamsaziz commented 9 years ago

Yeah same issue. I tried it on 3 cars, same adapter, same IDE. All his code. I tried EVERYTHING and I posted on his site as well.

I know what it is. It's the result of an incompetent open source developer. I spent hard earned money to buy this stuff and tinker with it and now I can't and he won't fix it. If I had the knowledge to fix it I would. I do know programming but I can't tinker with the underneath of the OBD-2 stuff.

Good luck. I'm trying my best to fix it still. Been going on for months.

@stanleyhuangyc 4 people now have this issue.

azzamsaziz commented 9 years ago

@novaspirit @NCWolfpack @urun4fun

I did investigate into this issue furthermore and did open my adapter and checked every wire for connection. All wires work properly, they have a connection. Nothing is broken. I did go roll back in history from the GIT and tried every combination but was not able to get it to work. I tried the latest and as usual it connects but can NOT get the RPM. It seems that the pull request to the CAN-BUS system has changed and it does not work.

@stanleyhuangyc claims that this piece of code is not supported even though it is being sold on his site. I will try using the I2C again and see if it works. My Mega worked but I fear updating it as it might stop working too along with this.

azzamsaziz commented 9 years ago

I found a solution. Finally. The UART adapter is no longer supported by @stanleyhuangyc it seems so you can go ahead and throw your adapter and money in the trash or wait until I debug his code and see what's wrong.

The good news is it works with I2C. What you'll need is to connect the YELLOW to A4 (SDA) and WHITE to A5 (SCL) because I2C does NOT use TX and RX, it uses SDA and SCL. Something he fails to explain at a very low level.

Once you do that, you can continue to work on your project.