Updates to the CAN translator firmware may be distributed as pre-compiled binaries, e.g. if they are distributed by an OEM who does not wish to make the CAN signals public. If that’s the case for your vehicle, you will have a .hex file and can use the upload_hex.sh script to update your device.
git, curl, libsasl2, ca-certificates
$ echo "set -o igncr && export SHELLOPTS" >> ~/.bashrc && source ~/.bashrc
If you already have Git installed, you can skip ahead to the all platforms section
Install Git from your distribution’s package manager.
Ubuntu:
$ sudo apt-get install git
Arch Linux:
$ [sudo] pacman -S git
$ export http_proxy=<your proxy> $ export https_proxy=<your proxy>
$ git clone https://github.com/openxc/cantranslator
You need to have the mini-USB port on the chipKIT connected to your computer to upload a new firmware. This is different than the micro-USB port that you use to read vehicle data - see the device connections section of the OpenXC website to make sure you have the correct cable attached.
Open a terminal and cd into the cantranslator folder that you cloned with Git. Run the upload_hex.sh script with the .hex file you downloaded:
$ script/upload_hex.sh <firmware file you downloaded>.hex
The upload_hex.sh script attempts to install all required dependencies automatically, and it is tested in Cygwin, OS X Mountain Lion, Ubuntu 12.04 and Arch Linux - other operating systems may need to install the dependencies manually.
If you have more than one virtual serial (COM) port active, you may need to explicitly specify which port to use. Pass the port name as the second argument to the script, e.g. in Linux:
$ script/upload_hex.sh <firmware file you downloaded>.hex /dev/ttyUSB2
and in Windows, e.g. if you needed to use com4 instead of the default com3:
$ script/upload_hex.sh <firmware file you downloaded>.hex com4
Windows notes:
In Windows, this command will only work in Cygwin, not the standard cmd.exe or Powershell.
If you get errors about $'\r': command not found then your Git configuration added Windows-style CRLF line endings. Run this first to ignore the CR:
$ set -o igncr && export SHELLOPTS
If the bootstrap script failed, you will need to install the dependencies manually. You will need:
If you are using Windows or OS X, you need to install the FTDI driver. If you didn’t need to install MPIDE, you can download the driver separately from FTDI.
In order to program the CAN translator, you need an AVR programmer tool. There are a number of options that will work.
With MPIDE
If you have MPIDE installed, that already includes a version of avrdude. You need to set the MPIDE_DIR environment variable in your terminal to point to the folder where you installed MPIDE. Once set, you should be able to use upload_hex.sh.
Without MPIDE
If you do not already have MPIDE installed (and that’s fine, you don’t really need it), you can install a programmer seprately:
Linux - Look for avrdude in your distribution’s package manager.
OS X - Install avrdude with Homebrew.