Volvo 850 Made from 1993 to 1997, this Volvo line was available in both a wagon and a sedan, both with were graced with several trim levels.

Easily read milage from Motronic 4.3 using ELM327

Thread Tools
 
Search this Thread
 
  #1  
Old 07-06-2015, 03:57 PM
mikeri's Avatar
Junior Member
Thread Starter
Join Date: Jul 2015
Location: Oslo, Norway
Posts: 7
Likes: 0
Received 0 Likes on 0 Posts
Default Easily read milage from 96/97 850 using ELM327

For new readers: Windows exe at http://mikeri.net/files/milageread.zip.

This have been bugging me for quite some time, I have tried a lot of programs but I got none to talk with the Motronic 4.3 ECU via the OBD port to read my milage as I have a broken odometer. I've also read it's not possible to read milage using the home made LED and wire "tool". (My car doesn't have the flash tester under the hood.)

Eventually I stumbled across Richard H. Jones' awesome ELM327 Reads Volvo 850 Mileage
and found some great research, and made a little program to automate the milage reading process.

I've successfully tested it against my '96 850 T5 and it seems to work fine.

I put it on github, it can be downloaded from https://github.com/mikeri/milageread. I also have a small video demonstration at
.

It's a Python program, so it needs Python to run. I could try to make an exe file for Windows users, but it will be somewhat large as it has to include the complete python runtime.

I hope this can be of use to someone.
 

Last edited by mikeri; 06-01-2020 at 06:38 PM. Reason: Updated URL for Windows binary archive
  #2  
Old 07-06-2015, 10:12 PM
mt6127's Avatar
Super Moderator
Join Date: Mar 2012
Location: Burlington, VT
Posts: 9,195
Received 485 Likes on 466 Posts
Default

Or you can port Python to Javascript - sorry no bad jokes about your Pyjamas tonight... :-)

Great idea just the same!
 
  #3  
Old 07-07-2015, 10:12 AM
mikeri's Avatar
Junior Member
Thread Starter
Join Date: Jul 2015
Location: Oslo, Norway
Posts: 7
Likes: 0
Received 0 Likes on 0 Posts
Default Windows exe ready!

The cool thing about Javascript is that it's available in the browser, but it can not communicate with the serial port(s) from there (for a very good reason!). So you have to install plugins or a framework, and then the point of Javascript is kind of moot if you ask me.

Anyway, I just compiled a Windows 32bit exe. I was afraid it would en up huge, but the archive is just 2.4MB. I tested it on an old XP laptop and it works. (I'm not usually a Windows user at home.)

The Windows binary is at http://mikeri.net/files/milageread.zip

Just unzip the archive, CD into the extracted directory and run milageread by typing:
Code:
milageread COMx
Where x is the port number for the ELM327. Easy peasy!
 

Last edited by mikeri; 06-01-2020 at 06:37 PM. Reason: Updated URL for Windows binary archive
  #4  
Old 07-22-2015, 02:15 PM
jollygoodgold's Avatar
Member
Join Date: Jul 2007
Location: Rockford, Illinois
Posts: 91
Received 1 Like on 1 Post
Default

Nice work! Im excited to test this out!
 
  #5  
Old 07-23-2015, 09:00 PM
johnwartr's Avatar
Senior Member
Join Date: Mar 2013
Location: Columbus, Indiana
Posts: 313
Likes: 0
Received 0 Likes on 0 Posts
Default

My ELM327 is wifi. I see there's a bluetooth type as well.

Do I need some other type of ELM327? Perhaps a USB version?

Will this read the mileage on my 97 855R?
 
  #6  
Old 08-03-2015, 10:19 AM
mikeri's Avatar
Junior Member
Thread Starter
Join Date: Jul 2015
Location: Oslo, Norway
Posts: 7
Likes: 0
Received 0 Likes on 0 Posts
Default

Hi, and sorry for the late reply.

Originally Posted by johnwartr
My ELM327 is wifi. I see there's a bluetooth type as well.

Do I need some other type of ELM327? Perhaps a USB version?
If the software included with it can emulate a COM-port you should be able to use it. Just specify the correct port when using it, as described in the top post.

Originally Posted by johnwartr
Will this read the mileage on my 97 855R?
If your car has a Motronic 4.3 and an OBD port I think it should work.
 
  #7  
Old 08-13-2015, 09:01 PM
johnwartr's Avatar
Senior Member
Join Date: Mar 2013
Location: Columbus, Indiana
Posts: 313
Likes: 0
Received 0 Likes on 0 Posts
Default

So, I finally got it to work.

I tried and tried and tried my wifi ELM327. Couldn't make it work. I tried my VOL FCR cable. Couldn't make it work. Decided to just spend the $10 on eBay for a USB ELM327 cable.

Once I installed it on an old laptop, I ran your Windows program.

The program indicates I have 134,070 miles
My cluster says 127.153
So, the odometer is off by 6917 miles.

I acquired my car from my father after it sat for several years with very minimal use. I did not get a straight answer on how long it sat with a broken odometer - which is not unusual, as my Dad owned many cars at the time.

When I bought it, 2 of the first repairs were a remanufactured ABS module and a new set of speedometer gears.

That, and a new timing belt and water pump.

So, I haven't decided what I'm going to do. Part of me wants to open the odometer and rotate the gears to the 'correct' position.

Part of me wants to install this blue faced 98 V70R gauge cluster I bought and have blue gauges

Thanks for writing this program - I've wanted to know my true mileage for many years. Now, I know!
 
  #8  
Old 08-14-2015, 10:43 AM
mt6127's Avatar
Super Moderator
Join Date: Mar 2012
Location: Burlington, VT
Posts: 9,195
Received 485 Likes on 466 Posts
Default

I have cluster from a 95 where the LED gauges died - I can send to you if you want to play with pulling the odometer gears to see if that's easy to do. Send me a private msg if interested.
 
  #9  
Old 08-19-2015, 09:34 PM
crane550's Avatar
Senior Member
Join Date: May 2013
Posts: 155
Likes: 0
Received 0 Likes on 0 Posts
Default

Wow, THANK YOU! Is there any way to get it to work with the Bluetooth ELM327 Reader?

Alex
 
  #10  
Old 08-19-2015, 10:10 PM
crane550's Avatar
Senior Member
Join Date: May 2013
Posts: 155
Likes: 0
Received 0 Likes on 0 Posts
Default

Nevermind, I figured that out. Windows automatically assigns it to COM3 (at least in my case.)

I don't get milage back, I just get "Attempting Communication..."
 
  #11  
Old 08-25-2015, 08:32 PM
johnwartr's Avatar
Senior Member
Join Date: Mar 2013
Location: Columbus, Indiana
Posts: 313
Likes: 0
Received 0 Likes on 0 Posts
Default

I couldn't make it work til I bought the USB ELM327.

Thankfully, it's under $10 shipped on eBay.
 
  #12  
Old 08-26-2015, 05:26 PM
mikeri's Avatar
Junior Member
Thread Starter
Join Date: Jul 2015
Location: Oslo, Norway
Posts: 7
Likes: 0
Received 0 Likes on 0 Posts
Default

Originally Posted by crane550
I don't get milage back, I just get "Attempting Communication..."
Sorry to hear that mate. I have both a bluetooth and a USB ELM327, but have only tried milageread against the USB version. If I find the time I'll test my bluetooth device with milageread during the weekend and see what I find.
 
  #13  
Old 08-30-2015, 02:09 PM
mikeri's Avatar
Junior Member
Thread Starter
Join Date: Jul 2015
Location: Oslo, Norway
Posts: 7
Likes: 0
Received 0 Likes on 0 Posts
Default

I just tried milageread with my Bluetooth Elm327 device and got it to work, but I had to reinstall the Bluetooth COM ports under device management first, for some reason.

First, connect to the computer to the Elm327 Bluetooth serial port service. Check what COM port number it is assigned to and run milageread on that COM port. If that doesn't work, disconnect, and try rigjht clicking on the Bluetooth COM port(s) in Device Management and choose uninstall. After uninstalling, reconnect and reinstall the drivers. It worked for me.
 

Last edited by mikeri; 08-30-2015 at 04:21 PM. Reason: Typo
  #14  
Old 09-10-2015, 08:31 PM
alexj's Avatar
Junior Member
Join Date: Apr 2014
Posts: 18
Received 0 Likes on 0 Posts
Default

How would I tell if this would work on my car?

Do I need anything other than the laptop and this cable?

I have a 96 850, but it isnt a T5
 
  #15  
Old 09-17-2015, 05:31 AM
mikeri's Avatar
Junior Member
Thread Starter
Join Date: Jul 2015
Location: Oslo, Norway
Posts: 7
Likes: 0
Received 0 Likes on 0 Posts
Default

Originally Posted by alexj
How would I tell if this would work on my car?

Do I need anything other than the laptop and this cable?

I have a 96 850, but it isnt a T5
If you have an OBD-connector under the coin holder it should work, but I'm not 100% sure. If milageread doesn't work you can still use the ELM327 for other things.
 
  #16  
Old 09-25-2017, 07:05 AM
esl_97_850_T5's Avatar
Junior Member
Join Date: Nov 2012
Posts: 4
Likes: 0
Received 0 Likes on 0 Posts
Default Detailed feedback on (original 2015) milageread

Michael (mikeri),

1. (About 1.7 years ago, on 2016-01-06) I finally responded to your 2015-07-07 post in the MVS "How to read 1996-1997 Volvo 850 mileage with an ELM327" thread.

Check http://www.matthewsvolvosite.com/for...art=20#p389930 if you (or others) haven't seen that post already.

To repeat some of that MVS post here, and to expand upon it...

2. Thanks for the feedback that your ECU 51 B903 is incrementing every 10 miles (instead of every 10 km), even though your instrument panel displays in metric measurements and you live in a metric using country!! That agrees with the behavior described by several other Europeans and Canadians of their '96-'98 850 / S70 / V70 / XC70. As best I can tell, that also agrees with the OTP Volvo 850 Repair DVD.

3. And thanks for the milageread Python example!!

I love milageread's sheer simplicity!! It's very easy to understand. Kudos!


It was a good re-introduction to Python -- with a very useful example.

And, because Python is highly portable, it's given me hope that a multi-platform, "96-98 850 / S70 / V70" targeted software program is achievable without having to repeat all previous work.

4. Your README.txt says you are not yet sure if all the COMBI (ECU 51) "return the driven distance in miles", but that was your assumption.

My latest (as of 2017-09-24) understanding of ECU 51 B903 is that it increments once every 10.0 miles (16.09344 km), for all cars worldwide -- regardless if the instrument panel display in km or miles. See item 2 above. Also, see the http://jonesrh.info/volvo850/elm327_...every_10_miles note.

You probably should retain the "If you have a car with metric instruments and get a higher value than expected...Please give me feedback on this!" paragraph in case someone has solid evidence to refute our "ECU 51 B903 always in miles/10" assumption.

5. FYI, milageread is not exclusive to '96-'97 850 with Motronic 4.3. It also works with Motronic 4.4 and Fenix 5.2.

Also, milageread does not read the mileage from the Motronic 4.3 ECU, but from the COMBI ECU (ie, ECU 51).


See item 3 in that http://www.matthewsvolvosite.com/for...art=20#p389930 post for details on both of those statements.

6. IMPORTANT: You could easily generalize your program to also handle the '98 S70/V70/XC70 by making these changes:

6a. Change 'ATSH 84 51 13' to:

'ATSH 83 51 13'

6b. Change "elmreply = elmcommand('B90300')" to eliminate that 00-padding. Instead, it should say:

elmreply = elmcommand('B903')


to match the 'ATSH 83 51 13'.

7. The print statement that includes "BUS ERROR returned. Car not connected?" could include some more info to help the user correct the most common problem:

print("BUS ERROR returned. Car not connected? Either ignition should be at pos II or engine should be on.")

8. Since there are a lot of "fake, partial" ELM327 devices which only perform the standard OBDII emission diagnostics, I'd advise one of these 2 solutions:

8a. The README.txt might suggest to the potential users that they should check with their vendor beforehand to see that any (supposedly) ELM327 compatible device can perform the following 7 ELM327 commands, regardless what ELM327 version that the vendor says its device is:

ATH1
ATAL
ATKW0
ATSR 13
ATIIA 51
ATWM 82 51 13 A1
ATSH 83 51 13

The ATH1 through ATWM 82 51 13 A1 commands should all respond with OK. It is common on "fake, partial" ELM327 devices that most of the ATAL thru ATWM commands respond instead with a question mark.

The ATIIA 51 should respond with OK, *not* with something like "ELM327 v1.5" or "ELM327 v2.1" or "?" or anything else besides "OK".

The ATSI should respond with "BUS INIT: ...OK", "BUS INIT: ...ERROR", or some other message indicating that it is indeed attempting an ISO 9141-2 Slow Init connection.

The ATSH 83 51 13 should also respond with "OK". On some "fake, partial" ELM327 devices that command responds instead with a question mark.

[NOTE: I've changed your original init command list to: a) remove both "ATTA 13" and "ATSI", and b) changed "ATRA 13" to "ATSR 13". This was done to simplify the list and to ensure milageread will work with ELM327 devices as early as ELM327 v1.2.]


Examples of the commands and responses can usually be seen at:

http://jonesrh.info/volvo850/elm327_...s_rsps_example

but I haven't yet updated that page to eliminate ATTA 13 and ATRA 13 and replace them with ATSR 13.

8b. Better yet, milageread could check for the proper responses and verify if the user's ELM327 device is responding to those 7 commands appropriately. If it is not, then you might print something like "Your ELM327 device is not responding properly to the following command(s): (...list each failed command here, separated by commas or slashes, or list each failed command on a separate line...). This program requires an ELM327 device which has ELM327 v1.2 (or higher) functionality."

9. Another way to generalize your program to work with more devices is to allow selection of the baud rate, either interactively or via a command line switch. For example, ScanTool.net OBDLink SX USB, OBDLink LX BT, OBDLink MX BT devices by default work at 115200.

Alternatively, you might automatically attempt connecting at 115200 baud if the 38400 baud attempt failed.

If you don't take one of those approaches, you probably should mention in the README.txt that the program will talk with the ELM327-compatible device only at 38400 baud.

10. I really like that you have the ability to get help for the command line syntax using standard -h (or --help) switches, and especially that you have a --debug switch which shows the commands and responses:

>milageread -h
usage: milageread [-h] [--debug] P

Read milage from old Volvos using an ELM327 interface connected to the OBDII
port.

positional arguments:
P What port to connect to. In Windows this is usually a COM-port,
and in Linux /dev/ttyUSBx or /dev/ttySx where x is the port
number.

optional arguments:
-h, --help show this help message and exit
--debug Print debug info.
>
>milageread --debug COM7
Attempting communication...
ATZ: ELM327 v1.5
Initialized device: ELM327 v1.5
ATE1: OK
ATSP 3: OK
ATH1: OK
ATAL: OK
ATKW0: OK
ATTA 13: OK
ATRA 13: OK
ATIIA 51: OK
ATWM 82 51 13 A1: OK
ATSI: BUS INIT: ...OK
ATSH 84 51 13: OK
B90300: 85 13 51 F9 03 24 35 3E
['85', '13', '51', 'F9', '03', '24', '35', '3E', '\r\r']
3524
Milage: 136040 miles, 218934 kilometers
>

11. There's a problem with running milageread while ECU 51 (COMBI) still has an active connection.

If you run milageread soon after turning the ignition on, milageread (usually) reads the mileage fine the first time.

But if you then, several seconds later, run milageread again while that COMBI connection is still active -- remember the ELM327 is still sending the KeepAlive (typically) every 3 seconds -- then the 2nd run of milageread produces a mileage of 10170 (which is the value of F9 03).

For example, see the following lines which followed the above run (in item 10) -- when the ELM327 deviced showed an every 3 second flicker indicating the KeepAlive was still being sent, ie, the connection was still outstanding (as far as the ELM327 was concerned):

> milageread --debug COM7
Attempting communication...
ATZ: ELM327 v1.5
Initialized device: ELM327 v1.5
ATE1: OK
ATSP 3: OK
ATH1: OK
ATAL: OK
ATKW0: OK
ATTA 13: OK
ATRA 13: OK
ATIIA 51: OK
ATWM 82 51 13 A1: OK
ATSI: BUS INIT: ...ERROR
ATSH 84 51 13: OK
85 13 51 F9 03 24 35 3E
['US', 'INIT:', '...OK\r85', '13', '51', 'F9', '03', '24', '35', '3E', '\r\r']
03F9
Milage: 10170 miles, 16366 kilometers
>

Notice:
11_problem_a) ATSI produced "BUS INIT: ...ERROR", and
11_problem_b) the split includes all but the first character of the "BUS INIT: ...OK".

There's all kinds of ways to parse out the correction mileage from this case of BUS INIT: ...OK immediately preceding the F903 response, but the robust way to deal with it is one of the following:

11_solution_a) to wait at least 5.1 seconds after the ATZ before issuing the ATSI (in order to allow any car ECU that still thinks it is connected to reach its 5 second timeout of not receiving any KeepAlive messages or other communication). Advantage: Works 99% of the time. Disadvantage: Introduces a delay which is unnecessary if no ECUs think they have an active connection with the ELM. That situation is the norm on the very first run of milageread. So this solution introduces an inconvenient and unecessary (up to 5 second) delay on the first run of the program.

11_solution_b) to detect the ATSI's "BUS INIT: ...ERROR" response and deal with it appropriately.

12. To solve the problems mentioned in this post (and to make milageread more robust), I'm going to release my jonesrh enhancements to the milageread.py and README.txt that were available in mikeri's original 2015-07-07 milageread.zip release for Windows.

More info re jonesrh enhancements to milageread to be included in a later post today...

esl_97_850_T5 (jonesrh)
 
  #17  
Old 09-25-2017, 07:35 AM
esl_97_850_T5's Avatar
Junior Member
Join Date: Nov 2012
Posts: 4
Likes: 0
Received 0 Likes on 0 Posts
Default jonesrh's 2017-09-23 milageread enhancements

mikeri, and all,

1. milageread enhancements were released by jonesrh on 2017-09-23 for immediate download from:

http://jonesrh.info/volvo850/milager..._20170923).zip

2. The enhancements involve:

- eliminate error that reported erroneous mileage when milageread was run a 2nd time
immediately after the first run,

- generalize to allow use on 1st year ('97-'98) S70/V70/C70/XC70 via eliminating the 00 byte padding, ie, use "ATSH 83 51 13" / "B903" instead of "ATSH 84 51 13" / "B90300",

- generalize to optionally specify the baud rate so ScanTool.net OBDLink SX USB, OBDLink LX BT, and OBDLink MX BT devices can be used at baud rate 115200,

- generalize to allow use by ELM327-compatible devices as old/early as ELM327 v1.2,

- enhance error messages greatly to identify the most likely connection problem(s) that produce that particular message,

- include a "KWPD3B0 capability check" of your supposed ELM327-compatible device which analyzes exactly which command(s) fail to provide the full KWPD3B0 protocol capability (that the '96-'98 COMBI, SRS, ABS, AW 50-42, Power Seats, Motronic 4.4, MSA 15.7, Immobilizer, etc use),

- plus other miscellaneous enhancements [see change log inside .py file].

3. I've released these enhancements in .py source form only -- not in .exe form -- since that's how I've done my development / testing and that's sufficient for my purposes.

In the milageread_(with_jonesrh_enhancements_thru_2017092 3).zip, several milageread.py and README.txt versions are included, along with mikeri's original (renamed) milageread.py and README.txt. That should help mikeri (or someone else) to choose which, if any, updates they want to use/merge into their version of milageread.

4. I'm assuming that mikeri will be the ultimate maintainer of milageread, and the packager into the Windows milageread.exe format. Maybe someone can also port it to Android .apk format, iOS app format, and some native Linux format.

My role will have been to simply make the source more robust, providing more complete error handling, etc.

It is unlikely that I'll make any other publicly released enhancements to milageread (per se). mikeri can do that.

[But I *will* likely begin to use this enhanced milageread as the open source foundation of a multi-platform fusion of the functionality in volvo850diag and kwpd3b0_interpreter in order to provide realtime interpretation of '96-'98 850/S70/V70/C70/XC70 communication. Without mikeri's simple, very-easy-to-understand, original milageread Python example, it's possible I'd never spend time to do a volvo850diag / kwpd3b0_interpreter fusion!!! I'm very thankful for mikeri's work!!!]

esl_97_850_T5

P.S. Note to moderator: This post should *follow* the previous post I made today (in case you review them out-of-sequence).
 
  #18  
Old 06-01-2020, 06:32 PM
mikeri's Avatar
Junior Member
Thread Starter
Join Date: Jul 2015
Location: Oslo, Norway
Posts: 7
Likes: 0
Received 0 Likes on 0 Posts
Default

Hello again jonesrh, and thanks for your continued interest in the project.

Unfortunately, my 850 had too many problems at the end and was sold to someone with the resources and time to take better care of it. As a result, I no longer own a Volvo and will probably not be spending any more time on a Volvo specific software project any time soon.

I always buy and drive old beaters, new cars are for people with more money to spend than me. At the time when I sold the T5, a 2001 BMW 518i was what was easily and quickly available, so I bought that. A peculiar observation after trying to search for technical info online, Volvo owners and enthusiasts are *far* more friendly and helpful than anything I've found for the BMW. With Volvo, people are gladly sharing all the info the have, research they do and code they write, all to help other owners. (Something I believe in myself, which is why i share the code for Milageread) In the BMW world, it seems to be the opposite. No one wants to share, I even had one local guy knowing how to modify the headlight daytime setting (so it's always on, not sure about the correct name for it) but he refused to share the knowledge. He was only willing to fix the problem for me for money. I declined.

Digressions aside, would you like to "officially" take over the project? I will then post your URL for it in the readme at Github so people stumbling over it there can be directed to your latest version.
 
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
obdvip
For Sale / Trade - Archive
1
04-12-2021 04:22 AM
pierremcalpine
Volvo S40
4
11-18-2014 03:19 PM
timster
Volvo 850
7
11-17-2013 08:06 AM
demedcj
Volvo 850
2
02-23-2007 04:12 PM
gullyg
Volvo 850
8
08-21-2006 08:54 PM



Quick Reply: Easily read milage from Motronic 4.3 using ELM327



All times are GMT -5. The time now is 06:11 PM.