Scripts to demonstrate simulating button inputs via CAN bus signals in your Tesla Model 3, Y, and newer S and X.
You will find the sample mars mode scripts in examples/marsmode
- 1x Raspberry Pi4+Case
- 1x USB-C to USB-A Cable for usage
- 1x USB-A to USB-A Cable for flashing firmware (or flash in car powered by ODB)
- 1x MicroSD Memory Card
- 1x White Comma Panda
- 1x ODB Adapter Cable
Go to raspberrypi.com, click Software and download Raspberry Pi Imager for MacOS, Windows or Ubuntu
Open Imager, Select Pi4, Select Other -> Raspberry PiOS Lite (64-bit), Select your Memory Card and Click Next
Note: This was tested and confirmed working with Pi3b + PiOS (Legacy) 64-bit Lite as well
OS Customization Settings: hostname, user+password, wireless, and locale
Click Write and Confirm Overwriting All Files on the memory card
When complete, remove memory card, place into pi4, attach white comma panda via usb, and power up the pi.
Login via ssh from remote or using keyboard and mouse locally
curl https://spleck.net/mars-mode-install | bash
That's it, good luck! If you run into trouble, or just want to see more detail as it works:
curl https://spleck.net/mars-mode-install | V=1 bash
sudo apt-get update
sudo apt-get install -y dfu-util gcc-arm-none-eabi python3-pip libffi-dev git scons screen
git clone https://github.com/spleck/panda.git
python -m venv ~/panda/
export PATH=~/panda/bin:$PATH
cd ~/panda
pip install -r requirements.txt
python setup.py install
sudo tee /etc/udev/rules.d/11-panda.rules <<EOF
SUBSYSTEM=="usb", ATTRS{idVendor}=="bbaa", ATTRS{idProduct}=="ddcc", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="bbaa", ATTRS{idProduct}=="ddee", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0666"
EOF
sudo udevadm control --reload-rules && sudo udevadm trigger
cd board
scons -u
for dir in ~/panda/lib/python*/site-packages/pandacan*; do ln -s ~/panda/board $dir/board; done
./recover.py
./flash.py
grep -v ^exit /etc/rc.local >/tmp/.rcl
echo screen -d -m -S mars /home/$USER/panda/examples/marsmode/marsmode-active.sh >>/tmp/.rcl
echo exit 0 >>/tmp/.rcl
cat /tmp/.rcl | sudo tee /etc/rc.local
echo dtoverlay=dwc2,dr_mode=host | sudo tee -a /boot/firmware/config.txt
cd ~/panda/examples/marsmode
./marsmode-active.sh marsmode-mediavolume-basic.py
sudo halt
For inforamtion about comma panda visit comma.ai panda
panda software and mars mode scripting are released under the MIT license unless otherwise specified.