Difference between revisions of "Tesla"

From comma wiki
Jump to: navigation, search
(wording change)
(Hardware Costs / Functionality / Limitations)
(186 intermediate revisions by 31 users not shown)
Line 1: Line 1:
 
[[Category:Vehicle_Makes]]
 
[[Category:Vehicle_Makes]]
 +
 +
{| class="wikitable sortable"
 +
! If you intend to use OpenPilot with the Tesla AutoPilot UI '''DO NOT UPDATE YOUR FIRMWARE''' without first chatting with the team on the Discord channel!
 +
|}
 +
 +
{| class="wikitable sortable"
 +
! Tesla software version up to 2019.16.2 is safe to use or update to.
 +
|}
  
  
Line 6: Line 14:
 
We're just getting started filling this out, so feel free to jump in and help document things that need to be here.
 
We're just getting started filling this out, so feel free to jump in and help document things that need to be here.
  
This port is currently focused on the Pre-AP Teslas from 2014 and earlier. The EPAS (Electric Power Assisted Steering) unit on these pre-AP Teslas is capable of steering itself based on electronic commands like the AP1 and 2 Teslas, but since they don't have autopilot there's a kill signal that is sent to disable this feature. Because of this, we have to proxy the CAN-bus messages through the panda which will alter that kill signal and change it to an enable signal. To accomplish this, you have to remove the frunk liner to get at the EPAS unit, and unplug the factory cable and plug in a bypass cable that allows for this proxying. This cabling also allows OpenPilot to send the steering commands to the car.  
+
This port is currently focused on bringing Openpilot to Teslas from 2014 and earlier, before Autopilot was offered.
 +
 
 +
For the most updated information please visit Tinkla[https://tinkla.us/index.php/Welcome_to_Tinkla!]  '''DO NOT''' install this without joining our discord community. This is a safety reason since Tesla can and has changed CAN messages.  If you run this, we need to be able to notify you in this event to keep you safe.
 +
 
 +
=== Hardware Costs / Functionality / Limitations ===
 +
{| class="wikitable sortable"
 +
! Base
 +
! Cost
 +
! Functionality
 +
! Limitations / Notes
 +
|-
 +
| EON (or FrEON)
 +
| $599 -> Comma AI (or build your own FrEON)
 +
| Vision for Lane Keeping, Visual Radar, ACC, ALC
 +
| Manual Braking -> Only automatic braking available is regenerative braking which is not sufficient.
 +
|-
 +
| White Panda
 +
| $100 -> Comma AI
 +
| WIFI and Can Bus, Grey also works
 +
| Visual Radar is not accurate -> ALC is blind!
 +
|-
 +
| Giraffe
 +
| $125 + shipping -> [Ask on Discord, #tesla channel]
 +
| CAN Bus - Steering, Cruise Control
 +
| Manual Acceleration below 18MPH -> Acceleration is only possible when cruise control is active
 +
|-
 +
| EPAS Cable
 +
| $100 -> Digikey or Mouser
 +
| Steering
 +
| You must make your own cable - refer to info on this wiki page
 +
|-
 +
|-
 +
! Upgrades
 +
! Cost
 +
! Functionality
 +
! Limitations / Notes
 +
|-
 +
| Comma Pedal
 +
| ?? -> @chase or @wocsor
 +
| Accelerator Pedal Proxy - Allows automatic acceleration from 1 MPH
 +
| Comma does not sell these, they are only available as partial kits from community members or as Fab your own PCB designs on Comma's github
 +
|-
 +
| Ultrasonic Parking Sensors + Wiring
 +
| $180? -> AliExpress
 +
| Assist in ALC, possibly also with blindspot detection and maybe eventually auto-park
 +
| '''Requires Root''' to install
 +
|-
 +
| Radar retrofit
 +
| $500? -> Ebay or Purchase from Tesla Parts Dept
 +
| Allow for more accurate ACC
 +
| '''Requires Root''' for Tesla IC radar display (will still work with EON)
 +
|-
 +
| iBooster2 retrofit
 +
| $1500?
 +
| Allow car to brake to a stop through automation
 +
| '''Requires Root''' to install and has lots of dependencies, do NOT attempt till we have full details.
 +
|}
 +
 
 +
These are approximate costs of parts and materials only, it is assumed you will do your own labor.
 +
 
 +
=== Status of Lateral control (steering) ===
 +
OpenPilot lateral control is working.
 +
 
 +
Electronic steering is present in pre-autopilot Teslas, but disabled. The Electric Power Assisted Steering units (EPAS) are capable of turning the steering wheel electronically if fed the right commands.
 +
With that in mind, we run a cable from the car's EPAS unit in the frunk to a comma.ai Panda. It allows us to:
 +
# Intercept messages the car periodically sends that disable the EPAS' steering feature.
 +
# Transmit steering commands from a comma.ai EON to the EPAS unit.
 +
This setup allows the car to steer autonomously.
 +
 
 +
=== What about warranty or car service? ===
 +
 
 +
==== Is it legal to modify your Tesla? ====
 +
 
 +
As long as you own the vehicle (not leasing), you can do whatever you like to it as it is your property. 
 +
 
 +
==== Do I need to remove the Panda/Giraffe/EPAS cable when the car goes in for service? ====
 +
 
 +
Nope.  Tesla uses an ethernet based diagnostics port rather than the obd2 that the giraffe plugs into.
 +
 
 +
==== Does it void your warranty? ====
 +
 
 +
Under [https://en.m.wikipedia.org/wiki/Magnuson–Moss_Warranty_Act Magnuson-Moss] a dealer must prove that modifications lead to the specific failure that is claimed against the warranty.
 +
 +
I.e. if a door handle stops working, you would still be covered for that; if you upgrade your brakes to ibooster2 and your brakes have an issue, you may not be covered.
 +
 
 +
 
 +
 
 +
=== Status of Longitudinal control (accelerator and brakes) ===
 +
Longitudinal control is an ongoing effort. These cars lack electronic pedal control and radar.
 +
 
 +
As of 2019 we have both software-only and hardware-based Adaptive Cruise Control.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Distance detection technique
 +
! Precision
 +
! Cost
 +
! Status
 +
|-
 +
| Use the EON's computer vision
 +
| Low
 +
| None
 +
| Implemented
 +
|-
 +
| Install a radar unit
 +
| High
 +
| ~$300
 +
| Implemented
 +
|}
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Speed control technique
 +
! Brake power
 +
! Min speed
 +
! Installation
 +
! Cost
 +
! Status
 +
|-
 +
| Hijack normal cruise control commands
 +
| Weak (regen only)
 +
| 18mph
 +
| None
 +
| None
 +
| Implemented
 +
|-
 +
| Install a comma.ai Pedal proxy
 +
| Weak (regen only)
 +
| 0mph
 +
| Some assembly required.
 +
| ~$100
 +
| Implemented
 +
|-
 +
| Install electrically controllable pedals
 +
| Full
 +
| 0mph
 +
| Very difficult installation.
 +
| >$600
 +
| Not implemented
 +
|}
  
 +
 +
==== Adaptive Cruise Control ====
 +
ACC allows the car to match speed with cars in front of you. The EON judges distances using the camera and dynamically adjusts cruise control speed. There are plenty of downsides to this strategy. The distance estimates are inaccurate. It only operates above 18 mph. The speed changes are not very smooth. And it can't handle sudden slowdowns so YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT. But it works without any new radar/pedal hardware.
 +
 +
To repeat, YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT!
 +
 +
Follow these steps to use ACC:
 +
# Press the cruise stalk IN so that the orange "cruise control ready" LED on the stalk is lit.
 +
# Enable the ACC option on screen if necessary.
 +
# Accelerate above 18 MPH.
 +
# Enable OpenPilot using a DOUBLE stalk pull (pull the cruise control stalk BACKWARDS TWICE in quick succession.) You will see the blue 'Cruise' icon appear on your dash. ACC is now active.
 +
# The initial max speed may be conservative. Press UP on the stalk to increase it.
 +
# Cruise is disabled if you brake or the car slows below 18 MPH.
 +
# If ACC "AUTO" mode is enabled, manually accelerate above 18 MPH to resume.
 +
 +
Controls while ACC is enabled:
 +
{| class="wikitable"
 +
|-
 +
! Control
 +
! Action
 +
|-
 +
| Cruise stalk IN
 +
| Master toggle for cruise control. Must be engaged for cruise or ACC to work.
 +
|-
 +
| Cruise stalk DOUBLE PULL
 +
| Enable OP ACC and steering, and increase the max allowed ACC speed if necessary.
 +
|-
 +
| On screen ACC button
 +
| Toggle between "FOLLOW" and "AUTO" mode. FOLLOW mode attempts to match speed with cars in front of you and disengages if you steer or brake. AUTO mode does the same, but automatically re-engages when you accelerate again.
 +
|-
 +
| Cruise stalk UP
 +
| Increase cruise speed, increasing max allowed ACC speed if necessary.
 +
|-
 +
| Cruise stalk DOWN
 +
| Decrease cruise speed and max allowed ACC speed.
 +
|-
 +
| Cruise stalk PUSH
 +
| Disable OpenPilot (both steering and ACC). Max allowed ACC speed is reset to 0.
 +
|-
 +
| Brake pedal
 +
| Pause both ACC and traditional cruise.
 +
|-
 +
| Accelerator
 +
| (When in AUTO mode) Accel over 18 MPH to unpause ACC.
 +
|}
  
 
== Community ToDo List ==
 
== Community ToDo List ==
Line 15: Line 207:
 
* Open source giraffe hardware
 
* Open source giraffe hardware
 
* Code change to OP port to auto flash panda  
 
* Code change to OP port to auto flash panda  
* Add longitudinal control (this is a much larger issue than 1 bullet point)
+
* Refine longitudinal control (this is a much larger issue than 1 bullet point)
 
* Further testing of EPAS enable spamming  
 
* Further testing of EPAS enable spamming  
  
 
* Have more Teslas using OP than any other car!!! :)
 
* Have more Teslas using OP than any other car!!! :)
 
 
 
  
 
{| class="wikitable"
 
{| class="wikitable"
!colspan="3"|Confirmed Users with Working OP
+
!count
 +
!Confirmed Users with Working OP
 +
!Vehicle
 
|-
 
|-
 
|1
 
|1
 
|Kalud
 
|Kalud
|0.4.7
+
|2013 S P85
 
|-
 
|-
 
|2
 
|2
 
|zax123
 
|zax123
|0.3.5 (until next week)
+
|2013 S P85
 
|-
 
|-
 
|3
 
|3
 
|Bobby
 
|Bobby
|0.4.7
+
| 2012 S P85
 
|-
 
|-
 
|4
 
|4
 
|SteveRadich
 
|SteveRadich
|0.4.7
+
| 2013 S 85
 
|-
 
|-
 
|5
 
|5
 
|BogGyver
 
|BogGyver
 +
| 2014 S 85
 
|-
 
|-
 
|6
 
|6
 
|RobP
 
|RobP
 +
|2013 S P85
 
|-
 
|-
 
|7
 
|7
 
|Edgar
 
|Edgar
 +
|2012 S P85
 
|-
 
|-
 
|8
 
|8
|TBD
+
|JJ
 +
|2013 S P85+
 
|-
 
|-
 
|9
 
|9
|TBD
+
|David Abrahams (Git:AllWashedOut)
 +
| 2013 S 60
 
|-
 
|-
 
|10
 
|10
|TBD
+
|Shane Thomas
 +
| 2013 S P85+
 +
|-
 +
|11
 +
|Alex V
 +
|2014 S 85
 +
|-
 +
|12
 +
|sergiociba
 +
|2013 S 60
 +
|-
 +
|13
 +
|Bentis
 +
| 2014 S P85+
 +
|-
 +
|14
 +
|Moc
 +
| 2014 S 85
 +
|-
 +
|15
 +
|Sid
 +
|2014 S 85
 +
|-
 +
|16
 +
|MarcMarin
 +
|2013 S 85
 +
|-
 +
|17
 +
|FlyBoyn222pa
 +
|2013 S 85
 +
|-
 +
|18
 +
|BastyJuice
 +
|2013 S 85
 +
|-
 +
|19
 +
|Harrison
 +
|2013 S 85
 +
|-
 +
|20
 +
|André Juneau
 +
|2012 P 85
 +
|-
 +
|21
 +
|TonyT
 +
|2013 S P85
 +
|-
 +
|22
 +
|Rayminster
 +
|2014 S 85
 +
|-
 +
|23
 +
|K79
 +
|2014 S 85
 +
|-
 +
|24
 +
|Connann
 +
|2014 S P85
 +
|-
 +
|25
 +
|Raf
 +
|2014 S 60
 +
|-
 +
|26
 +
|DanielRTRD
 +
|2014 S 85
 +
|-
 +
|27
 +
|erflesby
 +
|2013 S P85
 +
|-
 +
|28
 +
|Perch Perkins
 +
|2013 S 60
 +
|-
 +
|29
 +
|Honken
 +
|2014 S P85
 +
|-
 +
|30
 +
|rieschrispy
 +
|2013 S P85+
 +
|-
 +
|31
 +
|CX25
 +
|2014 S 85
 +
|-
 +
|32
 +
|Mystique
 +
|2014 S 85
 +
|-
 +
|33
 +
|bry__
 +
|2013 S P85+
 +
|-
 +
|34
 +
|Mjsais
 +
|2013 S 85
 +
|-
 +
|35
 +
|F. John
 +
|2014 S 85
 +
|-
 +
|36
 +
|ctothek
 +
|2013 S 60
 
|-
 
|-
!colspan="2"|Bounty claimed!
+
|37
 +
|Mastro Gippo
 +
|2014 S P85+
 +
|-
 +
|38
 +
|Neon
 +
|2013 S P85+
 +
|-
 +
|39
 +
|Tesla310
 +
|2012 Sig S P85
 +
|-
 +
|40
 +
|eitupois
 +
|2013 Tesla S P85
 +
|-
 +
|41
 +
|Dan45
 +
|2013 S 85
 +
|-
 +
|42
 +
|ELicious
 +
|2012 Sig S P85
 
|}
 
|}
  
 
== Here's what you'll need to get OpenPilot working on your pre-AP Tesla ==
 
== Here's what you'll need to get OpenPilot working on your pre-AP Tesla ==
  
*[https://shop.comma.ai/products/eon-dashcam-devkit EON Dashcam DevKit ($699.00)]
+
*[https://shop.comma.ai/products/eon-dashcam-devkit EON Dashcam DevKit ($599.00)]
  
 
*[https://shop.comma.ai/products/panda-obd-ii-dongle Panda (white $99, grey $199)]
 
*[https://shop.comma.ai/products/panda-obd-ii-dongle Panda (white $99, grey $199)]
**Grey Panda includes high accuracy GPS which OpenPilot may use for more accurate steering in the future. So Grey is recommended but not strictly necessary today.
+
**Grey Panda includes high accuracy GPS which OpenPilot may use for more accurate steering in the future.  
 
+
*10 foot mini USB cable [https://www.amazon.com/gp/product/B00UY59OR6/ ($7 for this example cable)]
*[https://www.amazon.com/gp/product/B00UY59OR6/ 10 foot mini USB cable ($7 for this example cable)]
 
  
 
*Custom Giraffe and Wiring harness for the Model S.
 
*Custom Giraffe and Wiring harness for the Model S.
**There are 2 variations based on your car manufacture date (before or after May 31, 2013). If you are unsure, check if the OBD connector in your driver footwell is the [https://files.slack.com/files-pri/T02Q83UUV-FBA7L8727/obd.jpg newer style with metal contacts for pins 1 and 9]
+
**There are 2 variations of the giraffe based on your car manufacture date. If you are unsure, check if the OBD connector in your driver footwell. If it has pins 1 and 9 like [https://media.discordapp.net/attachments/524328474081755137/547869204074856478/CH_bus-2.jpg?width=1963&height=1258 this] then you need the giraffe with "Standard OBD Connector (Model S built after (May 31, 2013). For cars built before May 31, 2013, you need a giraffe with "TDC Connector". Your OBD port will be missing pins 1 and 9 and look like [https://cdn.discordapp.com/attachments/524328474081755137/547869208969478156/no_CH_bus-2.jpg this].
**Contact @appleguru in the #tesla channel on the comma slack to arrange purchase.
+
**Ask in the #tesla channel on the comma Discord to purchase a revB giraffe.
**Approximately $50 in parts for the giraffe, $10 for a case, and $25 in parts for the harness. Will cost more after assembly and shipping
 
  
 
Total price of parts is approximately $1,000.
 
Total price of parts is approximately $1,000.
  
 
== Instructions to set it all up ==
 
== Instructions to set it all up ==
(this is very much in progress and not yet complete)
+
 
 +
This first video walks you through the physical installation of parts from start to finish.
 +
*[https://youtu.be/v3jjzRYBsJI A great installation video by @JJ]
  
 
*[https://community.comma.ai/wiki/index.php/Installing_OpenPilot_on_the_EON Make sure your Eon is up to date] This will bring you to the latest version of OpenPilot and update your EON to the latest version of NEOS.  If you have problems they aren't Tesla related, check the other wiki / slack places.  
 
*[https://community.comma.ai/wiki/index.php/Installing_OpenPilot_on_the_EON Make sure your Eon is up to date] This will bring you to the latest version of OpenPilot and update your EON to the latest version of NEOS.  If you have problems they aren't Tesla related, check the other wiki / slack places.  
  
*[https://www.youtube.com/watch?v=JPNzmAprWZs Flip your EON]
+
*[https://www.youtube.com/watch?v=JPNzmAprWZs Flip your EON (Eon Gold do not need to be flipped)]
  
*[https://www.youtube.com/watch?v=JbPq1W_fYz4 Remove your frunk liner]
+
*[https://www.youtube.com/watch?v=QBtBIA_TmxM Remove your frunk liner(RWD)] [https://www.youtube.com/watch?v=JbPq1W_fYz4 (Dual Motor)]
  
 
*Install the wiring harness to the EPAS unit and the OBDII port in the driver footwell
 
*Install the wiring harness to the EPAS unit and the OBDII port in the driver footwell
 +
**Run the wire [https://www.youtube.com/watch?v=yrKGFJAK2Uk from the EPAS], [https://www.youtube.com/watch?v=ptRMPHO3qnA through the frunk], [https://www.youtube.com/watch?v=ElpHUdS6QY8 to the Panda in the footwell.]
  
 
*Install Panda on Giraffe OBDII port (driver footwell)
 
*Install Panda on Giraffe OBDII port (driver footwell)
Line 96: Line 420:
 
*Connect EON to Panda via USB cable  
 
*Connect EON to Panda via USB cable  
  
*[https://community.comma.ai/wiki/index.php/Configuring_OpenPilot Follow the instructions on this page to SSH into your EON]
+
*[https://community.comma.ai/wiki/index.php/Configuring_OpenPilot Follow the instructions on this page to SSH into your EON] [https://medium.com/@jfrux/comma-eon-getting-connected-with-ssh-3ed6136e4a75 This is also a good guide to connecting via SSH]
  
 
*Install custom tesla branch of OpenPilot on your EON by doing the following:
 
*Install custom tesla branch of OpenPilot on your EON by doing the following:
 
  cd /data
 
  cd /data
 
  mv openpilot openpilot.stock
 
  mv openpilot openpilot.stock
  git clone https://github.com/jeankalud/openpilot.git
+
  git clone https://github.com/BogGyver/openpilot.git
 
  cd openpilot
 
  cd openpilot
 
  git checkout tesla
 
  git checkout tesla
Line 107: Line 431:
  
 
*Update your Panda while SSH'ed in and Panda connected to ODB port and EON connected to Panda via USB ([https://github.com/jeankalud/openpilot/blob/tesla/panda/board/README.md perhaps]) - automated soon - Do we need to do this without data on bus?  
 
*Update your Panda while SSH'ed in and Panda connected to ODB port and EON connected to Panda via USB ([https://github.com/jeankalud/openpilot/blob/tesla/panda/board/README.md perhaps]) - automated soon - Do we need to do this without data on bus?  
 +
cd /data/openpilot/panda/board
 +
make
 +
make recover
 +
 +
*This is what it should look like for a successful flash. If you get something very different that has an error, check the connectivity between the EON and the Panda. Unplug it all and re-seat all the connections on Panda and giraffe.
 +
root@localhost:/data/openpilot/panda/board$ cd /data/openpilot/panda/board;make                                   
 +
PYTHONPATH=../ python -c "from python import Panda; Panda().flash('obj/panda.bin')"
 +
opening device 41001d000651363038363036 0xddcc
 +
connected
 +
opening device 41001d000651363038363036 0xddee
 +
connected
 +
flash: version is v1.1.2-unknown-DEBUG
 +
flash: unlocking
 +
flash: erasing
 +
flash: flashing
 +
flash: resetting
 +
opening device 41001d000651363038363036 0xddcc
 +
connected
 +
root@localhost:/data/openpilot/panda/board$
 +
 +
*If you're having trouble with the Panda not flashing correctly, here's a few things to try:
 +
Power cycle the Panda by unplugging it from the giraffe and reseating it again.
 +
 +
Run these commands on the EON to try and flash the Panda:
 +
 
  cd /data/openpilot/panda/board
 
  cd /data/openpilot/panda/board
 
  killall boardd
 
  killall boardd
 
  make clean
 
  make clean
 +
make
 
  make recover
 
  make recover
make
+
 
 +
 
 +
*Once Panda is successfully flashed, you need to reboot EON again (WHILE the EON is connected to panda via USB).
  
 
*[https://community.comma.ai/wiki/index.php/Installing_EON Mount your EON on your windshield]
 
*[https://community.comma.ai/wiki/index.php/Installing_EON Mount your EON on your windshield]
  
 +
*Once everything is set up and working, you'll need to drive for 5-10 minutes above 45mph to complete calibration.
 +
*Once you're done with calibration, OP can be activated by one pull of the cruise stalk toward you. This is independent of whether the Tesla cruise control is turned on or not.
 
Enjoy!
 
Enjoy!
  
 +
== Installation Tips ==
  
 +
=== EPAS Cable ===
 +
* You can follow Deftdawg's EPAS creation video here: https://www.youtube.com/watch?v=TIKGK0Iabtc
 +
** '''NOTE:''' It is not recommended to solder the JST2 plugs prior to fishing the wire into the driver footwell, so pause watching this video around the 34minute mark.  The fishing process can easily destroy JST2 solder joints, so it's better to fish the wire first and then strip and solder the connections on when the wire is already into the cabin.
  
 +
*Mouser shopping list:
 +
[https://www.mouser.com/ProductDetail/571-1-967616-1 Female connector]<br>
 +
[https://www.mouser.com/ProductDetail/571-5-962885-1-LP Female pins]<br>
 +
[https://www.mouser.com/ProductDetail/571-1-967587-3 Male connector]<br>
 +
[https://www.mouser.com/ProductDetail/571-1-928918-1-CT Male pins]<br>
 +
[https://www.mouser.com/ProductDetail/571-967067-1 Rubber seal plug]<br>
 +
[https://www.mouser.com/ProductDetail/571-967056-1 Rubber seal for cable]<br>
 +
 +
* Use velcro ties to secure the EPAS Cable to the existing harness in the car until you are sure everything works and you won't be needing to remove EPAS cable to work on it further.
 +
 +
* Fish the unfinished end of the cable under the washer container, then through the first hood metal support piece to the gap and then pull all of the slack through that gap.  Reinsert the unfinished end back into the gap while keeping a finger or screw driver under it to keep the cable from falling down flat into the gap, this will help the cable not catch on where the second metal hood support meets the body as you push the cable towards the cabin.  Once the cable emerges next to the door seal, pull it through from the cabin side and work it in behind the seal and the diagnostics port.
 +
 +
* Once the cable is in the gap between the driver left side footwell cover and the panel containing the OBD2 port, do your soldering of the JST2 connector.
 +
 +
* Prior to connecting the cabling, it's a good idea to test your EPAS cable for continuity and shorts [this is for your sanity, nothing bad will happen if you skip this]
 +
** '''Shorts:''' with the EPAS cable not plugged into the Car or the giraffe, put spare pins into 2 and 5 and touch your leads to them.  If you get continuity make sure that the pins are not in contact, if they are not in contact double check the insulation on your solder connections to your JST2 plug.
 +
** '''Continuity:''' with the spare pins still inserted in 2 and 5, jumper the JST2 plug end.  Touch your leads to the 2 and 5 pins, if you get continuity make sure that the pins are not in contact, if they are not, then the cable is good.  If you get no continuity, check that your solder connections to the JST2 plug haven't been broken.
 +
 +
* Plug your panda into your giraffe, plug your giraffe into your OBD2 plug...  The car may give you some error messages about parking brake, etc...  Connect your EON to the panda via the USB cable.  Turn on tethering in the EON and connect to the EON hotspot, then ssh to 192.168.43.1 port 8022 using the OpenPilot RSA key and flash your panda.  Once flashing is complete, you can disconnect your EON again, remove and reinsert your giraffe, hopefully the car should not complain (if it does let us know, but continue anyway).
 +
 +
* With a good cable, you can remove any testing jumpers and spare pins and connect to to the EPAS servo unit and connect it to the giraffe.  Again the car should not complain.  If you get an error that "Power Assist is not available", it means that your CAN +/- pins (2 and 5) need to be flipped.  You test this by cross wiring a JST2 connector to a JST2 plug and then inserting that between your JST2 connector and EPAS cable...  If you do this, you may need to put the car in drive and manually feel if power steering works before the error clears (if steering is normal the error should clear, if not it will feel very heavy).  The easiest way to resolve this is to disconnect the JST2 cable from the giraffe and use a small edge to lift the plastic lock tab while depressing the spring clip to release the JST2 connects and then insert black in the red position and vice-versa, the plug the JST2 cable back into the giraffe, put the car in drive and recheck the steering.
 +
 +
=== Tucking the USB and Grey panda antenna cable into the Headliner ===
 +
* Pull your USB and GPS antenna cables from the footwell gap where the OBD2 port is up to where the "A" pillar is...
 +
* Follow the instructions to remove the air bag cover from the "A" pillar
 +
* Pull the USB and GPS antenna cables up the height of the "A" pillar across the the mirror holding them close to the headliner.  Adjust the length and to reach where you will place your panda and your EON.  The GPS receiver can be placed under the mirror ''Frit'', it won't effect performance (the pattern is only to prevent glare on the mirror).   
 +
* Drape the receiver and USB plug ends over the rear view mirror.
 +
* Move to the corner where the headliner and the removed airbag panel intersect, this corner is the easiest place to stick a pry tool...  Using your pry tool lift the corner and move the pry-tool along the top of the windshield tucking the two wires into the headliner as you go.  When you reach the mirror base, this can be lifted slightly route the GPS into the headliner crossing in between headliner and mirror base, while the EON USB cable can be routed down the front of the windshield to emerge at the bottom of the mirror base closer to the centre of the windshield.
 +
* Once the cabling is tucked in the headliner, move back to the "A" pillar and tuck the cable into the pillar cover routing it down towards the door seal, then secure the pillar cover to conceal the wiring.
  
 
=== First Troubleshooting steps: ===
 
=== First Troubleshooting steps: ===
 +
* If you're getting power steering errors after flashing panda, make sure you reboot EON while it's connected to Panda via USB
 
* Try a different USB cable (a shorter one, or one with EMI filter)
 
* Try a different USB cable (a shorter one, or one with EMI filter)
 +
* Ensure that the mini USB cable is fully seated in the EON. Trim of about 2 mm of plastic on the front of the connector plug if the USB in the EON housing seems to have been pushed in.
 
* Make sure you're using the correct tesla repo
 
* Make sure you're using the correct tesla repo
 
* run make in /data/openpilot/panda/board
 
* run make in /data/openpilot/panda/board
Line 133: Line 522:
 
  cd /data
 
  cd /data
 
  mv openpilot openpilot.bak
 
  mv openpilot openpilot.bak
  git clone https://github.com/jeankalud/openpilot
+
  git clone https://github.com/BogGyver/openpilot.git
 
  cd openpilot
 
  cd openpilot
 
  git checkout tesla
 
  git checkout tesla
 
  cd panda/board
 
  cd panda/board
 
  make clean
 
  make clean
  make recover
+
sleep 5 # (Skip this if running commands individually.)
  make  
+
  make
 +
  make recover
 
  reboot
 
  reboot
 +
* If you are getting a message about having to recalibrate or re-position the EON, do this:
 +
<pre>rm /data/params/d/CalibrationParams
 +
reboot</pre>
  
 
== How to change to the development branch of the Tesla OP port ==
 
== How to change to the development branch of the Tesla OP port ==
Line 195: Line 588:
 
</nowiki>
 
</nowiki>
  
 +
 +
==Editing your Bash Profile==
 +
In order to edit the .bash_profile on the EON, first you have to move your the home directory by typing
 +
cd
 +
Then, you have to mount the file system in Read/Write mode by typing
 +
mount -o rw,remount /system
 +
At this point you can edit your .bash_profile file by typing
 +
vi .bash_profile
 +
First, locate the PYTHONPATH line and delete it.
 +
Then, at the end of your file, paste the following code
 +
# add these symlinks if you want
 +
export PYTHONPATH="/data/openpilot"
 +
export GIT_SSH_COMMAND="ssh -i /data/gitkey"
 +
cd /data/openpilot/selfdrive/car/tesla
 +
 +
alias cdo='cd /data/openpilot'
 +
alias cdt='cd /data/openpilot/selfdrive/car/tesla'
 +
alias cdp='cd /data/openpilot/panda/board'
 +
alias sop='grep -rni --include=\*.{py,h,c} /data/openpilot/ -e '
 +
alias mrw='mount -o rw,remount /system'
 +
alias dbp='python /data/openpilot/panda/tests/debug_console.py | grep -v "can_push failed"'
 +
alias vic='vi /data/openpilot/selfdrive/car/tesla/carcontroller.py'
 +
alias vii='vi /data/openpilot/selfdrive/car/tesla/interface.py'
 +
alias vit='vi /data/openpilot/selfdrive/car/tesla/teslacan.py'
 +
alias vis='vi /data/openpilot/selfdrive/car/tesla/carstate.py'
 +
alias viu='vi /data/openpilot/selfdrive/ui/ui.c'
 +
alias lop='cd /data/openpilot;./launch_openpilot.sh'
 +
alias gp='git commit; git push'
 +
alias sp='/data/data/com.termux/files/continue.sh'
 +
 +
Save the profile and you're done!
 +
If you contribute code, you might also at this point want to configure your git to save your username and password. To do that you just to a push when you still have the file system in RW mode ( or you can use the *mrw* command later to make it RW)
 +
$ git config credential.helper store
 +
$ git push https://github.com/repo.git
 +
Username: <type your username>
 +
Password: <type your password>
 +
 +
$ git push https://github.com/repo.git
 +
[your credentials are used automatically]
 +
 +
 +
Keep in mind the credentials are stored in
 +
.git-credentials
 +
in plain text. They are in the format
 +
https://user%40email.com:pass@github.com
 +
where *user@email.com* is your username and *pass* is your password.  So you can also just edit that file and modify as needed. Just replace *@* with *%40* in your email address.
 +
Now, about those shortcuts above:
 +
mrw - make read / write - makes the file system writeable
 +
sop - search OpenPilot - searches the whole OP structure for the keyword that follows - example: sop user_brake
 +
sp - starts OpenPilot after you killed it with tmux -a
 +
dbp - debug panda - launches the debugger for panda
 +
gp - git commit and push - if you saved your credentials this makes commit and push so easy; just add your comment and you're done
 +
cdt - change directory to /data/openpilot/selfdrive/car/tesla folder; this is also the folder when you will now start every time you ssh into your EON
 +
cdo - change directory to /data/openpilot
 +
cdp - change directory to /data/openpilot/panda/board
 +
vic - starts vi for /data/openpilot/selfdrive/car/tesla/carcontroller.py from any folder
 +
vii - starts vi for /data/openpilot/selfdrive/car/tesla/interface.py from any folder
 +
vis - starts vi for /data/openpilot/selfdrive/car/tesla/carstate.py from any folder
 +
vit - starts vi for /data/openpilot/selfdrive/car/tesla/teslacan.py from any folder```
  
  
'''Most of the action is happening in the #tesla channel on the comma slack:'''
+
==Script to auto delete files to keep EON from filling up==
https://comma.slack.com
+
This script comes courtesy of @Sid and updated for OP0.5 by @Tentious
  
'''Current Tesla branch URL:'''  
+
Save the following script and run it on your EON. It will install into a cron job a script that checks every hour to see if you're almost full and delete the oldest files if necessary.
 +
 
 +
https://gist.github.com/tentious/b0de19dfecefc2547b4a07c31174aac3
 +
 
 +
==Aligning your EON==
 +
===What you need===
 +
*Measuring tape
 +
*Masking tape
 +
*A friend to help
 +
===Instructions===
 +
# Find a place at the bottom of the windshiled along the driver side pilar that has a similar position on the passenger side (I used the place where the corner of the front hood meets the fender).
 +
# With the tape starting from that point, mark 3 places along the side of the windshiled. Use the endge of the masking tape to mark them. I personally used 3" from the bottom, the top of the windshield and then about 1/3 from the bottom, 2/3 from the top. It does not matter what the measuring tape says, as long as it says the SAME distance on both sides.
 +
# Repeat the process on the other side of the windshiled, ensuring you mark the same spots.
 +
# measure the distance between one edge of the windshield and the other end, keeping the tape at each pair of marked points from before. use masking tape to mark the middle of the windshield. again, use the EDGE of the tape, not the center.
 +
# Now use a long piece of masking tape to mark the center of the windshield from top to bottom. This (if you did everything correctly) will cover all 3 of your markers from before and provide a straight line. One edge of the masking tape is now the perfect middle of the windshild. Your mount will have to be aligned with that for a perfect position.
 +
# Take a small piece of tape and mark the middle of the GoPro mount. use a slighly longer piece that the go-pro (maybe 1/4-1/2" more on each side) and ensure it is straight and down the middle of the GoPro. If, when looking from inside of the car, your take is to the RIGHT of the center, then put the tape on the LEFT side of the GoPro. Reverse if the other way.
 +
# Using your EON without the mounting braket, determine the location along the center of the windshield where you want it placed.make sure the grove on the support is alongside the center of the windshield. use a small piece of maksing tape to mark the upper part of the position where you want your EON to be.
 +
# Remove the RED protective tape from the back of the 3M adhesive and be ready to place the GoPro on the windshiled. Align the masking tape we placed on the GoPro mount on the inside with the masking tape we have on the outside of the windshield. They shoud not overlap at all AND you should not see light either. when you are confident on the position press hard on the mount.
 +
# Remove all masking tape. You are done. You now have a perfectly centerd, perfectly vertical EON.
 +
 
 +
 
 +
== Placeholder for pedal instructions ==
 +
 
 +
Pedal connectors for Tesla can be purchased
 +
[https://www.amazon.com/gp/product/B07GZY4ST4/ref=oh_aui_search_asin_title?ie=UTF8&psc=1 here]
 +
 
 +
Getting pedal physically in the car:
 +
[https://evtun.com/teslachip.html Tesla chip is a similar install]
 +
 
 +
Flashing:
 +
[https://medium.com/@jfrux/flashing-the-comma-pedal-with-ubuntu-a83fb668f6e2 Guide to flashing the pedal]
 +
 
 +
Best way to flash it is to connect pedal straight to EON, go to panda/board/pedal and just type
 +
make recover
 +
 
 +
Summarized wiring info:
 +
#Wire the connectors to the board on the left and right sides of the Pedal using this diagram: https://i.imgur.com/kmH0CBR.png
 +
#If you have a revB giraffe and an RJ45 connector on your pedal, just plug a straight through (not crossover) CAT5e cable in to the RJ45 on your pedal and the RJ45 on your giraffe labelled "Comma"
 +
#If you have no RJ45 connector on your pedal board, connect pedal RJ45 pin 3 (Green / White) to the EPAS CAN -, and RJ45 pin 6 (Green) to the EPAS CAN +
 +
 
 +
 
 +
'''Most of the action is happening in the #tesla channel on the comma discord server:'''
 +
https://discord.comma.ai/
 +
 
 +
'''Current Kalud Tesla branch URL:'''  
 
https://github.com/jeankalud/openpilot/
 
https://github.com/jeankalud/openpilot/
 +
 +
'''BogGyver Tesla branch URL:'''
 +
https://github.com/boggyver/openpilot/
 +
 +
'''BogGyver pedal branch URL:'''
 +
https://github.com/boggyver/openpilot/tree/tesla_pedal
  
 
'''Some background info on the tesla port:'''  
 
'''Some background info on the tesla port:'''  
 
http://openpilot.robertcotran.com/
 
http://openpilot.robertcotran.com/
 +
 +
'''Last known safe Tesla software update version:'''
 +
2019.16.2
  
 
== Glossary/Acronyms ==
 
== Glossary/Acronyms ==
Line 215: Line 720:
 
:Comma's system for playing back and showing the recorded data from uploaded drives.
 
:Comma's system for playing back and showing the recorded data from uploaded drives.
 
;CAN,CAN-bus
 
;CAN,CAN-bus
:[https://en.wikipedia.org/wiki/CAN_bus Controller Area Network] This is a network system inside cars that allow messages to be sent to different auto components.
+
:[https://en.wikipedia.org/wiki/CAN_bus Controller Area Network] This is a network system inside cars that allow messages to be sent to different auto components. With the Giraffe/Panda/EON setup described above, the Panda's CAN bus 0 is for chassis messages and CAN bus 2 is for the isolated EPAS. The Panda proxies messages between the two (except for the EPAS kill message which is blocked.)
 
;Chassis Can
 
;Chassis Can
 
:Steering and braking controls are found on this CAN-bus, so this is the main one that OP uses.
 
:Steering and braking controls are found on this CAN-bus, so this is the main one that OP uses.
 +
;CID
 +
:Center Information Display. Same thing as the MCU, ie, the big screen in the Tesla.
 
;DAS
 
;DAS
 
:Driver assistance system - the AP1 camera/computer module located behind the windshield on AP1 hardware cars
 
:Driver assistance system - the AP1 camera/computer module located behind the windshield on AP1 hardware cars

Revision as of 18:32, 1 October 2019


If you intend to use OpenPilot with the Tesla AutoPilot UI DO NOT UPDATE YOUR FIRMWARE without first chatting with the team on the Discord channel!
Tesla software version up to 2019.16.2 is safe to use or update to.


Welcome to the Tesla Openpilot Wiki!

We're just getting started filling this out, so feel free to jump in and help document things that need to be here.

This port is currently focused on bringing Openpilot to Teslas from 2014 and earlier, before Autopilot was offered.

For the most updated information please visit Tinkla[1] DO NOT install this without joining our discord community. This is a safety reason since Tesla can and has changed CAN messages. If you run this, we need to be able to notify you in this event to keep you safe.

Hardware Costs / Functionality / Limitations

Base Cost Functionality Limitations / Notes
EON (or FrEON) $599 -> Comma AI (or build your own FrEON) Vision for Lane Keeping, Visual Radar, ACC, ALC Manual Braking -> Only automatic braking available is regenerative braking which is not sufficient.
White Panda $100 -> Comma AI WIFI and Can Bus, Grey also works Visual Radar is not accurate -> ALC is blind!
Giraffe $125 + shipping -> [Ask on Discord, #tesla channel] CAN Bus - Steering, Cruise Control Manual Acceleration below 18MPH -> Acceleration is only possible when cruise control is active
EPAS Cable $100 -> Digikey or Mouser Steering You must make your own cable - refer to info on this wiki page
Upgrades Cost Functionality Limitations / Notes
Comma Pedal  ?? -> @chase or @wocsor Accelerator Pedal Proxy - Allows automatic acceleration from 1 MPH Comma does not sell these, they are only available as partial kits from community members or as Fab your own PCB designs on Comma's github
Ultrasonic Parking Sensors + Wiring $180? -> AliExpress Assist in ALC, possibly also with blindspot detection and maybe eventually auto-park Requires Root to install
Radar retrofit $500? -> Ebay or Purchase from Tesla Parts Dept Allow for more accurate ACC Requires Root for Tesla IC radar display (will still work with EON)
iBooster2 retrofit $1500? Allow car to brake to a stop through automation Requires Root to install and has lots of dependencies, do NOT attempt till we have full details.

These are approximate costs of parts and materials only, it is assumed you will do your own labor.

Status of Lateral control (steering)

OpenPilot lateral control is working.

Electronic steering is present in pre-autopilot Teslas, but disabled. The Electric Power Assisted Steering units (EPAS) are capable of turning the steering wheel electronically if fed the right commands. With that in mind, we run a cable from the car's EPAS unit in the frunk to a comma.ai Panda. It allows us to:

  1. Intercept messages the car periodically sends that disable the EPAS' steering feature.
  2. Transmit steering commands from a comma.ai EON to the EPAS unit.

This setup allows the car to steer autonomously.

What about warranty or car service?

Is it legal to modify your Tesla?

As long as you own the vehicle (not leasing), you can do whatever you like to it as it is your property.

Do I need to remove the Panda/Giraffe/EPAS cable when the car goes in for service?

Nope. Tesla uses an ethernet based diagnostics port rather than the obd2 that the giraffe plugs into.

Does it void your warranty?

Under Magnuson-Moss a dealer must prove that modifications lead to the specific failure that is claimed against the warranty.

I.e. if a door handle stops working, you would still be covered for that; if you upgrade your brakes to ibooster2 and your brakes have an issue, you may not be covered.


Status of Longitudinal control (accelerator and brakes)

Longitudinal control is an ongoing effort. These cars lack electronic pedal control and radar.

As of 2019 we have both software-only and hardware-based Adaptive Cruise Control.

Distance detection technique Precision Cost Status
Use the EON's computer vision Low None Implemented
Install a radar unit High ~$300 Implemented
Speed control technique Brake power Min speed Installation Cost Status
Hijack normal cruise control commands Weak (regen only) 18mph None None Implemented
Install a comma.ai Pedal proxy Weak (regen only) 0mph Some assembly required. ~$100 Implemented
Install electrically controllable pedals Full 0mph Very difficult installation. >$600 Not implemented


Adaptive Cruise Control

ACC allows the car to match speed with cars in front of you. The EON judges distances using the camera and dynamically adjusts cruise control speed. There are plenty of downsides to this strategy. The distance estimates are inaccurate. It only operates above 18 mph. The speed changes are not very smooth. And it can't handle sudden slowdowns so YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT. But it works without any new radar/pedal hardware.

To repeat, YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT!

Follow these steps to use ACC:

  1. Press the cruise stalk IN so that the orange "cruise control ready" LED on the stalk is lit.
  2. Enable the ACC option on screen if necessary.
  3. Accelerate above 18 MPH.
  4. Enable OpenPilot using a DOUBLE stalk pull (pull the cruise control stalk BACKWARDS TWICE in quick succession.) You will see the blue 'Cruise' icon appear on your dash. ACC is now active.
  5. The initial max speed may be conservative. Press UP on the stalk to increase it.
  6. Cruise is disabled if you brake or the car slows below 18 MPH.
  7. If ACC "AUTO" mode is enabled, manually accelerate above 18 MPH to resume.

Controls while ACC is enabled:

Control Action
Cruise stalk IN Master toggle for cruise control. Must be engaged for cruise or ACC to work.
Cruise stalk DOUBLE PULL Enable OP ACC and steering, and increase the max allowed ACC speed if necessary.
On screen ACC button Toggle between "FOLLOW" and "AUTO" mode. FOLLOW mode attempts to match speed with cars in front of you and disengages if you steer or brake. AUTO mode does the same, but automatically re-engages when you accelerate again.
Cruise stalk UP Increase cruise speed, increasing max allowed ACC speed if necessary.
Cruise stalk DOWN Decrease cruise speed and max allowed ACC speed.
Cruise stalk PUSH Disable OpenPilot (both steering and ACC). Max allowed ACC speed is reset to 0.
Brake pedal Pause both ACC and traditional cruise.
Accelerator (When in AUTO mode) Accel over 18 MPH to unpause ACC.

Community ToDo List

  • Need a writeup of creating the wiring harness for EPAS bypass
  • Need a writeup of installing the wiring harness
  • Need to compare comma code with ours, regarding continue.sh / launch_openpilo.sh / launch_chffr.sh so that on reboot it fetches our repo (auto update). Not all users want to ssh in to update
  • Open source giraffe hardware
  • Code change to OP port to auto flash panda
  • Refine longitudinal control (this is a much larger issue than 1 bullet point)
  • Further testing of EPAS enable spamming
  • Have more Teslas using OP than any other car!!! :)
count Confirmed Users with Working OP Vehicle
1 Kalud 2013 S P85
2 zax123 2013 S P85
3 Bobby 2012 S P85
4 SteveRadich 2013 S 85
5 BogGyver 2014 S 85
6 RobP 2013 S P85
7 Edgar 2012 S P85
8 JJ 2013 S P85+
9 David Abrahams (Git:AllWashedOut) 2013 S 60
10 Shane Thomas 2013 S P85+
11 Alex V 2014 S 85
12 sergiociba 2013 S 60
13 Bentis 2014 S P85+
14 Moc 2014 S 85
15 Sid 2014 S 85
16 MarcMarin 2013 S 85
17 FlyBoyn222pa 2013 S 85
18 BastyJuice 2013 S 85
19 Harrison 2013 S 85
20 André Juneau 2012 P 85
21 TonyT 2013 S P85
22 Rayminster 2014 S 85
23 K79 2014 S 85
24 Connann 2014 S P85
25 Raf 2014 S 60
26 DanielRTRD 2014 S 85
27 erflesby 2013 S P85
28 Perch Perkins 2013 S 60
29 Honken 2014 S P85
30 rieschrispy 2013 S P85+
31 CX25 2014 S 85
32 Mystique 2014 S 85
33 bry__ 2013 S P85+
34 Mjsais 2013 S 85
35 F. John 2014 S 85
36 ctothek 2013 S 60
37 Mastro Gippo 2014 S P85+
38 Neon 2013 S P85+
39 Tesla310 2012 Sig S P85
40 eitupois 2013 Tesla S P85
41 Dan45 2013 S 85
42 ELicious 2012 Sig S P85

Here's what you'll need to get OpenPilot working on your pre-AP Tesla

  • Custom Giraffe and Wiring harness for the Model S.
    • There are 2 variations of the giraffe based on your car manufacture date. If you are unsure, check if the OBD connector in your driver footwell. If it has pins 1 and 9 like this then you need the giraffe with "Standard OBD Connector (Model S built after (May 31, 2013). For cars built before May 31, 2013, you need a giraffe with "TDC Connector". Your OBD port will be missing pins 1 and 9 and look like this.
    • Ask in the #tesla channel on the comma Discord to purchase a revB giraffe.

Total price of parts is approximately $1,000.

Instructions to set it all up

This first video walks you through the physical installation of parts from start to finish.

  • Make sure your Eon is up to date This will bring you to the latest version of OpenPilot and update your EON to the latest version of NEOS. If you have problems they aren't Tesla related, check the other wiki / slack places.
  • Install Panda on Giraffe OBDII port (driver footwell)
  • Run the 10 foot USB cable from the EON along your headliner, down the driver side A-Pillar, and down to the Panda
  • Connect EON to Panda via USB cable
  • Install custom tesla branch of OpenPilot on your EON by doing the following:
cd /data
mv openpilot openpilot.stock
git clone https://github.com/BogGyver/openpilot.git
cd openpilot
git checkout tesla
reboot
  • Update your Panda while SSH'ed in and Panda connected to ODB port and EON connected to Panda via USB (perhaps) - automated soon - Do we need to do this without data on bus?
cd /data/openpilot/panda/board
make
make recover
  • This is what it should look like for a successful flash. If you get something very different that has an error, check the connectivity between the EON and the Panda. Unplug it all and re-seat all the connections on Panda and giraffe.
root@localhost:/data/openpilot/panda/board$ cd /data/openpilot/panda/board;make                                    
PYTHONPATH=../ python -c "from python import Panda; Panda().flash('obj/panda.bin')"
opening device 41001d000651363038363036 0xddcc
connected
opening device 41001d000651363038363036 0xddee
connected
flash: version is v1.1.2-unknown-DEBUG
flash: unlocking
flash: erasing
flash: flashing
flash: resetting
opening device 41001d000651363038363036 0xddcc
connected
root@localhost:/data/openpilot/panda/board$
  • If you're having trouble with the Panda not flashing correctly, here's a few things to try:
Power cycle the Panda by unplugging it from the giraffe and reseating it again.

Run these commands on the EON to try and flash the Panda:

cd /data/openpilot/panda/board
killall boardd
make clean
make 
make recover


  • Once Panda is successfully flashed, you need to reboot EON again (WHILE the EON is connected to panda via USB).
  • Once everything is set up and working, you'll need to drive for 5-10 minutes above 45mph to complete calibration.
  • Once you're done with calibration, OP can be activated by one pull of the cruise stalk toward you. This is independent of whether the Tesla cruise control is turned on or not.

Enjoy!

Installation Tips

EPAS Cable

  • You can follow Deftdawg's EPAS creation video here: https://www.youtube.com/watch?v=TIKGK0Iabtc
    • NOTE: It is not recommended to solder the JST2 plugs prior to fishing the wire into the driver footwell, so pause watching this video around the 34minute mark. The fishing process can easily destroy JST2 solder joints, so it's better to fish the wire first and then strip and solder the connections on when the wire is already into the cabin.
  • Mouser shopping list:

Female connector
Female pins
Male connector
Male pins
Rubber seal plug
Rubber seal for cable

  • Use velcro ties to secure the EPAS Cable to the existing harness in the car until you are sure everything works and you won't be needing to remove EPAS cable to work on it further.
  • Fish the unfinished end of the cable under the washer container, then through the first hood metal support piece to the gap and then pull all of the slack through that gap. Reinsert the unfinished end back into the gap while keeping a finger or screw driver under it to keep the cable from falling down flat into the gap, this will help the cable not catch on where the second metal hood support meets the body as you push the cable towards the cabin. Once the cable emerges next to the door seal, pull it through from the cabin side and work it in behind the seal and the diagnostics port.
  • Once the cable is in the gap between the driver left side footwell cover and the panel containing the OBD2 port, do your soldering of the JST2 connector.
  • Prior to connecting the cabling, it's a good idea to test your EPAS cable for continuity and shorts [this is for your sanity, nothing bad will happen if you skip this]
    • Shorts: with the EPAS cable not plugged into the Car or the giraffe, put spare pins into 2 and 5 and touch your leads to them. If you get continuity make sure that the pins are not in contact, if they are not in contact double check the insulation on your solder connections to your JST2 plug.
    • Continuity: with the spare pins still inserted in 2 and 5, jumper the JST2 plug end. Touch your leads to the 2 and 5 pins, if you get continuity make sure that the pins are not in contact, if they are not, then the cable is good. If you get no continuity, check that your solder connections to the JST2 plug haven't been broken.
  • Plug your panda into your giraffe, plug your giraffe into your OBD2 plug... The car may give you some error messages about parking brake, etc... Connect your EON to the panda via the USB cable. Turn on tethering in the EON and connect to the EON hotspot, then ssh to 192.168.43.1 port 8022 using the OpenPilot RSA key and flash your panda. Once flashing is complete, you can disconnect your EON again, remove and reinsert your giraffe, hopefully the car should not complain (if it does let us know, but continue anyway).
  • With a good cable, you can remove any testing jumpers and spare pins and connect to to the EPAS servo unit and connect it to the giraffe. Again the car should not complain. If you get an error that "Power Assist is not available", it means that your CAN +/- pins (2 and 5) need to be flipped. You test this by cross wiring a JST2 connector to a JST2 plug and then inserting that between your JST2 connector and EPAS cable... If you do this, you may need to put the car in drive and manually feel if power steering works before the error clears (if steering is normal the error should clear, if not it will feel very heavy). The easiest way to resolve this is to disconnect the JST2 cable from the giraffe and use a small edge to lift the plastic lock tab while depressing the spring clip to release the JST2 connects and then insert black in the red position and vice-versa, the plug the JST2 cable back into the giraffe, put the car in drive and recheck the steering.

Tucking the USB and Grey panda antenna cable into the Headliner

  • Pull your USB and GPS antenna cables from the footwell gap where the OBD2 port is up to where the "A" pillar is...
  • Follow the instructions to remove the air bag cover from the "A" pillar
  • Pull the USB and GPS antenna cables up the height of the "A" pillar across the the mirror holding them close to the headliner. Adjust the length and to reach where you will place your panda and your EON. The GPS receiver can be placed under the mirror Frit, it won't effect performance (the pattern is only to prevent glare on the mirror).
  • Drape the receiver and USB plug ends over the rear view mirror.
  • Move to the corner where the headliner and the removed airbag panel intersect, this corner is the easiest place to stick a pry tool... Using your pry tool lift the corner and move the pry-tool along the top of the windshield tucking the two wires into the headliner as you go. When you reach the mirror base, this can be lifted slightly route the GPS into the headliner crossing in between headliner and mirror base, while the EON USB cable can be routed down the front of the windshield to emerge at the bottom of the mirror base closer to the centre of the windshield.
  • Once the cabling is tucked in the headliner, move back to the "A" pillar and tuck the cable into the pillar cover routing it down towards the door seal, then secure the pillar cover to conceal the wiring.

First Troubleshooting steps:

  • If you're getting power steering errors after flashing panda, make sure you reboot EON while it's connected to Panda via USB
  • Try a different USB cable (a shorter one, or one with EMI filter)
  • Ensure that the mini USB cable is fully seated in the EON. Trim of about 2 mm of plastic on the front of the connector plug if the USB in the EON housing seems to have been pushed in.
  • Make sure you're using the correct tesla repo
  • run make in /data/openpilot/panda/board
  • make sure CAN-H and CAN-L are not reversed.
  • make sure there is a 120 ohms resistor across CAN-H and CAN-L going to the EPAS (power steering)
  • if using a custom harness ensure these:
    • car CAN on panda port 1 (first port)
    • EPAS CAN on last on port 3 (last one)
  • If everything looks correct (right code, right wiring, right everything), you can always try: Shutdown car ("Power Off" in car settings), wait a few sec and try again.
  • If you've broken your source control (wrong git command, etc) you can always backup/check out from scratch:
cd /data
mv openpilot openpilot.bak
git clone https://github.com/BogGyver/openpilot.git
cd openpilot
git checkout tesla
cd panda/board
make clean
sleep 5 # (Skip this if running commands individually.)
make
make recover 
reboot
  • If you are getting a message about having to recalibrate or re-position the EON, do this:
rm /data/params/d/CalibrationParams
reboot

How to change to the development branch of the Tesla OP port

Here's the commands to run on your EON to switch to the tesla_devel branch of the code

cd /data/openpilot
git fetch
git checkout tesla_devel
cd /data/openpilot/panda/board
make
reboot



How to transfer files to your EON

Sometimes while testing or debugging issues you may want to manually transfer files to your EON. One easy way to do this is to use the popular FTP client Filezilla.

  1. Enable SSH. Click on "Settings" in OpenPilot and make sure the "Enable SSH" option is turned on.
  2. Next find the ip address of your EON. Under Settings > Wifi settings > Advanced (click on the 3 dots in the upper right hand corner) scroll all the way to the bottom to find IP. (Make sure your EON is on the same wifi as your computer)
  3. Create a file called openpilot.ppk and save the text at the bottom of this section in it.
  4. In Filezilla, go to your Site Manager and create a new entry for your EON and enter the IP address you found in the Host field. The port is 8022. The protocol should be SFTP. Logon Type will be "Key File". User is "root". Key file is the file you just created. Then hit connect.

If you're having issues connecting, check to make sure you can ping your device on the IP you found. If ping doesn't work, then SSH won't either. You can try turning wifi off and then on again if you can't connect.

All the settings listed above can be used to connect via PuTTY as well for command line access. You specify the keyfile in the settings under Connection -> SSH -> Auth -> Private key for authentication

PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: imported-openssh-key
Public-Lines: 6
AAAAB3NzaC1yc2EAAAADAQABAAABAQC+iXXq30Tq+J5NKat3KWHCzcmwZ55nGh6W
ggAqECa5CasBlM9VeROpVu3beA+5h0MibRgbD4DMtVXBt6gEvZ8nd04E7eLA9LTZ
yFDZ7SkSOVj4oXOQsT0GnJmKrASW5KslTWqVzTfo2XCtZ+004ikLxmyFeBO8NOcE
rW1pa8gFdQDToH9FrA7kgysic/XVESTOoe7XlzRoe/eZacEQ+jtnmFd21A4aEADk
k00Ahjr0uKaJiLUAPatxs2icIXWpgYtfqqtaKF23wSt61OTu6cAwXbOWr3m+IUSR
UO0IRzEIQS3z1jfd1svgzSgSSwZ1Lhj4AoKxIEAIc8qJrO4uymCJ
Private-Lines: 14
AAABAQCEhXr8RxnaC92ecZMOqDuUkCjthsRHlYUczYJrvxwPqsfDq8qg+jtQlmON
N+5H7eolsZcIizncJ2tj9ubnlTNy8anUB9ikuA5pQsfpKuhcAoL9Ot30DzIQvS6V
opr2kEjxAu1VD40JaOLT2OrE02AVDodANYoUZv8e47irkAlosQqvAvw1ZwdV+Jho
/lt5yXOU8FSbYCW24ga6uj1q4bwf96ppMR0S+3VNkgW9ojURdSy2N9HScf3A+91A
yjR65a7I5N1CXNvTKePzJWnSr1JEajcJWMUrgLSVdJ2d/ohZC7N2nUkx3SaQpUHq
+OUedaxQ5VbA89mQaW/4UTUaBg7hAAAAgQDoDUSLEurtBg6HdxteHKHdbiSlW8D8
U98ofU4zLc404P9j05r4z/C2FbXBKhEvaf664hbk4CFMi8gSK+PpsBmxNPe3Cu86
u9i72vH1qWfinwGHK92N5biRLtPwU/miXoug63axM/dPUs64k865C86OUo8ogyHd
zdEU1ZOcbMw9rQAAAIEA0jNiPLxP3A2nrX0keKDI+VHuvOY88gdh0W5BuLMLovOI
Dk9aQFIbBbMuW1OTjHKv9NK+Lrw+YbCFqOGf1dU/UN5gSyE8lX/QFsUGUqUZx574
nJZnOIcy3ONOnQLcvHAQToLFAGUd7PWgP3CtHkt9hEv2koUwL4voikTP1u9Gkc0A
AACAPLxtzP7rcHi76uESO5e1O2/otgWo3ytjpszYv8boH3i42OpNrX0Bkbr+qaU4
3obY4trr4A1pIIyVID32aYq9yEbFTFIhYJaFhhxEzstEL3OQMLakyRS0w9Vs2trg
YpUlSBLIOmPNxonJIfnozphLGOnKNe0RWgGR8BnwhRYzu+k=
Private-MAC: 2af7f5a599fa35e22392b7770a2eb7a0be8718b7


Editing your Bash Profile

In order to edit the .bash_profile on the EON, first you have to move your the home directory by typing

cd

Then, you have to mount the file system in Read/Write mode by typing

mount -o rw,remount /system

At this point you can edit your .bash_profile file by typing

vi .bash_profile

First, locate the PYTHONPATH line and delete it. Then, at the end of your file, paste the following code

# add these symlinks if you want
export PYTHONPATH="/data/openpilot"
export GIT_SSH_COMMAND="ssh -i /data/gitkey"
cd /data/openpilot/selfdrive/car/tesla
alias cdo='cd /data/openpilot'
alias cdt='cd /data/openpilot/selfdrive/car/tesla'
alias cdp='cd /data/openpilot/panda/board'
alias sop='grep -rni --include=\*.{py,h,c} /data/openpilot/ -e '
alias mrw='mount -o rw,remount /system'
alias dbp='python /data/openpilot/panda/tests/debug_console.py | grep -v "can_push failed"'
alias vic='vi /data/openpilot/selfdrive/car/tesla/carcontroller.py'
alias vii='vi /data/openpilot/selfdrive/car/tesla/interface.py'
alias vit='vi /data/openpilot/selfdrive/car/tesla/teslacan.py'
alias vis='vi /data/openpilot/selfdrive/car/tesla/carstate.py'
alias viu='vi /data/openpilot/selfdrive/ui/ui.c'
alias lop='cd /data/openpilot;./launch_openpilot.sh'
alias gp='git commit; git push'
alias sp='/data/data/com.termux/files/continue.sh'

Save the profile and you're done! If you contribute code, you might also at this point want to configure your git to save your username and password. To do that you just to a push when you still have the file system in RW mode ( or you can use the *mrw* command later to make it RW)

$ git config credential.helper store
$ git push https://github.com/repo.git
Username: <type your username>
Password: <type your password>
$ git push https://github.com/repo.git
[your credentials are used automatically]


Keep in mind the credentials are stored in

.git-credentials

in plain text. They are in the format

https://user%40email.com:pass@github.com

where *user@email.com* is your username and *pass* is your password. So you can also just edit that file and modify as needed. Just replace *@* with *%40* in your email address. Now, about those shortcuts above:

mrw - make read / write - makes the file system writeable
sop - search OpenPilot - searches the whole OP structure for the keyword that follows - example: sop user_brake
sp - starts OpenPilot after you killed it with tmux -a
dbp - debug panda - launches the debugger for panda
gp - git commit and push - if you saved your credentials this makes commit and push so easy; just add your comment and you're done
cdt - change directory to /data/openpilot/selfdrive/car/tesla folder; this is also the folder when you will now start every time you ssh into your EON
cdo - change directory to /data/openpilot
cdp - change directory to /data/openpilot/panda/board
vic - starts vi for /data/openpilot/selfdrive/car/tesla/carcontroller.py from any folder
vii - starts vi for /data/openpilot/selfdrive/car/tesla/interface.py from any folder
vis - starts vi for /data/openpilot/selfdrive/car/tesla/carstate.py from any folder
vit - starts vi for /data/openpilot/selfdrive/car/tesla/teslacan.py from any folder```


Script to auto delete files to keep EON from filling up

This script comes courtesy of @Sid and updated for OP0.5 by @Tentious

Save the following script and run it on your EON. It will install into a cron job a script that checks every hour to see if you're almost full and delete the oldest files if necessary.

https://gist.github.com/tentious/b0de19dfecefc2547b4a07c31174aac3

Aligning your EON

What you need

  • Measuring tape
  • Masking tape
  • A friend to help

Instructions

  1. Find a place at the bottom of the windshiled along the driver side pilar that has a similar position on the passenger side (I used the place where the corner of the front hood meets the fender).
  2. With the tape starting from that point, mark 3 places along the side of the windshiled. Use the endge of the masking tape to mark them. I personally used 3" from the bottom, the top of the windshield and then about 1/3 from the bottom, 2/3 from the top. It does not matter what the measuring tape says, as long as it says the SAME distance on both sides.
  3. Repeat the process on the other side of the windshiled, ensuring you mark the same spots.
  4. measure the distance between one edge of the windshield and the other end, keeping the tape at each pair of marked points from before. use masking tape to mark the middle of the windshield. again, use the EDGE of the tape, not the center.
  5. Now use a long piece of masking tape to mark the center of the windshield from top to bottom. This (if you did everything correctly) will cover all 3 of your markers from before and provide a straight line. One edge of the masking tape is now the perfect middle of the windshild. Your mount will have to be aligned with that for a perfect position.
  6. Take a small piece of tape and mark the middle of the GoPro mount. use a slighly longer piece that the go-pro (maybe 1/4-1/2" more on each side) and ensure it is straight and down the middle of the GoPro. If, when looking from inside of the car, your take is to the RIGHT of the center, then put the tape on the LEFT side of the GoPro. Reverse if the other way.
  7. Using your EON without the mounting braket, determine the location along the center of the windshield where you want it placed.make sure the grove on the support is alongside the center of the windshield. use a small piece of maksing tape to mark the upper part of the position where you want your EON to be.
  8. Remove the RED protective tape from the back of the 3M adhesive and be ready to place the GoPro on the windshiled. Align the masking tape we placed on the GoPro mount on the inside with the masking tape we have on the outside of the windshield. They shoud not overlap at all AND you should not see light either. when you are confident on the position press hard on the mount.
  9. Remove all masking tape. You are done. You now have a perfectly centerd, perfectly vertical EON.


Placeholder for pedal instructions

Pedal connectors for Tesla can be purchased here

Getting pedal physically in the car: Tesla chip is a similar install

Flashing: Guide to flashing the pedal

Best way to flash it is to connect pedal straight to EON, go to panda/board/pedal and just type

make recover

Summarized wiring info:

  1. Wire the connectors to the board on the left and right sides of the Pedal using this diagram: https://i.imgur.com/kmH0CBR.png
  2. If you have a revB giraffe and an RJ45 connector on your pedal, just plug a straight through (not crossover) CAT5e cable in to the RJ45 on your pedal and the RJ45 on your giraffe labelled "Comma"
  3. If you have no RJ45 connector on your pedal board, connect pedal RJ45 pin 3 (Green / White) to the EPAS CAN -, and RJ45 pin 6 (Green) to the EPAS CAN +


Most of the action is happening in the #tesla channel on the comma discord server: https://discord.comma.ai/

Current Kalud Tesla branch URL: https://github.com/jeankalud/openpilot/

BogGyver Tesla branch URL: https://github.com/boggyver/openpilot/

BogGyver pedal branch URL: https://github.com/boggyver/openpilot/tree/tesla_pedal

Some background info on the tesla port: http://openpilot.robertcotran.com/

Last known safe Tesla software update version: 2019.16.2

Glossary/Acronyms

ABS/iBooster/ESP2
AntiLock Braking System, iBooster - a component that allows brakes to applied via electronic control, Electronic Stability Program. These are parts of the automatic braking system that are found on AP1 and later cars. Using EON to control brakes is not feasibly possible on pre-AP Teslas. There has been some talk of upgrading AP0 Teslas to have this hardware, but this is a major undertaking and requires root access.
AP, AP0, AP1, AP2, AP2.5
Tesla AutoPilot. AP0 or pre-AP means no AutoPilot. AP1 is the version 1 using Mobileye technology. AP2 ditched the Mobileye components and is all Tesla parts and software. AP2.5 is upgraded AP2 hardware.
cabana
Comma's system for playing back and showing the recorded data from uploaded drives.
CAN,CAN-bus
Controller Area Network This is a network system inside cars that allow messages to be sent to different auto components. With the Giraffe/Panda/EON setup described above, the Panda's CAN bus 0 is for chassis messages and CAN bus 2 is for the isolated EPAS. The Panda proxies messages between the two (except for the EPAS kill message which is blocked.)
Chassis Can
Steering and braking controls are found on this CAN-bus, so this is the main one that OP uses.
CID
Center Information Display. Same thing as the MCU, ie, the big screen in the Tesla.
DAS
Driver assistance system - the AP1 camera/computer module located behind the windshield on AP1 hardware cars
DBC
DataBase Container These are files that contain the definitions of the messages cars send on the CAN-bus.
Diag, Diag port
Diagnostic port that can be found under the MCU (screen) in a Tesla. Chassis-CAN is able to be accessed from this port.
DPDT
Double Pole Double Throw. It's a type of switch that some use in their wiring harness.
EON
Main hardware component that Comma sells. It's the brains that runs OpenPilot.
EPAS/EPS
Electronic Power (Assisted) Steering. This component allows OP to move the steering wheel.
flash
Process of installing software on embedded hardware.
Giraffe
Piece of hardware that allows the Panda to interface with the OBD port in the car.
IC
Instrument Cluster. The screen behind the steering wheel that has the speedometer on a Tesla.
LKAS
Lane Keeping Assist System. System built into cars to automatically steer to keep the car in the current lane.
MCU
Media Control Unit - The big screen in a Tesla.
MRR
Mid Range Radar. Modern cars use radar units to see objects around the car. Pre-AP Teslas don't have any radar units.
MS, MX, M3
Model S, Model X, Model 3. The current Tesla lineup.
NEO
The predecessor to the EON. A customized OnePlus3 phone with a custom hardware board attached that also can run OpenPilot.
NEOS
The operating system softare that runs on the EON.
OBD, OBDii, OBDII, OBD2
OnBoard Diagnostics This is a port in the driver footwell that would normally provide emissions diagnostics on most cars, but is useless for that on Teslas. For Teslas built after May 31, 2013, Chassis CAN-bus is able to be accessed from this port.
OP
OpenPilot
Panda
Piece of Comma hardware that plugs into the OBD port to access the Chassis CAN-bus to send steering and braking messages from OpenPilot running on the EON.
PCB
Printed Circuit Board
PCM
Powertrain Control Module. This component basically tells the car how much power to put out to make the car go.
PR, pull request, merge
Pull requests or merge refers to a request to integrate code written by others to be "pulled" into the OpenPilot software maintained by Comma.
Repo, git repo
Repository where software is stored. The code for the Tesla version of OpenPilot currently sits in a different repo than the main OpenPilot code.
root, root access
Process of gaining access into the Tesla sofware system at a root level that allows access internal diagnostic not normally available and also allows for changes to be made to the Tesla software.
SCCM
Steering Column Control Module - This component is part of the steering column and controls all the messages sent from the buttons on the steering wheel as well as the cruise control stalk.
SOC
State Of Charge. The percent of power left in your car's battery pack.
SSH
Secure SHell - a method of connecting to your EON in order to be able to make changes to it and issue commands for it to run.