1. Attachments are working again! Check out this thread for more details and to report any other bugs.

Hacking the Prius computers

Discussion in 'Gen 2 Prius Accessories & Modifications' started by aeronaut, Jun 30, 2007.

  1. FL_Prius_Driver

    FL_Prius_Driver Senior Member

    Joined:
    Jun 17, 2007
    4,319
    1,527
    0
    Location:
    Tampa Bay
    Vehicle:
    2010 Prius
    Model:
    I
    The design engineers at Toyota could either have custom bus monitors, loggers, and analyzers made for their proprientary busses or start using the numerious CAN equipment that existed. Additionally, the integrated circuit manufactures are integrating standard industrial bus interfaces right into the controller ICs. The move to the CAN bus was done for the exact same reason the Aviation Industry Fly by Wire planes (commercial and military) use the MIL-STD-1553 bus almost universally. Only a fully documented and supported industry standard is supportable once the technology gets complicated enough. Think of how many software languages there were 20 years ago (Fortran, C, Basic, Pascal, etc.) vs how many are universal today (C++). Expect CAN to be universal in cars by the next decade just like Ethernet is for office networks now.

    When designing a "Fly By Wire" vehicle, there would be a primary focus on safety, reliability and supportablilty. No way you put hacks into this code to make code obscure or provide analysis security. None of this is in any aviation software or even allowed by an approval authority (NSTA). What they would have concentrated on is making the integrity of the software path from factory to car foolproof, not reverse engineering proof once in the car's ECUs. No reason to release the code to the world, but only disadvantages to complicate it beyound the safety and reliability goals needed. The reverse engineering will be hard because this is a very complicated vehicle, not because a lot of tricks are incorporated.

    This is a level of effort exercise. Be safe and sensible, but experts in this area are in short supply. Become one.
     
  2. Bill Merchant

    Bill Merchant absit invidia

    Joined:
    May 3, 2005
    4,096
    81
    13
    Location:
    USA | Oregon | Portland area | 97004 |
    Vehicle:
    2007 Prius
    I'm sure it's possible to hack the Prius code. I just wouldn't want to ride in a hacked Prius. Here is some more detail about the three major LANs.


    <div align="center">[attachmentid=9399] </div>
     

    Attached Files:

    • CBA.gif
      CBA.gif
      File size:
      15 KB
      Views:
      1,125
  3. apriusfan

    apriusfan New Member

    Joined:
    Apr 8, 2007
    6,050
    205
    0
    Location:
    S.F. Bay Area
    Vehicle:
    2007 Prius
    <div class='quotetop'>QUOTE(FL_Prius_Driver @ Jul 2 2007, 05:21 PM) [snapback]471914[/snapback]</div>
    On the Prius, in addition to the CAN system (which is standardized), there are two proprietary systems (BEAN and AVC-LAN). I doubt there are any real experts on the proprietary systems outside of Toyota. And, it would be prudent for Toyota to do some encryption if only for product liability protection purposes.
     
  4. etyler88

    etyler88 etyler88

    Joined:
    Mar 9, 2005
    450
    2
    0
    Location:
    Dover, DE
    Vehicle:
    2005 Prius
    Aeronaut, I say go for it!

    I have no technical knowledge, I can only encourage you. Udaman!
     
  5. FL_Prius_Driver

    FL_Prius_Driver Senior Member

    Joined:
    Jun 17, 2007
    4,319
    1,527
    0
    Location:
    Tampa Bay
    Vehicle:
    2010 Prius
    Model:
    I
    I am very interested in seeing if the following two modifications can yield a usable vehicle from a stock Prius:

    a) A plug in hybrid. LOTS of work ongoing and LOTS of progress made. No signs of any encryption or mysterious proprietary bus protocols. None. Very significant is the success of being able to achieve significant use just by manipulating the SOC from the Battery ECU. However, a full optimization will require understanding all the Prius power handling algorithms. Serious work here, and I would not expect the results would be made available from the groups extracting them.....but one industrious individual can change this in one posting.

    B) Replacing the engine with a motor. Make it a full EV. This may not be sensible, but it sure would be hard. A lot of education and full understanding is needed just to determine why this would be foolish, or just difficult. The education part would be rewarding. I expect it will take (me at least) about two more years to catch up to the experts in the present state of the art here. Lots of ground to cover.

    Any Prius Inverter/transaxial (or usable vehicle if refurbished) sitting in a junkyard is a big waste. Interesting to see if these could be put to use. A perfectly good Volkwagen engine would never be pitched.

    The technology already exist to pitch the Toyota ECUs with units that can do the new stuff needed (but at NOWHERE close to the same price range). I don't care about the protocols, code format, internal architecture etc. These get pitched with the ECU. What is needed are the core algorithms. Without fully understanding these, you would change a very safe car into a very dangerous vehicle....and I'm not interested in anything other than a safe conversion.
     
  6. 8AA

    8AA Active Member

    Joined:
    Feb 29, 2004
    550
    62
    0
    Location:
    Maryland
    Vehicle:
    2004 Prius
    I'd like to see someone develop a Scantool emulator. I'm not interested in changing the inner workings of the Prius, but rather the simple things that are supposed to be customizable like the brightness of the dashboard lights. And yes, I have asked several dealerships, and no, none of them will make any adjustments for me.
     
  7. ken1784

    ken1784 SuperMID designer

    Joined:
    Dec 18, 2003
    2,940
    1,359
    67
    Location:
    Yokohama, JAPAN
    Vehicle:
    2010 Prius
    Model:
    N/A
    <div class='quotetop'>QUOTE(FL_Prius_Driver @ Jul 4 2007, 09:05 AM) [snapback]472619[/snapback]</div>
    I believe it is lot easier to make a pure EV than gas/electric hybrid.
    Please remember that there were a lot of EV's before the Ford T-model.

    Ken@Japan
     
  8. Pegasus_

    Pegasus_ New Member

    Joined:
    Jun 24, 2007
    41
    1
    0
    Location:
    Spangdahlem, Germany
    Vehicle:
    2007 Prius
    <div class='quotetop'>QUOTE(ken1784 @ Jul 4 2007, 08:56 AM) [snapback]472859[/snapback]</div>
    Indeed. But the easiest way to retrofit a Prius to be an EV is to just add batteries and leave the stuff under the hood alone, just as the existing conversions do. Obviously making changes to the HV & Battery ECUs would help alot though.

    I suppose you cound find a wrecked Prius and harvest the inverter and MG2 from it, then install them into another chassis as the drive components for a pure EV. This would still require changing the inverter's control code to make it work with a different vehicle.
     
  9. bobdavisnpf

    bobdavisnpf Member

    Joined:
    Aug 11, 2006
    149
    4
    0
    Toyota made their position pretty clear recently, and it is a prudent course for addressing such a litigation-happy market as the US. :rolleyes: Heck, if someone *did* hack the actual Prius code, and it resulted in a US citizen spilling coffee on their lap, Toyota would probably get sued for not tracking down and suing the modder!

    I now doubt we'll see the first sanctioned or mass-affordable PHEV from Toyota. With 3 Prii in the driveway, it'll be hard to write Toyota off. :( But it looks like Ford and GM are the new ponies to bet on. B)
     
  10. apriusfan

    apriusfan New Member

    Joined:
    Apr 8, 2007
    6,050
    205
    0
    Location:
    S.F. Bay Area
    Vehicle:
    2007 Prius
    <div class='quotetop'>QUOTE(bobdavisnpf @ Jul 4 2007, 08:20 AM) [snapback]472885[/snapback]</div>
    Personally, I would bet on GM before Ford. Ford is still trying to get their "restructuring" sorted out. GM is way down the learning curve compared to Ford.
     
  11. FL_Prius_Driver

    FL_Prius_Driver Senior Member

    Joined:
    Jun 17, 2007
    4,319
    1,527
    0
    Location:
    Tampa Bay
    Vehicle:
    2010 Prius
    Model:
    I
    There are going to be a lot of NHW20's (2004 to 2009? Prius) around for a while. The electric cars will not show up in volume for quite a few more years. the NHW20 is really well suited for a total conversion in some respects:

    1) The engine is not necessary for air conditioning, brakes, power steering, and other aspects.
    2) If you remove the engine and associated cooling, filters, fuel, etc. you free up quite a bit of weight and space
    3) The present engine is 57kW max plant so getting a motor withing this range is not insane. Having it mimic an engine is probably straightforward.

    It is not well suited for a conversion in other aspects:

    1) A lot of inefficiency having three motors doing the work of one.
    2) Hacking the existing ECUs could be harder than outfitting custom designs.
    3) The PHEV efforts make more sense.

    Much more homework needed.
     
  12. forrest_fire1

    forrest_fire1 Junior Member

    Joined:
    Jul 1, 2007
    27
    4
    0
    Location:
    Oregon, Roseburg
    Vehicle:
    2011 Prius
    Model:
    V
    <div class='quotetop'>QUOTE(samiam @ Jul 1 2007, 09:23 PM) [snapback]471349[/snapback]</div>

    ? what is that picture of?
     
  13. ken1784

    ken1784 SuperMID designer

    Joined:
    Dec 18, 2003
    2,940
    1,359
    67
    Location:
    Yokohama, JAPAN
    Vehicle:
    2010 Prius
    Model:
    N/A
    <div class='quotetop'>QUOTE(FL_Prius_Driver @ Jul 5 2007, 11:00 AM) [snapback]473243[/snapback]</div>
    The success of NHW-20 Prius is that three motors work together very efficiently.

    Ken@Japan
     
  14. aeronaut

    aeronaut New Member

    Joined:
    May 19, 2007
    29
    1
    0
    Location:
    Evanston, Il
    <div class='quotetop'>QUOTE(FL_Prius_Driver @ Jul 3 2007, 07:05 PM) [snapback]472619[/snapback]</div>
    FL_Prius_Driver,

    Here's what you want:

    http://www.teslamotors.com/index.php

    The appeal of a Prius is that it can be efficient on short trips, and still drive cross country (unlike any full EV,) and of course, doesn't cost 6 figures like a Tesla Roadster.

    Regards,
    aeronaut
     
  15. aeronaut

    aeronaut New Member

    Joined:
    May 19, 2007
    29
    1
    0
    Location:
    Evanston, Il
    <div class='quotetop'>QUOTE(FL_Prius_Driver @ Jul 1 2007, 04:34 PM) [snapback]471147[/snapback]</div>
    FL_Prius_Driver,

    I've been writing and modifying code for more than 20 years. All the problems you mention are solvable. For example, I specifically mentioned having a number of settings possible for the accelerator/decelerator, and allow the display to select among them. Drive to a test site in factory mode. Change the settings, and test them out. In the event of a problem, shift to neutral and use the emergency break. Change back to factory settings to drive home. Not hard at all, once the initial hurdles are solved.

    I mean, it's like asking how do you know that when you turn on your kitchen faucet, you won't get a jet of water moving at 200 mph coming out? I'd know because I know what I'm doing, and would have a full understanding of the factory code and how it works before making any attempt to change it. It's pretty similar to what I do in my research, writing and modifying code for granular flow simulations. My brother in law works for Raytheon, and is working on the code for smart munitions. Now there's a place where a code error can really cause unnecessary fatalities.

    The question to me is what is the amount of work needed to get to a point where I could make these code changes safely and knowledgably.

    Finally, as I have said, the first change should be to the screen displays. Getting the "instantaneous" MPG display to update every second instead of every 3 seconds. Displaying minute bars instead of 5 minute bars. Making the maximum MPG possible go up to say 200, instead of 99.9, and use intelligence to set the range. The screen has the resolution, and there should be sufficient data and memory to make these changes. And if I mess it up, all that happens is that the consumption screen is messed up. Maybe even show tiny icons for the ICE, motor, Battery, and tires with power arrows on the consumption screen.

    I value my life, other people's lives, and then the investment I've made in my Prius. I just want to make some small changes to make it better. Is it a cost effective use of my time - that's the question.

    Regards,
    aeronaut
     
  16. ken1784

    ken1784 SuperMID designer

    Joined:
    Dec 18, 2003
    2,940
    1,359
    67
    Location:
    Yokohama, JAPAN
    Vehicle:
    2010 Prius
    Model:
    N/A
    <div class='quotetop'>QUOTE(aeronaut @ Jul 7 2007, 03:01 PM) [snapback]474509[/snapback]</div>
    You can make your own mileage meter rather than hack the Prius computer.
    http://priusdiy.fc2web.com/NENPIKEI.html
    http://www.greenhybrid.com/discuss/showpos...mp;postcount=77
    My SuperMID can display the "instantaneous" MPG every 0.5 second and up to 235 mpg (99.9 km/L).

    Ken@Japan
     
  17. FL_Prius_Driver

    FL_Prius_Driver Senior Member

    Joined:
    Jun 17, 2007
    4,319
    1,527
    0
    Location:
    Tampa Bay
    Vehicle:
    2010 Prius
    Model:
    I
    I agree the problems are solvable, and do not want to come across as being anything other than positive. One concern is that the person who gets to declare the approach safe is the same one who is making the modifications....but this to is solvable. (Bet your brother-in-law does not get to install the code until a lot of others have independently checked.)

    Also, by the way, long ago on a Navy ship I opened the faucet and the water came out at 150 psi, since a reducing valve failed. Soaked the entire space with a roar till the isolation valves were secured. Knocked me on my a** in absolute terror. You are right, you do not expect the water to come out at 200mph. Understand your analogy, but made me laugh (now) since it seemed to emphasize my point.

    The core point is that I have not found, nor may find, the algorithms used to control the individual devices (ICE, MG1,2, HV Battery). Then there are the total vehicle control algorithms in the HV ECU that depends on specific behavior of the core components. On top of that is a whole set of failsafe modes of operation. All said, it is unlikely that one individual could understand all the interrelations with no documentation in any reasonable amount of time. But this is opinion and being proven wrong would be welcome.

    A coordinated PHEV group is making progress in the PHEV Prius world. A lot of homework being done on my part, but details of HV ECU algorithms still needed.
     
  18. pachai

    pachai Junior Member

    Joined:
    Nov 28, 2007
    20
    0
    0
    I just wanted to say - I am happy to have found this section.

    I have my list. (The first 3 have been solved :)
    *Always-on power socket (partly done, left my dmm home today ;-)
    *EV Mode - for driving down the block without gas
    *PHEV - for driving all around town without gas
    *Alternate authentication. I mentioned once before, if I lost my key,
    I would like to have a keypad to log in with.
    I can think of a 36-digit number that I can type in 15 seconds,
    will never forget, and neither would my wife forget it.

    I know "the computer won't run without the keyfob" - but
    I don't believe that this can't be hacked/spoofed, etc.

    The most-asked question on Sun-Managers mailing list
    (where the computers cost around $100,000) is
    "I lost/changed/forgot the priviledged password, what now?"
    (and I know how answer this question :)

    Physical access to the LAN (CAN?) and the FOB,
    and a little documentation ought to be a good starting point.
     
  19. Pegasus_

    Pegasus_ New Member

    Joined:
    Jun 24, 2007
    41
    1
    0
    Location:
    Spangdahlem, Germany
    Vehicle:
    2007 Prius
    Well? Any updates here?

    What I'd really like to see is the decision logic for when the engine gets turned on & off. Lately my engine has been running for no apparent reason while coasting, and it's not even cold out! Good thing I have the EV button installed or I'd be very annoyed. ;)
     
  20. ken1784

    ken1784 SuperMID designer

    Joined:
    Dec 18, 2003
    2,940
    1,359
    67
    Location:
    Yokohama, JAPAN
    Vehicle:
    2010 Prius
    Model:
    N/A
    You're in Stage 3a. Please be aware of warming up stages.
    GreenHybrid - Hybrid Cars - View Single Post - Comments on the FAQ

    Ken@Japan