https://tinkla.us/api.php?action=feedcontributions&user=Neon&feedformat=atomTinkla: Tinkering with Tesla - User contributions [en]2024-03-29T15:18:34ZUser contributionsMediaWiki 1.32.1https://tinkla.us/index.php?title=Template:Flashing_the_Panda&diff=1563Template:Flashing the Panda2023-11-10T16:57:25Z<p>Neon: </p>
<hr />
<div>After installing or updating OpenPilot on your EON, you need to also update the software on your Panda. Here's how:<br />
<br />
In your Tesla while it says “Car Off” connect your Panda to your Giraffe rev B OBD (or EPAS OBD). Connect your EON to the Panda via USB. Then SSH in and run:<br />
<source lang="bash">cd /data/openpilot/panda/board<br />
killall boardd<br />
make clean<br />
make && sleep 1 && (make recover || make recover) && echo Success! Rebooting in 2s... && sleep 2 && reboot<br />
</source><br />
The kill command ensures that the EON stops regular communication to the Panda. That's also why a reboot is needed at the end. If any error occurs (which of course should not happen) the reboot will be skipped so you can troubleshoot.<br />
AssertionErrors should be fixed by rebooting EON and trying a second time. Optionally you may also power cycle your Panda by reseating it.</div>Neonhttps://tinkla.us/index.php?title=EON&diff=1562EON2023-11-10T16:51:59Z<p>Neon: /* Installing OpenPilot for Tesla */</p>
<hr />
<div> The original EON is not supported in the latest releases of software from OpenPilot. The Tinkla Unity software will not run on the original EON. You can still find some old versions of OpenPilot for Tesla (v0.6.6 and v0.7.4) but you will not be able to take advantage of the newer features. Also the EON requires the EPAS harness to work on preAP Tesla Model S.<br />
<br />
The EON is the name associated in the Comma.ai community to the device that sits in your windshield and does all the calculations for LKA and ACC.[[File:EON-devkit.jpg|500px|thumb|right|Comma.ai EON DevKit]]<br />
<br />
__TOC__<br />
<br />
== EON DevKit (or FrEON) ==<br />
<br />
<br />
The EON is based on the [https://www.qualcomm.com/products/snapdragon-821-mobile-platform?cmpid=snfyus19642&gclid=EAIaIQobChMI-oG8if364QIVFY_ICh0DFArXEAAYASAAEgKFL_D_BwE&gclsrc=aw.ds Qualcom Snapdragon 821 mobile platform]. Phones like OnePlus 3T or LeEco LePro3 have been used to create the FrEON (the free EON). You can find some instructions [https://medium.com/@kirk_40929/getting-comma-openpilot-running-on-a-used-phone-c72d609cb4d3 here]. <br />
<br />
If you choose to buy your [https://comma.ai/shop/products/eon-gold-dashcam-devkit EON] already made, you can do so from Comma.ai store for $599 USD.<br />
<br />
Also, as we run more and more processing on the EON, it gets hotter and hotter. Some of us have opted to replace the original fan (which is also noisy when you're inside of a Tesla) with super quiet [[Noctua fan|Noctua fans]]. $15 from Amazon and soldering two wires and you're good to go! We might have to actually double that to two [[Noctua fan|Noctua fans]] in the near future. <br />
<br />
Also, keeping the phone screen off helps keeping the temperature low. I know, in the beginning one wants to see those lines matching the lines in the video, but after a while you stop paying attention to the screen. And if you have the IC integration all the data is on IC anyway. So turn that screen off and you will see the temperature drop about 15F.<br />
<br />
Code for power management of battery (only charging when below 60% and stopping the charge when it reaches 80%) has helped keep the battery temperature lower and hence the CPU cooler. And this is a free upgrade, as the code is already in my repo.<br />
<br />
Here is a helpful [[EON bash profile]] (.bash_profile).<br />
<br />
== Installing the EON ==<br />
EON installation is pretty simple. Your main objective is to ensure the EON is level with the ground, and pointed as straight as you can get it. If you're uncomfortable "eyeballing it," you may want to use:<br />
*A measuring tape<br />
*A roll of masking tape<br />
*A friend to help<br />
===Instructions===<br />
# Find a place at the bottom of the windshield, along the driver's side pillar that has a similar position on the passenger side (such as the place where the corner of the front hood meets the fender). <br />
# With the tape starting from that point, mark 3 places along the side of the windshield. Use the edge 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 driver's and passenger's sides.<br />
# Repeat the process on the other side of the windshield, ensuring you mark the same spots.<br />
# 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.<br />
# 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 windshield. Your mount will have to be aligned with that for a perfect position.<br />
# Take a small piece of tape and mark the middle of the GoPro mount. use a slightly longer piece than 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 tape is to the RIGHT of the center, then put the tape on the LEFT side of the GoPro. Reverse if the other way.<br />
# Using your EON without the mounting bracket, 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 masking tape to mark the upper part of the position where you want your EON to be.<br />
# Remove the RED protective tape from the back of the 3M adhesive and be ready to place the GoPro on the windshield. 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 should not overlap at all AND you should not see light either. when you are confident on the position press hard on the mount.<br />
# Remove all masking tape. You are done. You now have a perfectly centered, perfectly vertical EON.<br />
=== Hide the USB/antenna cable above the Headliner === <br />
# Pull your USB and GPS antenna cables from the footwell gap (where the OBDII port with a giraffe or giraffe-less cable, and Panda are) up to where the "A" pillar is... <br />
# Follow the instructions to remove the air bag cover from the "A" pillar<br />
# Pull the USB/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). <br />
# Drape the receiver and USB plug ends over the rear view mirror.<br />
# 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.<br />
# 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.<br />
<br />
== Installing OpenPilot for Tesla ==<br />
Comma.ai doesn't support Tesla cars. That's why we maintain our own fork, which you will have to manually check out after setting up your EON.<br />
<br />
'''<span style="color: red;font-size: 18pt;">DON’T INSTALL ON ANYTHING OTHER THAN A TESLA!</span>''' <br /><br />
(Someone bricked their Jeep trying.)<br />
<br />
=== Start with Stock OpenPilot ===<br />
Follow the instructions for setting up an EON with OpenPilot using these instructions: [https://medium.com/@jfrux/comma-eon-initial-setup-with-openpilot-2b5ea58354a Comma EON Initial Setup with OpenPilot]<br />
<br />
Then we will [[#Git the Tesla OP Fork]]<br />
<br />
=== Git the Tesla OP Fork ===<br />
[[SSH_Into_Your_Device#SSH_when_devices_is_running_a_version_before_0.8.3|SSH into your EON]] and execute the following commands (you need internet connectivity on your EON):<br />
<source lang="bash"><br />
cd /data<br />
rm -rf /data/openpilot<br />
git clone --depth 1 https://github.com/BogGyver/openpilot.git -b tesla_0.6.6 /data/openpilot<br />
reboot<br />
</source><br />
The first reboot will take around 20 minutes to set everything up.<br />
<br />
=== Edit your Config ===<br />
After the EON has booted you can edit your [[OpenPilot Configuration File|config]], which now has been automatically created.<br/><br />
At the top find <source inline>user_handle = your_tinkla_username</source>, set force fingerprint to True, and change your_tinkla_username to your Tinkla username (preferred, if available) or to your Discord handle.<br />
<br />
<source lang="bash">nano /data/bb_openpilot.cfg</source><br />
<br />
Make sure to set <source inline>use_tesla_gps = True</source> in case you're using a White Panda (Grey Panda has GPS built in). With GPS info of your drives you're helping Comma to improve their models (OpenPilot uploads your drives to their servers).<br />
Keep in mind that config changes only apply after rebooting the EON.<br />
<br />
=== Flash your Panda ===<br />
{{Flashing the Panda}}<br />
<br />
=== Final steps ===<br />
Finally, check here to learn more about all the controls, functions and features related to longitudinal control: [[Longitudinal_Control:_ACC#Using_Adaptive_Cruise_Control|Using adaptive cruise control]]<br />
<br />
==== First OpenPilot Drive ====<br />
# Make sure the EON is mounted properly and connected to the Panda by following [[#Installing the EON]]<br />
# Make sure the EON has Internet access (either your wifi at home or a SIM card). Connect to a mobile hotspot if you don't have a SIM card<br />
## Reboot your EON before turning your car on for good measure<br />
# Turn your car on and verify that the Panda LEDs are pulsing red/blue/purple. If they are green, your panda is not flashed, see flashing instructions here [[Panda#Flashing_the_Panda|Panda Flashing]].<br />
# OpenPilot should switch to "drive mode" and show the camera view with white lane marking <br />
# Make sure that your EON is connected to the Internet or Calibration will not start <br />
# Read up and understand the controls from [[Longitudinal_Control:_ACC#Using_Adaptive_Cruise_Control|Using adaptive cruise control]]<br />
<br />
<br />
IF YOUR CAR IS RECOGNIZED:<br />
# Calibration will increment at above 15mph. It will take less than 30 seconds to fully calibrate. If you move the mount, it's recommended to reset camera calibration under "device settings".<br />
# When driving, Double Pull the Cruise Control Stalk to use OpenPilot<br />
<br />
IF YOUR CAR IS NOT RECOGNIZED<br />
# Ask for help on the #tesla channel of the [https://discordapp.com/invite/Wyna3qy Comma.ai Discord]<br />
<br />
<br />
Experiencing issues?<br/><br />
In case you use a [[Pedal Interceptor|Pedal]] and it just won't work, chances are it doesn't have Tesla firmware on it yet. You can flash it with [[Pedal Interceptor#Flashing the firmware for Tesla Pedal|this guide]].<br />
Various other problems can be related to wiring, so double check each installation page, especially [[EPAS Harness]].<br/><br />
On any other issue, please use the search function or ask us on [https://discordapp.com/invite/Wyna3qy Discord].</div>Neonhttps://tinkla.us/index.php?title=Tesla_Giraffe&diff=889Tesla Giraffe2020-06-12T02:03:57Z<p>Neon: </p>
<hr />
<div>[[File:Giraffe back side.png|400px|frameless|right|Back side with the OBD II connector that goes into the car]]<br />
== Installing the Giraffe ==<br />
[[File:CH_bus-2.jpg|150px|thumb|right|Has 1&9]][[File:no_CH_bus-2.jpg|150px|thumb|right|Missing 1&9]]There are currently three options concerning Giraffes for your Model S. You can even make your own [[Tesla Giraffe]].<br />
# An EPAS harness from [https://www.ebay.com/str/level2tesla Flyboy222pa on eBay] <br />
#* The harness installs below the MCU.<br />
#* This path doesn't require a Giraffe and has our [[EPAS Harness]] already built-in, so you don't need to make it yourself.<br />
#* But this will require a 120 Ohm resistor if you want to install a Radar retrofit.<br />
# Giraffe rev B from @E=mc2#7596 on the [https://discordapp.com/invite/Wyna3qy Comma.ai Discord]<br />
#* This Giraffe installs into the OBD port under the dash in the driver's footwell.<br />
#* This will work as long as your OBD port pins 1 and 9 look like the first picture on the right.<br />
# Giraffe for cars built before May 31, 2013, will need a "TDC Connector".<br />
#* This Giraffe installs into the OBD port under the dash in the driver's footwell but needs an additional connection to the port under the MCU.<br />
#* You'll want this variant if your OBD port is missing pins 1 and 9 like the second picture to the right.<br />
<br />
Your [https://comma.ai/shop/products/panda-obd-ii-dongle Comma.ai Panda] plugs right into your Giraffe or Flyboy's EPAS harness. In case of the Giraffe, your need to make the [[EPAS Harness]] yourself.<br />
<br />
== Giraffe revB ==<br />
[[File:Tesla Giraffe rev B Pinout.png|800px|frameless|center]]<br />
<br />
The [https://github.com/appleguru/panda Tesla Giraffe rev. B] was created and sold by '''@appleguru'''. <br />
<br />
On top of creating the right pin connections between Panda and the appropriate [[Tesla CAN Bus]], it has a number of other nice features:<br />
* automatically connects EPAS connector back to [[Tesla CAN Bus|Chassis CAN]] bus when no Panda is present<br />
* offers connector for CAN2 on Panda which is used for [[Tesla Bosch Radar]]<br />
* has 12V power out which can be used to power the [[Tesla Bosch Radar]] via relay<br />
* has the Comma RJ45 FakeEthernet CAN connector to connect the [[The Comma.ai Pedal|Comma Pedal]]<br />
* has 8 GPIO outputs that can be used to drive certain other accessories; the 8th GPIO is used in our Panda firmware for "ignition power" which can be used to drive the relay needed for [[Tesla Bosch Radar]] power<br />
<br />
=== Default Output Mapping with Tesla Giraffe rev. B firmware from my branch ===<br />
<br />
The general purpose outputs on the GPIO RJ45 and optional 10 position terminal block are driven from the panda via one of the otherwise unused LIN bus outputs. This output, through the circuitry on the rev. B giraffe, drives an automotive grade 8 ch smart FET (Infineon BTS4880R) that can handle loads up to 500mA per channel (2A max across all outputs).<br />
<br />
The initial application for the GPIO is to support the "Tesla Camera switcher" project, which allows intelligent switching between the car's backup camera and a new camera added to the front bumper to help with forward parking on a Model S or Model X. The current firmware automatically switches to the backup camera feed when in reverse, and the front camera feed otherwise, allowing for the use of pressing and holding on the menu button on the steering wheel to manually select.<br />
<br />
Other projects that will potentially use this GPIO are the "Tesla 360 camera install", the "Tesla lighted appliqué", and a few owners that have installed light bars/want to drive relays from [[Tesla CAN Bus|CAN]] so they come on with their high beams. The firmware is open-source, so you can configure this interface to suit your project’s needs and get a very capable GPIO from [[Tesla CAN Bus|CAN]]! Please see the table below for the current CAN signals mapped:<br />
<br />
{| class="wikitable"<br />
| Output PIN Number <br />
| Function <br />
|-<br />
| OUT1 <br />
| Front Camera Switch (High when car is in Reverse or menu button override is active) <br />
|-<br />
| OUT2 <br />
| Drive <br />
|-<br />
| OUT3 <br />
| Brake Lights <br />
|-<br />
| OUT4 <br />
| Left Turn Signal <br />
|-<br />
| OUT5 <br />
| Right Turn Signal <br />
|-<br />
| OUT6 <br />
| Reverse <br />
|-<br />
| OUT7 <br />
| High Beams On <br />
|-<br />
| OUT8 <br />
| "Ignition" Power <br />
|-<br />
|}<br />
<br />
=== J8 RJ45 GPIO Pinout ===<br />
<br />
{| class="wikitable"<br />
| RJ45 Pin Number / 568B Color <br />
| Function <br />
|-<br />
| 1 / Orange/White <br />
| OUT3 <br />
|-<br />
| 2 / Orange <br />
| OUT1 <br />
|-<br />
| 3 / Green / White <br />
| OUT4 <br />
|-<br />
| 4 / Blue <br />
| OUT2 <br />
|-<br />
| 5 / Blue/White <br />
| OUT5 <br />
|-<br />
| 6 / Green <br />
| OUT6 <br />
|-<br />
| 7 / Brown/White <br />
| Fused +12V <br />
|-<br />
| 8 / Brown (and Shield) <br />
| GND <br />
|-<br />
|}<br />
<br />
=== J7 RJ45 Comma Pinout ===<br />
<br />
{| class="wikitable"<br />
| RJ45 Pin Number / 568B Color <br />
| Function <br />
|-<br />
| 1 / Orange/White (and Shield) <br />
| GND <br />
|-<br />
| 2 / Orange <br />
| Fused +12V <br />
|-<br />
| 3 / Green / White <br />
| EPAS CAN - <br />
|-<br />
| 4 / Blue <br />
| No Connection <br />
|-<br />
| 5 / Blue/White <br />
| GND <br />
|-<br />
| 6 / Green <br />
| EPAS CAN+ <br />
|-<br />
| 7 / Brown/White <br />
| CAN2+ <br />
|-<br />
| 8 / Brown <br />
| CAN2- <br />
|-<br />
|}<br />
<br />
=== Giraffe CAN Bus Inputs/Outputs ===<br />
<br />
Panda CAN2 is used in my branch to connect the [[Tesla Bosch Radar]]. R11 on the bottom of the board is unpopulated and available for an optional 120 Ohm 1206 termination resistor to be installed if needed. CAN2 is broken out on both the Comma RJ45 output and the J3 2pin output (see pinout). If you're not planning to install the R11, please make sure you add an 120 Ohm resistor before the JST connector per the [[Tesla Bosch Radar]] instructions.<br />
<br />
Panda CAN1 is connected to the Model S and Model X’s [[Tesla CAN Bus|Chassis CAN]] via the giraffe’s male OBD’s Pins 1 (CH+) and 9 (CH-). The J6 EPAS output switches between [[Tesla CAN Bus|CH CAN]] from the Car and CAN3 from the Panda, depending on the state of CAN Select (Which is driven by the panda’s GMLAN output). When it is high (D1 Yellow), J6 is sending Panda CAN3 out. When it is low (D1 Green), the Car’s Chassis CAN is going out J6.<br />
<br />
=== Tesla Giraffe rev B Useful Part Numbers ===<br />
<br />
2pin connectors for J2 / J3 / J6 are JST 2pos 2mm PH headers, PN B2B-PH-K-S(LF)(SN)<br />
<br />
Fuse F1 is a standard 3A blade type automotive fuse. OE fuse is a Littlefuse 0287003.PXCN<br />
<br />
J1 (Optional) is Phoenix contact Part number 1827787 (plug) and 1827949 (soldered header) in case you misplace your plug or would like to add your own header.<br />
<br />
J9 is Phoenix Contact plug 1827703 in case you misplace yours.</div>Neonhttps://tinkla.us/index.php?title=File:Giraffe_back_side.png&diff=888File:Giraffe back side.png2020-06-12T02:02:47Z<p>Neon: </p>
<hr />
<div>Back side with OBD II connector that goes into the car</div>Neonhttps://tinkla.us/index.php?title=File:EPAS_Harness.png&diff=887File:EPAS Harness.png2020-06-12T01:44:08Z<p>Neon: </p>
<hr />
<div>EPAS Harness with additional CAN wire pair for radar (taped away on other end temporarily until later radar installation)</div>Neonhttps://tinkla.us/index.php?title=EPAS_Harness&diff=886EPAS Harness2020-06-12T01:42:48Z<p>Neon: </p>
<hr />
<div> Tesla Model S manufactured after 7/14 can use the A-pillar harness for OpenPilot. This harness takes minutes to install with only 1 screew to remove (in order to remove the A pillar cover). This new harness also simplifies the install of the [[Tesla Bosch Radar]]. Please ask in the discord group about availability and compatibility.<br />
<br />
[[File:EPAS Harness.png|420px|frameless|right]]<br />
[[File:Tesla EPAS Harness.png|200px|thumb]]<br />
[[File:Amps wire gauge size chart.jpg|200px|thumb|AWG Chart]]<br />
<br />
<youtube>TIKGK0Iabtc</youtube><br />
* You can follow @Deftdawg's EPAS creation video<br />
* When creating harnesses, please use the AWG chart to select the right wire gauge for your amps and length needs.<br />
** '''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.<br />
** '''SECOND NOTE:''' There is another way to fish the EPAS cable through the firewall that will take a bit more work, and we don't currently have instructions written. If you'd like to help us document by performing this method and taking pictures, we'd appreciate it.<br />
** @Raf & @erflesby's guide here: [https://docs.google.com/document/d/1q5JjWp0YRnWe-4rbyW1Z0T3OT5UOAsH0rTv5Mr0-8Eo/edit?usp=sharing Putting together a tesla EPAS wire harness]<br /><br /><br /><br />
<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.<br /><br /><br />
# 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. <br /><br /><br />
# 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.<br /><br /><br />
# 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]<br />
#* '''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.<br />
#* '''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.<br /><br /><br />
# 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 [[Panda#Flashing_the_Panda|Flashing the Panda]] manually (currently automatic flashing is not supported). 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).<br /><br /><br />
# 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.<br /><br /><br />
# [[EON#Installing_the_EON|Install the EON]] in your windshield.<br />
<br />
<br />
*Mouser shopping list:<br />
**[https://www.mouser.com/ProductDetail/571-1-967616-1 Female connector]<br><br />
**[https://www.mouser.com/ProductDetail/571-5-962885-1-LP Female pins]<br><br />
**[https://www.mouser.com/ProductDetail/571-1-967587-3 Male connector]<br><br />
**[https://www.mouser.com/ProductDetail/571-1-928918-1-CT Male pins]<br><br />
**[https://www.mouser.com/ProductDetail/571-967067-1 Rubber seal plug]<br><br />
**[https://www.mouser.com/ProductDetail/571-967056-1 Rubber seal for cable]<br><br />
<br />
<br />
You can follow @Robert Cotran's full OP installation (including the EPAS harness) video.<br />
<br />
<div style="text-align: center;"><br />
<youtube>v3jjzRYBsJI</youtube><br />
</div><br />
<br />
Other resources:<br />
* [https://docs.google.com/document/d/16bKxcIXW9QkY05kQ6238pzV3qiSpC-DRYwkfkN2dObM/edit?usp=sharing @Raf's Installing EPAS cable guide in pictures doc]</div>Neonhttps://tinkla.us/index.php?title=File:EPAS_Harness.png&diff=885File:EPAS Harness.png2020-06-12T01:39:21Z<p>Neon: </p>
<hr />
<div>EPAS Harness with additional CAN wire pair for radar (taped away on other end temporarily for later use)</div>Neonhttps://tinkla.us/index.php?title=Template:Flashing_the_Panda&diff=869Template:Flashing the Panda2020-05-07T08:46:23Z<p>Neon: </p>
<hr />
<div>Most of the OpenPilot updates (or when installing new) require you to also update the software on your Panda. Here's how:<br />
<br />
In your Tesla while it says “Car Off” connect your Panda to your Giraffe rev B OBD (or EPAS OBD). Connect your EON to the Panda via USB. Then SSH in and run:<br />
<source lang="bash">cd /data/openpilot/panda/board<br />
killall boardd<br />
make clean<br />
make && sleep 1 && (make recover || make recover) && echo Success! Rebooting in 2s... && sleep 2 && reboot<br />
</source><br />
The kill command ensures that the EON stops regular communication to the Panda. That's also why a reboot is needed at the end. If any error occurs (which of course should not happen) the reboot will be skipped so you can troubleshoot.<br />
AssertionErrors should be fixed by rebooting EON and trying a second time. Optionally you may also power cycle your Panda by reseating it.</div>Neonhttps://tinkla.us/index.php?title=Pedal_Interceptor&diff=868Pedal Interceptor2020-05-07T08:43:15Z<p>Neon: </p>
<hr />
<div>The Comma Pedal is used to provide advanced acceleration and regen braking capability on Tesla cars running Openpilot that do not have iBooster installed.<br />
<br />
Without electric brakes (iBooster) the car only uses regenerative braking. This is not enough for sudden slowdowns. YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT.<br />
[[File:Pedal.jpg|300px|border|right]]<br />
<br />
=== What it Does ===<br />
The Comma Pedal is an accelerator pedal interceptor. It is a device that is inserted between a car's electronic accelerator pedal and the DU (Drive Unit). It detects the voltage from the accelerator pedal which represents the pedal's position. It then writes that same voltage back out to the DU as if the accelerator pedal had produced it.<br />
<br />
The Comma Pedal has 4 main systems:<br />
# 2 Analog to Digital Convertors<br />
#* This is used to read the voltage from the car's accelerator pedal into the Comma Pedal's processor. The accelerator pedal produces an output Voltage between 0 and 5 Volts. <br />
# 2 Digital to Analog Convertors<br />
#* This is used to send voltage back to the car's DU as if the accelerator pedal had produced it.<br />
# 1 CAN Bus <br />
#* The CAN Bus is the car's communication network. The Comma Pedal communicates with Openpilot using the CAN Bus. It connects to the Tesla Giraffe on CAN3.<br />
# 1 USB<br />
#* This is used to program and monitor the Comma Pedal, itself.<br />
<br />
When Openpilot is NOT engaged, the Comma Pedal reads the voltage from the accelerator pedal and just passes it along to the DU. <br />
<br />
When Openpilot IS engaged with [[Longitudinal Control: ACC|longitudinal control]], it gets the virtual accelerator pedal position from Openpilot and passes it on to the DU.<br />
<br />
The Comma Pedal is also constantly sending the physical accelerator pedal's position to the CAN bus for Openpilot to read. This way you can increase speed temporarily without having to adjust max speed or disengage longitudinal control.<br />
<br />
=== Obtaining a Comma Pedal ===<br />
You cannot buy a pre-built Comma Pedal from Comma. Fortunately there are other people in the community manufacturing and selling them:<br />
* sold by [https://discordapp.com/invite/Wyna3qy wocsor#0313] (no longer has a website link)<br />
* https://develolab.com/products/prod_FSN6fKevhpGWE2 (sold by [https://discordapp.com/invite/Wyna3qy Chase#7213])<br />
* https://www.ebay.com/str/level2tesla (sold by [https://discordapp.com/invite/Wyna3qy Flyboyn222pa#0407]<br />
<br />
Since they're currently always sold out as soon as new ones get in stock, you could also [https://github.com/commaai/neo/tree/master/pedal build it yourself] (not recommended) or have one [https://medium.com/@joshuairl/comma-pedal-building-with-macrofab-6328bea791e8 fabricated through a service like Macrofab].<br />
<br />
=== Wiring a Tesla Pedal ===<br />
[[File:Pedal board.jpg|300px|border|right]]<br />
In order to create your Tesla Pedal you need:<br />
* 1x Comma Pedal board (for sources see above section)<br />
* 1x [https://www.amazon.com/LeMotech-Plastic-Electrical-Junction-72x42x23mm/dp/B07F3Y8L95/ box to hold the board] if your Pedal doesn't already have a case (current ones ship with 3D printed cases). You will need to cut some [[:File:Pedal in box.png|small openings]] on the sides (and in front of the RJ45) if you use this one.<br />
* 1x set of "WPT-929" connectors (actually [https://www.molex.com/molex/products/datasheet.jsp?part=active/0314026110_CRIMP_HOUSINGS.xml Molex]) - [https://www.amazon.com/dp/B07GZY4ST4 fast shipping], [https://de.aliexpress.com/item/32778798102.html slow shipping]<br />
* ~3ft of wire for the connectors in case your Pedal and connectors don't come with them (~AWG24)<br />
* 1x SN-28B crimping tool (same one as used for EPAS cable - [https://www.amazon.com/Wovier-Compression-Ratcheting-0-1-1-0mm2-Wire-electrode/dp/B01CE4FAMW fast shipping], [https://www.aliexpress.com/item/32843027501.html slow shipping])<br />
* '''EITHER''' 1x ethernet cable ~2ft (not crossover) for current gen Pedal and [[Tesla Giraffe]] (rev B) which have RJ45 ports<br />
* '''OR''' 1x JST2 male and 1x female connector plus some twisted pair wire if RJ45 is not present. You can [https://www.digikey.com/product-detail/en/adafruit-industries-llc/1131/1528-1494-ND/5761282?WT.srch=1&gclid=EAIaIQobChMIjO_5yJyK4gIV1gOGCh1lOAh1EAQYAiABEgLflfD_BwE buy this] and cut it and you're done (not twisted but will work just fine)<br />
<br />
<br />
Use the diagram to connect the female WPT-929 pedal connector to the IN side of the pedal board and the male WSP-929 connector to the OUT side of the pedal connector.<br />
[[File:Tesla pedal wiring.png|330px|border|right]]<br />
[[File:Pedal connector.png|left|200px]][[File:Pedal pinout.png|400px]] <br />
<br />
<br />
<br />
Connecting the CAN BUS from the Pedal to the [[Tesla Giraffe|Giraffe]] depends on your setup, as explained in the parts list above.<br />
[[File:Pedal CAN connection.png|thumb]]<br />
: Via RJ45: Plug in the ethernet cable into the RJ45 port of the Pedal and the other end into the RJ45 port of the Giraffe that is labelled with "comma". <br />
: Via JST2: Solder positions 3 and 6 of the fake-ethernet port of the Pedal board to the two JST2 connectors (male and female) with enough length to reach EPAS cable/Giraffe. We need both because you will plug the female one in the [[Tesla Giraffe|Giraffe's]] EPAS connector and then the EPAS Harness into the male JST2. Red should be CAN+ and black should be CAN- (that's the convention also used in the image showing the CAN wire soldered to pins 3 and 6 of the fake ethernet port on the Pedal board).<br />
<br />
=== Installing the Tesla Pedal ===<br />
To install the Pedal, there are two steps:<br />
# connecting the board to the accelerator pedal<br />
# connecting the board to the [[Tesla Giraffe]]<br />
<br />
[[File:Pedal connected.jpg|frameless|right]][[File:Pedal installed.jpg|frameless|right]]<br />
This [https://www.youtube.com/watch?v=UiQved6gt2U video] for a similar product shows you what you have to do in order to install the Pedal interceptor between the accelerator pedal and the car's existing connector. Take your time and watch the video first. The process is not complicated if you just follow it step by step.<br />
<br />
Once that is complete, connect your ethernet cable to the Pedal and the Giraffe's "comma" labelled RJ45 Port.<br />
Older Giraffes and Pedals without RJ45 ports connect over JST2: Disconnect the EPAS cable from the Tesla Giraffe and connect the female JST2 from your Pedal to the Giraffe. Then connect the EPAS cable to the male JST2 from your Pedal.<br />
<br />
If your Pedal needs to be flashed, don't put your trim back on just yet. Instead connect the Giraffe and Panda to the car and and follow instructions below. This makes it easier to get to the Pedal in case necessary.<br><br />
Once you're ready to cover everything up, make sure you don't forget to reconnect the footwell LED and that all your cables are positioned well, so that they don't rub against sharp edges and that there's no tension on them.<br />
<br />
=== Flashing the firmware for Tesla Pedal ===<br />
You have to use a [https://github.com/BogGyver/panda/tree/tesla_pedal Tesla specific firmware] on the Pedal in order to work for Tesla. <br />
You can flash the Pedal directly from the EON, this is why '''we highly recommend installing the Pedal in your car before flashing (see section above)'''. If, for whatever reason, you need to flash your Pedal outside the car, use below instructions in conjunction with [https://medium.com/@jfrux/flashing-the-comma-pedal-with-ubuntu-a83fb668f6e2 this guide] by [https://medium.com/@jfrux @jfrux]<br />
<br />
===== Step 1: Get the code =====<br />
SSH into your EON, then download our latest Pedal code (use <source lang="bash" inline>git pull</source> in /data/panda if you already cloned the repo).<br />
<source lang="bash"><br />
git clone --depth 1 https://github.com/BogGyver/panda.git -b tesla_pedal /data/panda<br />
</source><br />
<br />
===== Step 2: Prepare your hardware =====<br />
Connect your EON to your car (Panda) if not already done. Then press the brake pedal to power up the Pedal.<br />
<br />
Now kill all OP processes on the EON to free the CAN bus and change to the directory where all flashing related files are located.<br />
<source lang="bash"><br />
tmux kill-session -t comma<br />
cd /data/panda/board/pedal<br />
</source><br />
<br />
===== Step 3.1: Flashing via CAN =====<br />
Flashing via CAN<sup>1</sup> is the recommended (easy) way but '''only possible with Pedals ordered after 7th Sept. 2019'''. Older Pedals and those built yourself need to follow Step 3.2 instead. They will then also gain the ability to be flashed via CAN for future updates.<br />
<br />
Run and wait for this command to finish:<br />
<source lang="bash"><br />
make canflash<br />
</source><br />
In case flashing is stuck at <source inline>checking for flasher</source>, press CTRL+C to abort and re run above command. Power cycling Panda by reseating it may also help. If CAN flashing doesn't work for whatever reason you can always try Step 3.2 as a fallback.<br />
<br />
<sup>1</sup> <small>Original resource: [https://medium.com/@jfrux/comma-pedal-updating-the-firmware-over-can-fa438a3cf910 Comma Pedal: Updating the Firmware over CAN] by [https://medium.com/@jfrux @jfrux]</small><br />
<br />
===== Step 3.2: Flashing via USB =====<br />
'''Flashing via USB involves more steps and is only necessary if flashing via CAN is not possible yet (see explanation in Step 3.1).'''<br />
<br />
If you built your Pedal yourself or it was shipped without any firmware, it will boot in DFU mode. To know which mode you're in look at the LED on the Pedal board: no light = DFU mode, slow blink = normal flash mode, fast blink = normal operations.<br />
<br />
If your Pedal LED is blinking, you can put your Pedal into DFU mode via CAN:<br />
: <source lang="bash"><br />
./enter_canloader.py --recover<br />
</source><br />
: It's possible that the LED won't turn off on the first try, but usually does so after entering the command a second time*. In case you get an AssertionError, reboot EON and start over from step 2. Also power cycle your Panda by reseating it if the issue persists.<br />
<br />
While in DFU mode, connect your EON via USB to the Pedal (unplug from Panda or use a second USB cable) ensuring that the car does not go in Car Off mode (don't lift your butt off the driver's seat) since Pedal would lose power and therefore also DFU mode.<br /><br />
Now run this command to flash the bootloader and operational code:<br />
<source lang="bash"><br />
make recover<br />
</source><br />
Sometimes you have to issue the command multiple times until it completes successfully. With the updated bootloader you'll be able to flash future updates via CAN.<br />
<br />
Once done, unplug USB from the Pedal and back into the Panda.<br />
<br />
<nowiki>*</nowiki> <small>If you can't or don't want to put the Pedal into DFU mode via CAN, you can also do so by [https://medium.com/@jfrux/flashing-the-comma-pedal-with-ubuntu-a83fb668f6e2#fcdf applying 5 Volt to a special point on the board] while connecting it to USB (to power it up). Car must obviously be off or disconnected for this. That usually requires 2 people: one to keep the jumper for 5V in place and the other to connect the USB.</small><br />
<br />
===== Step 4: Cleanup =====<br />
If all went good you can reboot EON to restore the OP processes that were closed in step 2.<br><br />
Once the pedal is back in operational mode (rapid LED blinking), PRND letters should be white. If it's not, first try to reboot pedal: Open the driver door while not sitting in the driver seat to make the car go in "Car Off" mode, then step on the brake to turn it back on.<br><br />
If you still experience red PRND letters after a successful flash and pedal being in operational mode, it means a bad connection between the car and the accelerator, so check your pedal Molex connectors.<br />
<br />
=== Using the Tesla Pedal ===<br />
Without electric brakes (iBooster) the car only uses regenerative braking. This is not enough for suddent slowdowns. YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT.<br />
<br />
Out of the box, OP will use the Tesla CC (with stalk spamming) to control CC. This in our OP implementation is called Adaptive Cruise Control or ACC. CC on Tesla only works above 18 MPH (29 km/h).<br />
<br />
If you turn off the Tesla CC by pressing on the CC stalk, OP will switch to Tesla Pedal mode (PCC). This will provide you with smooth adaptive cruise control by sending the right commands to your Tesla Pedal. Tesla Pedal works down to 1 MPH, but be careful, regen brakes stop working at 5 MPH (8 km/h).<br />
<br />
Once you get used to it and you don't care about ACC anymore, you can set <source lang="Python" inline>force_pedal_over_cc = True</source> in the [[OpenPilot Configuration File|config file]] to always use Pedal.</div>Neon