Skip to content

command processor for automotive ECUs with a built-in text-based CAN bus terminal (using a panda)

License

Notifications You must be signed in to change notification settings

gregjhogan/can-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAN shell

command processor for automotive ECUs with a built-in text-based CAN bus terminal (using a panda)

CAN terminal

Usage

note that most vehicles with a gateway block the required addresses, so you need a direct communication line for any of this to work

hardware

Currently supported:

Honda Accord 2018+ EPS connector:

Tesla AP1 EPAS connector:

setup

pip install -r requirements.txt
sudo ln -s $(pwd)/cansh /usr/local/bin/

scan for TX/RX addresses (if you don't already know them)

cansh --scan

setup address environment variables

Honda Accord 2018+ EPS

export CANTERM_ENABLE_TX_ADDR=1882
export CANTERM_ENABLE_RX_ADDR=1883
export CANTERM_COMMAND_TX_ADDR=1834
export CANTERM_COMMAND_RX_ADDR=1835

Tesla Pre-AP/AP1 EPAS

export CANTERM_ENABLE_TX_ADDR=1634
export CANTERM_ENABLE_RX_ADDR=1635
export CANTERM_COMMAND_TX_ADDR=1636
export CANTERM_COMMAND_RX_ADDR=1637
export CANTERM_FACTORY_MODE_BYPASS=1

interactive shell

# assumes environment variables are set up
cansh
# type 'help' to see available commands and 'exit' to quit

or (without environment variables)

# insert appropriate address (decimal) before running below commands
cansh --enable-tx-addr <enable-tx-addr> --enable-rx-addr <enable-rx-addr> --command-tx-addr <command-tx-addr> --command-rx-addr <command-rx-addr>
# type 'help' to see available commands and 'exit' to quit

single command

# assumes environment variables are set up
cansh -c 'rd 0x00000000 1'

non-interactive (pipe)

# assumes environment variables are set up
echo 'rd 0x00000000 1' | cansh

execute script example.sh (multi-command)

# assumes environment variables are set up
./example.sh

or

# assumes environment variables are set up
cansh ./example.sh

Enhancements

  • additional ECUs with a CAN terminal most likely exist, write support and submit a PR!
  • a good shell supports variables, conditional branch logic and looping constructs
  • additional hardware support

About

command processor for automotive ECUs with a built-in text-based CAN bus terminal (using a panda)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published