Enabling Cruise Control on the S1 - As-Built Data Mod

Area for car DIY ideas and how-to's - NOT questions.
Fitting strakes, taking the bumper off, or changing exhaust...
User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Sun Jul 30, 2017 11:53 pm

UK S1 RX-8s never had cruise control from the factory. However, the steering wheel buttons can be easily retrofitted. The problem is, Mazda released a firmware update years ago that disabled the function in the PCM if the car never came with cruise from the factory. Well, after much research, development, and reverse engineering, I'm here to tell you how to turn it back on again. Better than that in fact, I've actually written a program that automates the entire process for you, and all you need is a standard cheapo ELM327 OBD scan tool :thumright:

Background

So how did Mazda disable this function with a simple PCM firmware update? (if you're not interested in the history / already know, you can skip reading this section and just jump straight ahead to the Instructions section ;) )

Well, most cars with electronic modules have something called as-built data, which can be thought of as the "DNA" of the car. It is a chunk of data that maps out all the features the car left the factory with, effectively a series of on-off switches that tell the PCM what hardware is present and so which functions it should enable. There is also more complex data encoded in there, such as the VIN, country codes, units to use etc, and probably a lot more that we haven't decoded yet. Basically everything required to define a particular model for a particular market (USDM, EUDM, JDM, etc.), and everything that identifies that specific car.

This means that the actual executable code (firmware) that runs on the PCM can be identical or very similar across different markets (it is stored separately to the as-built data, such that if the firmware is updated, the as-built data stays the same, and vice versa), cutting costs and making production easier. (This is a bit of a simplification for the purposes of this explanation - we know for example that JDM PCMs run slightly different code for their quirky features, but the majority is the same). The PCM just disables certain routines once it has read the as-built data and knows that the hardware for a particular function isn't present. In other words, the firmware is like a program running on your computer, and the as-built data could be thought of as a configuration file that the program loads, telling it how to behave. Or something along those lines.

Cars that have cruise control from the factory, such as some US models, and the R3, therefore have a bit set in the as-built data to signify this. The PCM is supposed to check this before allowing cruise control to work, however it seems the original build of the firmware on early UK S1s didn't. I believe Mazda's PCM firmware update simply corrected this mistake, such that it now checks the as-built data first, before allowing cruise to work. Since UK S1s weren't supposed to have cruise control hardware, the correct bit is not set in the as-built data, and so it stopped working for those who retrofitted the steering wheel buttons (but still continued to work in US cars for example, who likely got the same/similar firmware update, because their as-built data does have the cruise bit set).

So in order to enable the function again, we have to modify the as-built data (modifying the firmware code itself is a next to impossible task, unless you want to disassemble hundreds of thousands of lines of assembler code - much harder than mapping which is "just" modifying static data tables - though people do do it...). I have identified which part of the as-built data needs to be changed by comparing the as-built data of cars from different markets around the world that do or don't have cruise control, narrowing it down to only a small number of possibilities. Thanks to everyone who provided their data which made this possible! With some trial and error, I found the correct bit to flip (as in computer "bit", yes it is as "simple" as changing a single 1 to a 0)! See here if interested: https://www.rx8ownersclub.co.uk/forum/v ... 0#p1049461. For an even more in-depth look at the data if you're really bored, see my FORScan forum post here: http://forscan.org/forum/viewtopic.php? ... =10#p16553

Instructions

So how do we do it? Up until now, the only way to program the as-built data was using Mazda's IDS software and compatible hardware (VCM or a clone). This either required a trip to a dealer, large investment in diagnostic scan tools (high £100's-£1000), or messing about with clone hardware (still ~£80-£100) and running IDS in a VM to bypass the licensing, which is temperamental at best. It can be done though, as evidenced by this post: https://www.rx8ownersclub.co.uk/forum/v ... 5#p1101701, and if you prefer to go down that route, or perhaps already have IDS setup there are instructions here: https://www.rx8ownersclub.co.uk/forum/v ... 5#p1096906

Well, not content with that, I have a better way. Having been kindly lent a VXDiag VCX Nano (one of the better VCM clones) by forum user "ed80" after he got it working (thanks dude! :thumleft: ), I've done all the hard work for you, reverse engineered the protocol, and re-written it for ELM327 based OBD scan tools, which can be picked up for next to nothing (£5-£20, but most people already have them lying around). I recommend a USB one, Bluetooth sometimes works but is a bit hit-and-miss. Not tried Wifi (I don't have one), fundamentally it should work but it is untested thus far (let us know if you try one and it works!). The problem is the latency - to write the as-built data successfully the commands must be sent in quick succession or it will fail. Some poorer quality ELM327 clones are just not fast enough, and my guess is neither is Wifi.

Anyway, first of all, it's obvious but has to be said just in case:

WHILST I HAVE TAKEN EVERY PRECAUTION I CAN TO MAKE THIS AS SAFE AS POSSIBLE, I TAKE NO RESPONSIBILITY IF SOMETHING GOES WRONG AND YOU BRICK YOUR ECU OR ANY OTHER ASPECT OF YOUR CAR STOPS WORKING OR CHANGES BEHAVIOUR IN AN UNDESIRABLE WAY. PROCEED ENTIRELY AT YOUR OWN RISK!

The program I have written can be downloaded from the bottom of this post. However, there are some pre-requisites / hardware mods that need to be performed first - read the steps below.

Also note that it may not work on remapped ECUs. This is because most mappers use MazdaEdit to "protect" their maps, which basically just means changing the securityAccess shared secret "key" in the PCM ROM. There's not much we can do about this - not even Mazda would be able to reprogram your ECU at this point - the best you can do is ask your mapper to unlock it for you, or put it back to a stock unprotected map temporarily so you can modify the as-built data, then put the proper map back on. The mod should persist across maps (which are really PCM firmware flashes), as explained earlier in this post. EDIT: Confirmed - the mod will persist across remaps - I had a full remap after my bridgeport and the cruise still works :thumright:

It won't break anything if you do try it on a mapped ECU and it fails, it'll just give you an error message - so you can safely give it a try anyway if you like. There is another option - dump the flash memory of your ECU (requires hardware mods, soldering etc.) and extract the key from the ROM - but your mapper may not be best pleased about this ;) I'm curious to find out if the key is the same for all MazdaEdit maps, or different on a map-by-map or mapper-by-mapper basis. EDIT: Recent evidence seems to suggest that MazdaEdit may be using the same key for all protected maps, which I have coded into my program. So it should work for mapped ROMs too now. Give it a try and see! :thumright:

Right, with that out of the way, here we go:
  1. Install a set of cruise control steering wheel buttons as per the instructions in this thread: https://www.rx8ownersclub.co.uk/forum/v ... =30&t=7129
    Ignore the big red warning about it not working any more, we now have the powers to change that :twisted: If you have a later model year car (we think post '06 when they changed lots of stuff?) then you may be lucky and already have the wiring in place, and just need to add the buttons and plug them in.
  2. Check you have a 4-pin brake pedal switch (black connector), and if not, install one. Non-cruise cars tend to only have the 2-pin switch (white connector). Depending on the age of your car, you may also have to add another wire for this over to a connector in the passenger foot well, and a ground, just like for the steering wheel buttons. See here. Again, later cars may already have this wiring, so it's not enough to assume if there's 4 wires going to the brake switch then it's a 4-pin one - pull the connector out and check for the physical pins. Cruise will work for a short while with a 2-pin switch if you ground the corresponding wire (see https://www.rx8ownersclub.co.uk/forum/v ... 5#p1106167), but once enabled quickly throws DTCs and stops working, followed by an eventual CEL. So I'd recommend installing a 4-pin switch before enabling cruise in your data.
  3. Obtain an ELM327-based OBD scan tool. This is probably the most annoying part. It must support HS-CAN (ISO15765-4 CAN, 11bit ID, 500 Kbaud). It will without a doubt be a Chinese clone version of the ELM327 (https://en.wikipedia.org/wiki/ELM327#Pirate_clones), which is fine, but some clones are better than others. I recommend an older USB one. Bluetooth is next best, may work, may not. WiFi seems to have the most latency. YMMV. Basically the better the clone it is, the more likely it is to work. The As-built data may fail to write on poorer quality "bad" clones / slower devices. I seem to have gotten lucky in that the one I own is quite a "good" clone. It's an ELM327 USB V1.4 if that helps, with a 500kbps FTDI UART chip for communication with the PC.
  4. Plug the ELM327 into your computer (or connect if it's wireless), install drivers, and find out which COM port it has been assigned to. If you don't know how to do this you may struggle with the next part... (but there are plenty of guides on the internet, hint - look in device manager for the serial COM port).
    1.png
    1.png (35.06 KiB) Viewed 3501 times
  5. Download the latest version of rx8cc.zip from the attachments to this post below. Unzip it. You should find an executable rx8cc.exe inside. It is just a python script packaged up with PyInstaller, feel free to decompile it and check the Python source if you wish - there's nothing sinister but I encourage you not to trust random .exes from the internet! It is a command line program, no GUI I'm afraid, if you're not familiar with the command line I'd suggest you get someone to help you (hint: navigate to the unzipped folder and type "cmd" in the address bar, then hit return).
  6. Connect ELM327 OBD scan tool to car and switch on the ignition.
  7. Run the following command from the command line in the folder you extracted the zip to:

    Code: Select all

    rx8cc.exe COM<n>
    where <n> is the COM port number you found out earlier. E.g.

    Code: Select all

    rx8cc.exe COM4
    For help you can also run

    Code: Select all

    rx8cc.exe --help
    2.png
    2.png (35.06 KiB) Viewed 3501 times
    3.png
    3.png (31.76 KiB) Viewed 3501 times
  8. The program will read your current ABD, check to see if the cruise control bit is enabled, and if it isn't, perform the necessary modification to enable it, all automatically. Just sit back and let it work its magic :) Hopefully you won't get any errors, but if you do it should give you some hints as to what the problem is. I have included a lot of error handling, so it should catch most common problems and be relatively fail-safe. Sometimes it can think it hasn't programmed the data when it actually has - just run the program again and it should say "Cruise control already enabled" if that was the case (it is fine to run the program multiple times). In fact, do try running it a few times if it fails to rule out patchy adapters (especially Bluetooth/Wifi).
    4.png
    4.png (27.74 KiB) Viewed 3501 times
  9. Once it's done, turn off your ignition and disconnect everything, then go for a drive to enjoy your new cruise control! :D
    IMG_20170813_112634862.jpg
Yep, that's it!

If you want to show your appreciation, I accept beer and/or food or the means to obtain them :lol:

Troubleshooting

If you keep getting errors around the writing or verifying process having tried several times, it could be that your ELM327 just isn't fast enough / up to the job of doing the programming. Try a different one if you have one, and let us know - perhaps we can build up a list of adapters that work and ones that don't! Failing that, there's always the Mazda IDS + VCX Nano option to fall back on.

If it fails for any reason other than the a write/verify failure, then something else may be wrong - check your setup. RX8CC should give you some hints in its error messages. Until this has been tested on multiple devices with multiple cars there are likely to be certain combinations / conditions that don't work, and some bugs to iron out, so bear with me. Give it a try on your setup and let us know if it works! :thumright:

If the programming was successful, and you can now switch on cruise control and get the orange "cruise main" light, but you can't actually set a speed and activate cruise and get the green "cruise" light, then you likely have the wrong brake pedal sensor switch and/or need to add some wiring - see here: https://www.rx8ownersclub.co.uk/forum/v ... 3#p1104723. We currently believe this only applies to pre-'55 plate 231s (no idea about 192s or AT). Alternatively, one of your pedal sensor switches or associated wiring may be faulty - clutch, brake, transmission neutral. From the technical guide, in order to activate cruise control the following conditions must be met:

Cruise control operation condition
  • When all of the following conditions are met, execution of the cruise control system is enabled (cruise control standby status).
    - Cruise control main switch: ON
    – Vehicle speed: Exceeds 27 km/h {16.8 mph}
Cruise control stop condition
  • When any of the following conditions are met even while in cruise control, the PCM stops the cruise control and clears the set vehicle speed.
    – Ignition switch: OFF
    – Cruise control main switch: OFF
    – Cruise control related DTCs (P0564, P0571) detected
  • When any of the following conditions are met even while in cruise control, the PCM stops the cruise control while storing the set vehicle speed.
    – Cancel switch: ON
    – Neutral switch or CPP switch: ON
    – Vehicle speed: Less than 22.5 km/h {13.9 mph}
    – Brake switch: ON
    – The actual vehicle speed is 15 km/h {9.3 mph} or more lower than the set vehicle speed during cruise control (ascending).
    – Condition where actual vehicle speed is 15 km/h {9.3 mph} or more lower than the set vehicle speed continues for 60 s or more even when the RESUME/ACCEL switch is on.
Support

Please try and keep this thread for discussion of the program itself, or any bugs, working / not working etc.

For hardware discussion / problems (e.g. cruise switching on but not holding speed, which is usually a brake switch wiring issue), please refer to / post in this thread: https://www.rx8ownersclub.co.uk/forum/v ... d#p1104723

Cheers :thumleft:

Attachments:
Attachments
rx8cc.2.1.1.beta.zip
(4.45 MiB) Downloaded 267 times
rx8cc.2.1.zip
(4.45 MiB) Downloaded 118 times
rx8cc.2.0.zip
(4.45 MiB) Downloaded 113 times
Last edited by JamieM on Fri Apr 20, 2018 12:14 am, edited 64 times in total.
These users thanked the author JamieM for the post (total 13):
warpc0il (Sun Jul 30, 2017 11:55 pm) • Ian.Mothersole (Mon Jul 31, 2017 12:11 am) • HwAoRrDk (Mon Jul 31, 2017 12:21 am) • Phil Bate (Mon Jul 31, 2017 12:50 am) • PhilR (Mon Jul 31, 2017 7:20 am) • untakenname (Mon Jul 31, 2017 11:31 am) • ed80 (Mon Jul 31, 2017 8:47 pm) • brix79 (Tue Aug 01, 2017 11:10 am) • Lemon (Tue Aug 01, 2017 11:33 am) • WaferShaf (Tue Aug 01, 2017 3:50 pm) and 3 more users
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

User avatar
Ian.Mothersole
Committee Member
Committee Member
Posts: 8595
Joined: Thu Jan 14, 2010 10:21 am
RX-8: 231
Colour: Velocity Red
Location: Manningtree, Essex
Has thanked: 37 times
Been thanked: 311 times
Contact:

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by Ian.Mothersole » Sun Jul 30, 2017 11:58 pm

JamieM wrote:...
If you want to show your appreciation, I accept beer and/or food or the means to obtain them :lol:
I hope you accept my "pre-payment" from last Friday ;)
These users thanked the author Ian.Mothersole for the post:
JamieM (Mon Jul 31, 2017 12:01 am)
Ian.M - Keep It Simple!
Club Shopkeeper & Forum Admin Team

"Rex" 2009-16
Velocity Red 231; Hayward Rotary ported engine; Racing Beat exhaust, flywheel, air duct, anti-roll bars; Eibach lowering springs, wheel spacers; Essex Rotary mini-remap; Prodrive PZ spoiler.
"Rex 2" 2014-
Velocity Red 231; the project car.
"Blue Rex" 2015-
Winning Blue 231; RX ATE.

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Mon Jul 31, 2017 12:02 am

I certainly do :D

Feel free to have a go yourself if you like, or if you wait until next month's monthly meet I can do it for you and I'm certain it will work this time! (mostly because I've cut out the need to go anywhere near IDS... *shudder* :P )
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

User avatar
Ian.Mothersole
Committee Member
Committee Member
Posts: 8595
Joined: Thu Jan 14, 2010 10:21 am
RX-8: 231
Colour: Velocity Red
Location: Manningtree, Essex
Has thanked: 37 times
Been thanked: 311 times
Contact:

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by Ian.Mothersole » Mon Jul 31, 2017 12:10 am

I might give it a go tomorrow, but I only have a bluetooth ELM327 tool to try it with.
Ian.M - Keep It Simple!
Club Shopkeeper & Forum Admin Team

"Rex" 2009-16
Velocity Red 231; Hayward Rotary ported engine; Racing Beat exhaust, flywheel, air duct, anti-roll bars; Eibach lowering springs, wheel spacers; Essex Rotary mini-remap; Prodrive PZ spoiler.
"Rex 2" 2014-
Velocity Red 231; the project car.
"Blue Rex" 2015-
Winning Blue 231; RX ATE.

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Mon Jul 31, 2017 12:18 am

It will be interesting to see if it works over Bluetooth. I suspect the throughput won't be high enough, so the ABD writing stage may just get no response from the ECU and time out (the problem I was stuck on for ages). Each frame of the multi-frame CAN packet has to follow the previous within a set time, it's rather timing critical.

Shouldn't cause any harm if it doesn't work though, will just leave the data as it was - i.e. no cruise :)
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

User avatar
joney
Former Member
Former Member
Posts: 799
Joined: Mon Feb 09, 2015 6:34 pm
RX-8: 231
Colour: Strato Blue
Location: Hedge end, Southampton
Has thanked: 25 times
Been thanked: 54 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by joney » Mon Jul 31, 2017 2:48 pm

This is so cool well done if we ever meet I will buy u a beer
These users thanked the author joney for the post:
JamieM (Mon Jul 31, 2017 3:28 pm)
If its not broke I'm sure I can find a reason to take it apart :thumright:
Things Done: Nexus Mod, Led Lights, D969 Coils, cobra exhaust, moded ash tray to gauge pod, Toyo Decat, cruise control mod with mazda 6 steering wheel and Lots of Cleaning
To Do: ?
Want:Ms kit

User avatar
WaferShaf
Former Member
Former Member
Posts: 762
Joined: Mon Mar 28, 2016 4:55 pm
RX-8: PZ
Colour: Galaxy Grey
Location: Liverpool
Has thanked: 20 times
Been thanked: 27 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by WaferShaf » Mon Jul 31, 2017 3:08 pm

Here here! (..or hear hear!?)
Absolutely amazing work, I know this has been a time consuming and technical effort, thanks for sharing!
These users thanked the author WaferShaf for the post:
JamieM (Mon Jul 31, 2017 3:28 pm)
- Shaf - :mrgreen:

RX-8 PZ ProDrive Edition [008/800] (lowered 15mm, Bilstein dampers, Eibach springs), 2006 Galaxy Grey
Completed: D585-R CoilsNGK Iridium plugs & Magnecor leadsN3R3 starterSohn adapterCruise controlCalliper refurbBonnet liftersClimair deflectorsCabin LEDs2Din Metra kit
To do/Wish List: ●Mini map●20mm spacers F&R●Discs●DVR F&R●Body kit●Respray??

User avatar
zippyonline
Club Member
Club Member
Posts: 1300
Joined: Mon May 05, 2014 11:16 am
RX-8: Evolve
Colour: Copper Red
Location: Essex/Suffolk
Has thanked: 49 times
Been thanked: 86 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by zippyonline » Tue Aug 01, 2017 10:57 am

Ian.Mothersole wrote:I might give it a go tomorrow, but I only have a bluetooth ELM327 tool to try it with.
I've got a couple of half decent USB OBD cables you'd be welcome to borrow if Jamie isn't around - I can cycle back home from work via Manningtree if needs be.

Or we can all marvel at it working at the next meet :D
Copper Red Evolve - viewtopic.php?f=104&t=71400

User avatar
Ian.Mothersole
Committee Member
Committee Member
Posts: 8595
Joined: Thu Jan 14, 2010 10:21 am
RX-8: 231
Colour: Velocity Red
Location: Manningtree, Essex
Has thanked: 37 times
Been thanked: 311 times
Contact:

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by Ian.Mothersole » Tue Aug 01, 2017 11:17 am

The Bluetooth adapter unfortunately didn't work:

Code: Select all

C:\Rx8cc>rx8cc.exe COM5

*******************************************************
   Mazda RX-8 Cruise Control Enabler v1.0
      by James McKee ("JamieM")
*******************************************************

Initialising...
Traceback (most recent call last):
  File "rx8cc.py", line 1062, in <module>
  File "rx8cc.py", line 905, in main
  File "rx8cc.py", line 704, in tryBaudRate
  File "rx8cc.py", line 658, in receiveResponse
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 0: unexpected end of data
Failed to execute script rx8cc

C:\rx8cc>
Ian.M - Keep It Simple!
Club Shopkeeper & Forum Admin Team

"Rex" 2009-16
Velocity Red 231; Hayward Rotary ported engine; Racing Beat exhaust, flywheel, air duct, anti-roll bars; Eibach lowering springs, wheel spacers; Essex Rotary mini-remap; Prodrive PZ spoiler.
"Rex 2" 2014-
Velocity Red 231; the project car.
"Blue Rex" 2015-
Winning Blue 231; RX ATE.

User avatar
sKenDread
Club Member
Club Member
Posts: 502
Joined: Thu Jun 23, 2016 12:30 pm
RX-8: 231
Colour: Galaxy Grey
Location: West Midlands UK
Has thanked: 114 times
Been thanked: 94 times
Contact:

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by sKenDread » Tue Aug 01, 2017 11:31 am

This is a great watch!

08 Galaxy grey 231 manual
Kia-ora!
RR D585 Coils | miniMelon Map | RRP COFS | Powerflow Twin Exhaust
Tein Flex Z Coilovers | 245 40r18 Uniroyal Rainsport3
Original engine 80k
Compression 050519 F: 4.38,4.72,4.78 R: 4.83,4.78,4.78
'08 231 PS, Galaxy Grey, Black Leather

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Tue Aug 01, 2017 11:33 am

Ian.Mothersole wrote:The Bluetooth adapter unfortunately didn't work:

Code: Select all

C:\Rx8cc>rx8cc.exe COM5

*******************************************************
   Mazda RX-8 Cruise Control Enabler v1.0
      by James McKee ("JamieM")
*******************************************************

Initialising...
Traceback (most recent call last):
  File "rx8cc.py", line 1062, in <module>
  File "rx8cc.py", line 905, in main
  File "rx8cc.py", line 704, in tryBaudRate
  File "rx8cc.py", line 658, in receiveResponse
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 0: unexpected end of data
Failed to execute script rx8cc

C:\rx8cc>
Bummer. That's an interesting error output though, not seen that before, I think you found a bug! :)

It's coded to try the fastest serial comms rate first (500k), then if that fails keep trying slower ones until it finds one that works. My adapter always just works first time with the fastest option, so I've never actually been able to test what happens with slower adapters.

I suspect what may have happened is, when the baud rate is wrong you can get garbage data, which the program has then tried to interpret, but it isn't valid data so it's raised an exception. I'll look into fixing up that bit of code (wrapping it in try/catch) when I get home after work. You may still be able to use the Bluetooth adapter yet! ;)
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Tue Aug 01, 2017 10:24 pm

I've just uploaded a new version (v1.1) to the first post, give that a try! :)

Also added a --disable option (see --help) in case anyone needs to reverse the mod:
5.png
5.png (16.18 KiB) Viewed 3290 times
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

innerlurken
Former Member
Former Member
Posts: 145
Joined: Tue Jun 12, 2012 11:15 pm
RX-8: 231
Colour: Sunlight Silver
Location: Tamworth, Staffordshire
Has thanked: 1 time
Been thanked: 4 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by innerlurken » Tue Aug 01, 2017 10:38 pm

question, how hard would it be to make it work with a j2534 pass-through device? (like a openport 2.0).

Great work by the way, wish i had your talents

User avatar
Ian.Mothersole
Committee Member
Committee Member
Posts: 8595
Joined: Thu Jan 14, 2010 10:21 am
RX-8: 231
Colour: Velocity Red
Location: Manningtree, Essex
Has thanked: 37 times
Been thanked: 311 times
Contact:

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by Ian.Mothersole » Tue Aug 01, 2017 10:47 pm

JamieM wrote:I've just uploaded a new version (v1.1) to the first post, give that a try! :)
...
Cool, thanks.
Will try it tomorrow :thumleft:
These users thanked the author Ian.Mothersole for the post:
JamieM (Wed Aug 02, 2017 12:51 am)
Ian.M - Keep It Simple!
Club Shopkeeper & Forum Admin Team

"Rex" 2009-16
Velocity Red 231; Hayward Rotary ported engine; Racing Beat exhaust, flywheel, air duct, anti-roll bars; Eibach lowering springs, wheel spacers; Essex Rotary mini-remap; Prodrive PZ spoiler.
"Rex 2" 2014-
Velocity Red 231; the project car.
"Blue Rex" 2015-
Winning Blue 231; RX ATE.

User avatar
Ian.Mothersole
Committee Member
Committee Member
Posts: 8595
Joined: Thu Jan 14, 2010 10:21 am
RX-8: 231
Colour: Velocity Red
Location: Manningtree, Essex
Has thanked: 37 times
Been thanked: 311 times
Contact:

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by Ian.Mothersole » Tue Aug 01, 2017 10:51 pm

zippyonline wrote:
Ian.Mothersole wrote:I might give it a go tomorrow, but I only have a bluetooth ELM327 tool to try it with.
I've got a couple of half decent USB OBD cables you'd be welcome to borrow if Jamie isn't around - I can cycle back home from work via Manningtree if needs be.
...
Many thanks for the offer Zippy :thumleft:
I'll see how Jamie's version 1.1 works out tomorrow with the bluetooth adapter, otherwise I have ordered myself a USB one to use. (Although if I get impatient waiting for it to arrive then I'll drop you a PM to arrange meeting up :) )
Ian.M - Keep It Simple!
Club Shopkeeper & Forum Admin Team

"Rex" 2009-16
Velocity Red 231; Hayward Rotary ported engine; Racing Beat exhaust, flywheel, air duct, anti-roll bars; Eibach lowering springs, wheel spacers; Essex Rotary mini-remap; Prodrive PZ spoiler.
"Rex 2" 2014-
Velocity Red 231; the project car.
"Blue Rex" 2015-
Winning Blue 231; RX ATE.

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Wed Aug 02, 2017 12:51 am

innerlurken wrote:question, how hard would it be to make it work with a j2534 pass-through device? (like a openport 2.0).

Great work by the way, wish i had your talents
Thanks!

I have absolutely no idea - I image you'd basically have to rewrite the whole thing from scratch since the protocol is completely different. The only thing that would be the same would be the actual commands/data sent to the ECU (which I'm happy to share if someone wants to go down this route, see here for example: http://forscan.org/forum/viewtopic.php? ... 244#p11188). But I don't know anything about J2534 pass-through so who knows :P Does anybody have a software programmers manual / datasheet for it? Like this one for ELM327 which lists all of the commands to send over the serial port and how to use them: https://www.elmelectronics.com/wp-conte ... M327DS.pdf

I suspect not, as I think you have to pay for the standard... but that would be the starting point. If someone wants to do it, be my guest! I think almost all J2534 pass-through devices have proprietary serial protocols that aren't documented, and you have to use an API provided by a DLL. I've yet to find documentation for this API without having to pay money. ELM327 is easy because you basically just send ASCII text to a serial port to control it. I wrote my program in Python using that PDF datasheet. J2534 on the other hand requires DLL calls and C code...

Basically put it this way - it's possible, and would probably be more reliable, but I personally have no intention of doing it. I've done what I set out to do ;) There are two options for the mod now - IDS using a VCM or VCM clone (which are themselves J2534 pass-through devices), or my way with an ELM327. ELMs are also much cheaper than the likes of openport 2.0, and more people have them. If you want to use J2534 pass-through, use IDS :lol:
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

User avatar
Ian.Mothersole
Committee Member
Committee Member
Posts: 8595
Joined: Thu Jan 14, 2010 10:21 am
RX-8: 231
Colour: Velocity Red
Location: Manningtree, Essex
Has thanked: 37 times
Been thanked: 311 times
Contact:

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by Ian.Mothersole » Wed Aug 02, 2017 1:02 pm

Error with Vesion 1.1 on Bluetooth:

Code: Select all

C:\rx8cc.1.1>rx8cc.exe COM8

*******************************************************
   Mazda RX-8 Cruise Control Enabler v1.1
      by James McKee ("JamieM")
*******************************************************

Initialising...
Traceback (most recent call last):
  File "rx8cc.py", line 1063, in <module>
  File "rx8cc.py", line 903, in main
  File "rx8cc.py", line 700, in tryBaudRate
  File "rx8cc.py", line 556, in sendCmd
  File "rx8cc.py", line 568, in sendData
  File "rx8cc.py", line 658, in receiveResponse
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Failed to execute script rx8cc

C:\rx8cc.1.1>
Ian.M - Keep It Simple!
Club Shopkeeper & Forum Admin Team

"Rex" 2009-16
Velocity Red 231; Hayward Rotary ported engine; Racing Beat exhaust, flywheel, air duct, anti-roll bars; Eibach lowering springs, wheel spacers; Essex Rotary mini-remap; Prodrive PZ spoiler.
"Rex 2" 2014-
Velocity Red 231; the project car.
"Blue Rex" 2015-
Winning Blue 231; RX ATE.

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Wed Aug 02, 2017 3:09 pm

Ugh fine I'll have to dig out my Bluetooth one (wherever it is :roll: ) and test it properly :P I hoped it would be a quick fix!
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

User avatar
WaferShaf
Former Member
Former Member
Posts: 762
Joined: Mon Mar 28, 2016 4:55 pm
RX-8: PZ
Colour: Galaxy Grey
Location: Liverpool
Has thanked: 20 times
Been thanked: 27 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by WaferShaf » Wed Aug 02, 2017 4:14 pm

My usb elm obd arrived this morning, and I have a wheel with cc controls coming in 2 weeks.
If it helps I reckon I could post out the obd to those that need it once I'm done, as long as it eventually makes it's way back to me! 8)

Image
- Shaf - :mrgreen:

RX-8 PZ ProDrive Edition [008/800] (lowered 15mm, Bilstein dampers, Eibach springs), 2006 Galaxy Grey
Completed: D585-R CoilsNGK Iridium plugs & Magnecor leadsN3R3 starterSohn adapterCruise controlCalliper refurbBonnet liftersClimair deflectorsCabin LEDs2Din Metra kit
To do/Wish List: ●Mini map●20mm spacers F&R●Discs●DVR F&R●Body kit●Respray??

User avatar
Yie
Former Member
Former Member
Posts: 273
Joined: Wed Nov 18, 2015 5:10 pm
Location: Surrey
Has thanked: 4 times
Been thanked: 9 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by Yie » Wed Aug 02, 2017 4:43 pm

Well this has just made everything easier! I might give this a go with my R3 wheel at the weekend!
2008 BMW 135i Stage 1+

Gone:
2004 Winning Blue 231 (Street Ported)
2006 Copper Red Evolve
2005 Velocity Red 231
2008 Metropolitan Grey 40th Anniversary
2008 Crystal White R3

User avatar
Ian.Mothersole
Committee Member
Committee Member
Posts: 8595
Joined: Thu Jan 14, 2010 10:21 am
RX-8: 231
Colour: Velocity Red
Location: Manningtree, Essex
Has thanked: 37 times
Been thanked: 311 times
Contact:

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by Ian.Mothersole » Thu Aug 03, 2017 2:21 pm

Hi Jamie,

I've got hold of a USB adapter to try now, but I'm afraid there's a new error (see below). Not really much to work with...

Code: Select all

C:\rx8cc.1.1>rx8cc.exe COM11

*******************************************************
   Mazda RX-8 Cruise Control Enabler v1.1
      by James McKee ("JamieM")
*******************************************************

Initialising...
ELM327 v1.5 @ 500000 bps

Connecting to vehicle...
Reading data...

VIN = JMZSE***<EDIT>***

PCM as-built data:
PCM1: FFFF FFFF 0310
PCM2: 0DFF FFFF FF1B
PCM3: FFFF FFFF FF0E
PCM4: FFFF FFFF FF0F
PCM5: FFFF FFFF FF10
PCM6: FFFF FFFF FF11
PCM7: FFFF FFFF FF12
PCM8: FFFF FFFF FF13
PCM9: FFFF FFFF FF14

New as-built data:
PCM1: FFFF FFFF 0310
PCM2: 0DFF FFFF FE1A
PCM3: FFFF FFFF FF0E
PCM4: FFFF FFFF FF0F
PCM5: FFFF FFFF FF10
PCM6: FFFF FFFF FF11
PCM7: FFFF FFFF FF12
PCM8: FFFF FFFF FF13
PCM9: FFFF FFFF FF14

Acquiring securityAccess...
Access granted with standard secret key ('MazdA')

Writing new data...
Write complete
Verifying data...
ERROR: ECU did not accept new data

C:\rx8cc.1.1>
Ian.M - Keep It Simple!
Club Shopkeeper & Forum Admin Team

"Rex" 2009-16
Velocity Red 231; Hayward Rotary ported engine; Racing Beat exhaust, flywheel, air duct, anti-roll bars; Eibach lowering springs, wheel spacers; Essex Rotary mini-remap; Prodrive PZ spoiler.
"Rex 2" 2014-
Velocity Red 231; the project car.
"Blue Rex" 2015-
Winning Blue 231; RX ATE.

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Thu Aug 03, 2017 2:40 pm

That's the same error I got from someone else via PM. Basically means that during the ABD write the OBD adapter didn't send the CAN frames with the right timing to be accepted by the ECU, so the ABD didn't change on the ECU :? (which is what I was expecting the Bluetooth adapter to do)

After the write, I read the ABD back to check it actually changed, since in order to do the write fast enough I have to disable responses, so can't rely on the ECU's reply to determine whether it was successful or not. The error means that the ABD didn't change, thus the write didn't work.

It's looking like the write process is very adapter specific, because of the timing - whilst it works perfectly well with mine, nobody else seems to have succeeded yet (well, of a sample size of 2). I must have gotten lucky with my adapter!

It will either be the case that it's sending the frames too slowly, in which case it will never work and there's nothing I can do, since the software is already sending them as fast as possible within the constraints of the ELM327 protocol. Or alternatively perhaps it is sending them too quickly, which I should be able to fix, but I won't know until I can try it with a failing adapter and log what is going on! If it's just too slow then all you can really do is try a different adapter unfortunately :?

It's also possible, since all my testing and development has been done with an ECU out of the car on my desk, that it behaves slightly differently when in an actual car. I'll be able to confirm / disprove this tonight after work, when I will be putting my mapped ECU back into my car, having dumped the ROM and obtained the securityAccess key last night ;)

Image

Having said that, I did put my spare ECU into the car and it appeared to work (I could enable and disable cruise with my program successfully, and I got the cruise main light to come on), I just couldn't test it properly because it wouldn't start the car. I would need to reprogram PATS with my keys to make that ECU start my car, but I didn't want to do that in case it stopped my original ECU from being able to start my car (as it talks to the RKE module too), before I had the securityAccess key that would enable me to reprogram my original ECU if necessary. But then I figured I may as well just do the mod on my original ECU once I have that!
Last edited by JamieM on Thu Aug 03, 2017 3:08 pm, edited 3 times in total.
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

User avatar
joney
Former Member
Former Member
Posts: 799
Joined: Mon Feb 09, 2015 6:34 pm
RX-8: 231
Colour: Strato Blue
Location: Hedge end, Southampton
Has thanked: 25 times
Been thanked: 54 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by joney » Thu Aug 03, 2017 2:58 pm

Have you got a pic of your adapter and what firmware is it running just pondering if a difference in firmware could be behind it
If its not broke I'm sure I can find a reason to take it apart :thumright:
Things Done: Nexus Mod, Led Lights, D969 Coils, cobra exhaust, moded ash tray to gauge pod, Toyo Decat, cruise control mod with mazda 6 steering wheel and Lots of Cleaning
To Do: ?
Want:Ms kit

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Thu Aug 03, 2017 3:04 pm

Sorry I just edited my post above, but you can just make it out in the photo I added. It's black with a red zig-zag line and "Ford" written on it, and says something along the lines of "designed for elmConfig". It's one of the ones with an MS-CAN switch, apparently designed specifically for FORScan / elmConfig (I doubt they've done anything different really though). This is the link I bought it from, but be aware I bought it over a year ago, and a different company appears to be supplying them now and the photo is ever so slightly different, so you may not get the same one: https://www.amazon.co.uk/gp/product/B00KPGN9ZW/

Also it was only £9.95 when I bought it :lol: The serial UART chip that talks to the PC in mine is a FTDI one, or reports to be so, which is a good start, and does support 500kbaud as it claims. The ELM327 that talks to the car claims it is version 1.4. Anyone can find the version of their ELM and play around with the commands by hand by opening up a serial terminal to the COM port using PuTTy or a similar program @ 38400 baud, and issuing the command "ATI":

Code: Select all

> ATI
ELM327 v1.4

>
For more commands: https://www.elmelectronics.com/wp-conte ... M327DS.pdf
Last edited by JamieM on Thu Aug 03, 2017 3:27 pm, edited 5 times in total.
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

User avatar
JamieM
Club Member
Club Member
Posts: 361
Joined: Tue Nov 11, 2014 8:23 pm
RX-8: 231
Colour: Brilliant Black
Location: Cambridge
Has thanked: 71 times
Been thanked: 47 times

Re: Enabling Cruise Control on the S1 - As-Built Data Mod

Post by JamieM » Thu Aug 03, 2017 3:15 pm

I just noticed that Ian's is v1.5, which is the difference to mine which is 1.4.

Generally the newer clones tend to be worse than the older ones, annoyingly, as you get clones of clones of clones.. etc

There is no such thing as an ELM327 v1.5 (https://en.wikipedia.org/wiki/ELM327#Pirate_clones), officially elm electronics never released one with that version. So I'm going to say the most likely (though not confirmed) reason it doesn't work is it's a bad clone.

Unfortunately, buying these things is entirely hit and miss, and even one that reports v1.4 may not work if it's a later model :( I think I got lucky with my clone.
Author of rx8cc (cruise control mod)
  • '54 Sunlight Silver 231 - Retired due to rust, engine & ecu transplanted into:
  • '55 Brilliant Black 231
    LC Full bridge, D585s, RRP sports cat, Cobra catback, AEM intake, Exedy stage 1 clutch & ultralight flywheel, M1144 pads, shortshifter, MS-style skirts, rear spats etc, custom 350W RMS cabin-firing sub build (ski hatch), cruise control (obvs)
  • '52 Black Turbo MX-5

Post Reply

Return to “DIY”