Comma EON: Installing a Fork of OpenPilot

Chat with Experts of Openpilot on Discord
Feel free to reach out with questions & feedback on the community Discord.
Join the Discussions
UPDATE 11/12/18
I now am fully recommending new folks to use Workbench desktop app to connect and install forks of Openpilot as it requires very little setup.
https://medium.com/@jfrux/installing-a-fork-of-openpilot-with-workbench-de35e9388021
UPDATE 06/27/18
Now includes information about checking out my Comma Pedal branch for testing support of your vehicle, as well as backing up your existing openpilot, and restoring it back if the fork / branch doesn’t work.

If your vehicle is not 100% supported by Comma, Inc. you may find yourself needing to use a slightly different version of OpenPilot rather than the one you initially installed on your EON.

That can be a daunting task for a beginner or someone that is less familiar with SSH and issuing shell commands so my goal with these articles is to help bring light to that and help beginner level tech people do some advanced things.

Get one-on-one support by considering Becoming a Patreon supporter. Your financial support helps fund the opc.ai website, and gets you continued dedicated one-on-one support from myself and others that become a part of this effort. Visit https://www.patreon.com/openpilotcommunity today to help the efforts! Every little bit helps.

Prerequisites to this article

UPDATE OCT. 2018: Getting connected via SSH is a huge part of this process.
Thankfully, I’ve been working on a new tool for the community to bypass this step. It’s called Workbench, and it’s available on Windows, Mac and Linux.

Visit https://github.com/openpilot-community/workbench to download the latest version to quickly find your EON on your network, and configure SSH.
Keep in mind, you do have to enable the SSH switch on your EON settings.

If you haven’t already done so, please follow along with my Getting Connected article before proceeding. You can find it below:

Open Terminal / PowerShell

On Mac: CMD+SPACEBAR and type Terminal and press Return.

On Windows: Press theWINDOWS KEY on your keyboard and type PowerShell and Right click the result and click Run as Administrator or right click the Start Menu icon and go to Power Shell (Admin)

On Ubuntu: CTRL+ALT+T

You will remain in Terminal / PowerShell for the majority of this article series.

Get Connected

Ensure your EON is connected to the same wifi network as you and then connect to it via SSH like so:

ssh root@<IP_ADDRESS_OF_EON> -p 8022 -i ~/.ssh/openpilot_rsa
For additional information on how to SSH into your EON, checkout my article on Connecting to EON via SSH. It also contains information on determining your EON’s IP address, and its Wifi settings.

You will be placed in the /system/comma/home directory after connecting.

Change to the data directory

We’re going to move into the /data directory which is the parent directory of openpilot which is the folder we will be changing.

NEOS the Android-based operating system running on your EON expects openpilot to be in /data/openpilot so any openpilot branch, tag, fork, etc. you place in that directory path will be attempted to load upon boot.

Change to the data directory

Backup OpenPilot Directory

The quickest / cleanest way to back up OpenPilot is to simply rename the folder to something else. You can quickly do this by issuing this command:

mv openpilot openpilot.backup

This mv command is moving the directory openpilot and its contents to the openpilot.backup directory.

To check your work at anytime, you can list the directory on the screen using the command below:

ls -lah
Listing the contents of the data directory

Clone the OpenPilot Fork

Now it’s time to get the new OpenPilot fork you’re wanting to use.

For this demonstration, we will use my fork of OpenPilot found at:

On the GitHub repository website there is a Clone or download button.

Click that and copy the full address of the repository.

Now go back to your Terminal / PowerShell window and enter the following command:

git clone https://github.com/jfrux/openpilot.git
Cloning the Fork Repository

Using a specific branch of the fork

When we use git clone like above, it will clone the default branch for the repository. Sometimes this is what we’re wanting, sometimes it’s not.

In the case where it’s not, you’ll need to change to the recommended branch for the code you’re testing.

For my example, I’d like to use my latest pull request for the Comma Pedal modification you can use to achieve stop-and-go in car’s that don’t currently support stop-and-go which allows your vehicle to slow all the way to a stop in traffic and start going again on it’s own without touching the pedals. Most car’s do not allow this, for whatever reason (most likely manufacturer liability) and limit your vehicle to not use ACC / LKAS below 25 mph or so. Some are as high as 40 mph!

Learn more about Comma Pedal on the Wiki or read up on how to build your own in my how to guide.

Anyway, wow tangent city…

You can checkout any branch by using this the following command within the directory of openpilot at /data/openpilot

git checkout <branch_name>

In our case, let’s checkout my Pedal branch if you have a Comma Pedal installed and the PR hasn’t been merged into the primary repo yet.

git checkout feature/support-for-comma-pedal

Now on to rebooting and trying it out!

Reboot EON

This is necessary to have EON use the new code-base. It has a compile process it runs upon boot.

PLEASE NOTE: This could take awhile, you might see this loading openpilot screen for 15 to 30 minutes in some cases if you are using fresh new clone / fork.
reboot

Monitoring the compilation process

If you’re really curious what is happening underneath while it’s loading… you can monitor this with tmux attach. Use my handy tmux cheatsheet for EON below:

Updating Your New Fork

If the maintainer of the fork updates the codebase, it’s simple to grab the fresh code.

cd /data/openpilot; git pull; reboot

Restoring From Your Backup

If the fork you tried failed for any reason, or isn’t offering you the correct functionality. You may quickly restore your backup that we created earlier in the article by following theses quick steps.

Repeat the first steps about connecting to SSH if you aren’t already.

Once connected, change into the /data directory

cd /data

Now, as long as you named your backup openpilot.backup as stated earlier in the article…

Run the following command to move the fork to a new backup.

mv openpilot openpilot-fork.backup

And then move your previous backup to it’s new home…

mv openpilot.backup openpilot
Always remember, EON looks for openpilot to be in the /data/openpilot folder so as long as you place it in there, you’re good.

Now just reboot again and you’ll be running your previous version before the fork.

reboot

Profit.

If you have any questions or issues with this, feel free to leave a comment or hit me up on our community Discord. My username is @jfrux.