Active Topics

 



Notices


Reply
Thread Tools
Posts: 11 | Thanked: 13 times | Joined on Feb 2012
#131
Originally Posted by GizmoXomziG View Post
Please run pyobd from shell and click "get DTC" a few times, then exit pyobd and tell us what the app printed out. I don't have any DTCs so unfortunately I can't test it out. Perhaps you have more than 2 DTCs - which could complicate things:
Hi,
First of all, I only have one DTC P0135, and that has been tested with "proper" diagnostic software with my bluetooth ELM327..

Here is my trace:
Code:
get_dtc
Send: 0101
data: 41 01 81 07 61 21
Number of stored DTC:1 MIL: 1
Send: 03
>?C result:
Send: 07
DTC freeze result:47 00 00 00 00 00 00
Value : No DTC codes or codes cleared
get_dtc
Send: 0101
data: 41 01 81 07 61 21
Number of stored DTC:1 MIL: 1
Send: 03
DTC result:43 01 35 00 00 00 00
Send: 07
DTC freeze result:47 00 00 00 00 00 00
Value : P0309 Active Cylinder 9 Misfire Detected
get_dtc
Send: 0101
data: 41 01 81 07 61 21
Number of stored DTC:1 MIL: 1
Send: 03
DTC result:43 01 35 00 00 00 00
Send: 07
DTC freeze result:47 00 00 00 00 00 00
Value : P0309 Active Cylinder 9 Misfire Detected
get_dtc
Send: 0101
data: 41 01 81 07 61 21
Number of stored DTC:1 MIL: 1
Send: 03
DTC result:43 01 35 00 00 00 00
Send: 07
DTC freeze result:47 00 00 00 00 00 00
Value : P0309 Active Cylinder 9 Misfire Detected
get_dtc
Send: 0101
data: 41 01 81 07 61 21
Number of stored DTC:1 MIL: 1
Send: 03
>43 01 35 00 00 00 00
Send: 07
DTC freeze result:47 00 00 00 00 00 00
Value : P0769 Active Shift Solenoid 'D' Intermittent
Value : P01280 Active ? UNKNOWN
stop
There seems to be something wrong with the reply and/or reply interpretation. As you can see, first pyobd says that there is no active code, then it says I have P0309 few times and finally there seems to be two DTCs. Any idea to test etc?

//Wictor
 
Posts: 543 | Thanked: 151 times | Joined on Feb 2010 @ Germany
#132
I tried the latest version with my Mercedes W203 today and had sadly only partial success. Other OBD applications (Android) work generally without problems. I'm using a normal ELM327 adapter.

Log (Trace):
1 Application started
1 Opening Interface (serial port)
1 Interfaces successfully /dev/rfcomm() opened
1 Connecting to ECU...
3 Send command:atz
Any idea why nothing happens after "Send command:atz"?
 
Posts: 6 | Thanked: 17 times | Joined on Aug 2012 @ Ljubljana
#133
Originally Posted by wictor View Post
Hi,
First of all, I only have one DTC P0135, and that has been tested with "proper" diagnostic software with my bluetooth ELM327..
That verified info is very useful information.

Originally Posted by wictor View Post
Code:
Send: 0101
data: 41 01 81 07 61 21
Number of stored DTC:1 MIL: 1
Send: 03
DTC result:43 01 35 00 00 00 00
Send: 07
DTC freeze result:47 00 00 00 00 00 00
Value : P0309 Active Cylinder 9 Misfire Detected
Obviously PyOBD is calculating/decoding DTCs the wrong way. Checking by hand, DTC result from the car (01 35) is exactly P0135 (according to OBD2 PIDs Wiki - Mode 3).

At first glance in the code it seems to me that obd_io::decrypt_dtc_code does things the right way, but is not used anywhere in the code. Instead, obd_io::get_dtc is taking the wrong chunks (3+3 bits at a time, instead of 2+2+4+8 bits) for decoding codes.

I get my car back on saturday, so until then, I won't be much help about this. Perhaps @m750 will have the time to look into this.


Originally Posted by Crogge View Post
I tried the latest version with my Mercedes W203 today and had sadly only partial success. Other OBD applications (Android) work generally without problems. I'm using a normal ELM327 adapter.

Any idea why nothing happens after "Send command:atz"?
Could you check if your phone is connected to the right BT device? Before selecting "Connect to ECU", what device is listed at "BT dev" on the bottom of the Status page? It should be "ELM327" rather than "Andy's iPhone".



Calculating gears seems very easy and reliable (in higher gears at least). I used ROUND(Speed/RPM*160) for calculation. When shifting gears / holding the clutch, gear is higher (unfortunately I do not have 6th gear)
 

The Following 4 Users Say Thank You to GizmoXomziG For This Useful Post:
m750's Avatar
Posts: 249 | Thanked: 345 times | Joined on Aug 2010 @ Italy
#134
Hi,
i'm not the owner of the original source code of pyOBD, I have only adapted and enhanced pyOBD for N900.
I will check the code, but I need some time.
__________________
maxcpu : change cpu's clock with a TAP!
savecpu : overheating control for overclocked n900.
shaketowake2 : Enable/Disable wake up/rest by shaking.
tilt2control : control mediaplayer by tilting your n900.
gpstracker-c : easy handle your gpstracker tk102.
pyOBD for maemo (OBD-II cars diagnostic)
 

The Following User Says Thank You to m750 For This Useful Post:
m750's Avatar
Posts: 249 | Thanked: 345 times | Joined on Aug 2010 @ Italy
#135
A question:
(P) 0135 -> 135 is a decimal number

135 converted in hex is 87

(43) 01 35 -> 135 is expresset in hex, converted in decimal: 309

Or not?
__________________
maxcpu : change cpu's clock with a TAP!
savecpu : overheating control for overclocked n900.
shaketowake2 : Enable/Disable wake up/rest by shaking.
tilt2control : control mediaplayer by tilting your n900.
gpstracker-c : easy handle your gpstracker tk102.
pyOBD for maemo (OBD-II cars diagnostic)
 
Posts: 11 | Thanked: 13 times | Joined on Feb 2012
#136
Hi,

I have modified obd_io.py so that it decodes DTC codes. get_dtc function is modified to use decrypt_dtc_code. decrypt_dtc_code is modified so that it only takes one code as parameter and decrypts 5 digit DTC code from raw string. I also modified get_result function to suit better for my needs.
It seems that timing is very critical in get_response function. There is no timeout handling in pyobd in case there's no response from OBD module.
Here is the obd_io file, if someone wants to test.

// wictor

Last edited by wictor; 2012-08-30 at 05:35.
 

The Following 2 Users Say Thank You to wictor For This Useful Post:
Posts: 6 | Thanked: 17 times | Joined on Aug 2012 @ Ljubljana
#137
Originally Posted by m750 View Post
A question:
(P) 0135 -> 135 is a decimal number

135 converted in hex is 87

(43) 01 35 -> 135 is expresset in hex, converted in decimal: 309

Or not?
It seems DTCs are already expressed in decimal format, so 01 35 is 0135. I guess DTCs with A-F in them are not valid (but are indeed possible).
 

The Following 2 Users Say Thank You to GizmoXomziG For This Useful Post:
Posts: 11 | Thanked: 13 times | Joined on Feb 2012
#138
Originally Posted by m750 View Post
A question:
(P) 0135 -> 135 is a decimal number

135 converted in hex is 87

(43) 01 35 -> 135 is expresset in hex, converted in decimal: 309

Or not?
So according wiki page http://en.wikipedia.org/wiki/OBD-II_PIDs, 43 is the reply identifier for dtc request. Every DTC is represented with 16 bits.

reply string = 43 01 35
DTC part of the string = 01 35
DTC in bits = 0000 0001 0011 0101
Two first bits(red) define first DTC character, so that
00=P
01=C
10=B
11=U
Next two bits(blue) define second DTC character so that
00=0
01=1
10=2
11=3
Next four bits(green) define third DTC character. In this case 0001=1.
Next four bits(cyan) define fourth DTC character. In this case 0011=3.
Last four bits(black) define fifth DTC character. In this case 0101=5.

The resulting DTC is P0135.

I hope this helped a bit
//Wictor
 

The Following 5 Users Say Thank You to wictor For This Useful Post:
Posts: 543 | Thanked: 151 times | Joined on Feb 2010 @ Germany
#139
Originally Posted by GizmoXomziG View Post
...

Could you check if your phone is connected to the right BT device? Before selecting "Connect to ECU", what device is listed at "BT dev" on the bottom of the Status page? It should be "ELM327" rather than "Andy's iPhone".


...
Sure it is the correct device, as I said I'm using this combination for other ODBII apps without problems and it works also fine with my tablet.
 
Posts: 11 | Thanked: 13 times | Joined on Feb 2012
#140
Originally Posted by Crogge View Post
I tried the latest version with my Mercedes W203 today and had sadly only partial success. Other OBD applications (Android) work generally without problems. I'm using a normal ELM327 adapter.

Log (Trace):


Any idea why nothing happens after "Send command:atz"?
Pyobd seems to be quite picky about delays between command and reply. One thing that you could try is to modify delay after atz command.

If you know how to edit pyobd python files, you can try to increase delay after sending "atz" command in /home/opt/pyobd/obd_io.py.
You can try different values in time.sleep() to see if that helps.
Code:
while 1: #until error is returned try to connect
  try:
    self.send_command("atz")   # initialize
    time.sleep(0.2) # try here 0.5 for example
wictor

Last edited by wictor; 2012-08-30 at 05:31.
 

The Following User Says Thank You to wictor For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 11:01.