A panda and a cabana: How to get started car hacking with comma.ai

A panda and a cabana: How to get started car hacking with comma.ai

Contents

H2: What’s a Rich Text element?

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

H3: Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

text

H1: This is a Heading 1

This is some paragraph. lorem epsum.

This is a fig caption. This is how it will look like under a video frame as a description.

H4: How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

H5: Sample text is being used as a placeholder. Sample text helps you understand how real text may look. Sample text is being used as a placeholder for real text that is normally present.

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

H6: How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

Block Quote: Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

This is a heading 3.

  1. Sample text is being used as a placeholder.
  2. Sample text is being used as a placeholder.
  3. Sample text is being used as a placeholder.

This is a heading 2.

  • Sample text is being used as a placeholder.
  • Sample text is being used as a placeholder.
  • Sample text is being used as a placeholder.
# clone openpilot into your home directory
cd ~
git clone --recurse-submodules https://github.com/commaai/openpilot.git

# setup ubuntu environment
openpilot/tools/ubuntu_setup.sh

# build openpilot
cd openpilot && scons -j$(nproc)

A quick link for those who’d just like to buy a panda, otherwise read on.

Buy a white panda here!

When I started on this journey 2 years ago, first trying to hack my ILX to drive itself, getting your car to talk to your computer was hard. I vaguely knew cars had a CAN bus, and I also knew they had an OBDII port. So I purchased a USB to OBDII interface off Amazon.

ELM327 Based USB Interface

When I plugged it in to my MacBook, it showed up as a serial interface. And it used AT commands. I found some Python code to speak this protocol, and I thought I could now talk to the car.

When the code worked (which was about 50% of the time!), the information it gave me was very limited, mostly just about the engine. Surely there had to be more…

So I dove deeper, and looked into what’s actually on the OBDII port. Sure enough, there is a CAN bus! Many of the USB to CAN transceivers were thousands of dollars, but I found a moderately priced one that gave me full access. We were in business, and I could read all the CAN messages on the bus.

At first, it was just random noise. But after a few weeks of reverse engineering, it started to make sense. I found the message broadcasting the speed. Then I found the message broadcasting the steering angle. Then, I found the message that would actually let me turn the steering wheel via software!

A few weeks later, I had a very basic self driving car. And the rest is history.

panda: the nicest universal car interface ever

In order to get the reliability and throughput we needed to make cars self driving, we started building our own interface hardware.

When we gave away the plans for our first self driving hardware, we included a custom car interface board. It interfaced two CANs with USB. But some cars needed more. So we built panda.

Panda OBDII pinouts

panda is the nicest universal car interface ever.

It supports 3 CAN, 2 LIN, and 1 GMLAN. It also charges a phone. On the computer side, it has both USB and Wi-Fi.

The software is 100% open. And it plugs into the OBDII port on every car made in 1996 or later.

Software Compatibility

chffr: chffr is our cloud dashcam app. It allows you to record and review your drives, in addition to helping to train self driving cars. Now if you have a panda paired with chffr, you can record all the sensors from your car. From any part of your drive, assuming your car has the sensors, you’ll be able to see how many RPM your engine was going, how much gas was in your tank, your MPG, if you had a door open, how hard you hit the brake, and much much more.

chffr when in use

pandacan: pandacan is a user space library for talking to your car over USB or Wi-Fi from Python. It allows full read/write access to all the CAN and LIN buses. “pip install pandacan”

SocketCAN: SocketCAN is the Linux standard for CAN interfaces. The included driver allows panda to work with all SocketCAN tools, including can-utils and Wireshark.

openpilot: openpilot, our open source driving agent, can use panda to communicate with your car and control the gas, brake, and steering on supported vehicles.

Support for J2534 on Windows and ELM327 emulation coming shortly. This will enable it to work with most manufacturer diagnostics tools and apps like Torque.

And one more piece of software is supported…

cabana: comma.ai CAN analysis tool

CAN bus analysis is what allows you to make sense of all the sensors and signals in your car. Aside from CANalyzer, which is a $10,000 proprietary Windows only tool, there is no good software for CAN analysis.

Today, with the launch of comma cabana, this changes. We’ve set our app team loose on building the best CAN analysis tool to ever exist to complement our panda hardware. And I think they’ve succeeded.

On the left, you’ll find all the signals from your car. In the middle, the signal you are currently editing. And on the right, your driving video and graphs of the signals.

cabana is already live to all panda and NEO users, who can access it by clicking the purple checkmark on the driving explorer. Everyone else can try it out on an Acura ILX demo route.

Here is a livestream of me reverse engineering the signals on my Prius using a panda and cabana (skip to near the end for the good stuff). What took weeks before now only takes hours. We’ll also be doing a livestream Friday @ noon PST. Follow us on Twitter @comma_ai for details.

opendbc

Even if you have a high quality CAN interface and great CAN analysis software, it’s still some work to figure out what the messages in your car mean. But it’s work that should only be done once in the world per car.

opendbc

cabana integrates with our DBC repository, opendbc. DBC is the industry standard “decoder ring” for your car, and cabana makes it easy for you to create, save, and share DBC files with the world. From cabana: you can fork the opendbc repo to your github account, make edits as you discover new things about your car, then submit a pull request to the main repo when you are ready.

Our goal is to build a repository with a DBC file for every car ever manufactured and democratize access to the decoder ring for your car.

Getting a panda

We have given away over 50 panda to developers and people with many comma points. If you are an active member of the comma.ai community (join our slack!), you may find yourself with a free panda.

But for everyone else, for the first time in history, comma.ai is selling a product. You can order a panda for $88 shipped anywhere in the world. Your card will not be charged until your panda is ready to ship, which should be in around 4 weeks for the first to order and up to 12 weeks if you are late.

How to get started

  1. Order a panda!
  2. Download our dashcam app chffr.
  3. On arrival, pair your panda with chffr.
  4. Go for a drive.
  5. Use cabana to explore your car.