You are on page 1of 43

CAN Setup for BTT Octopus Pro v1.0 and EBB36 v1.

2
-Driver 732 5/2/2023

OVERVIEW AND DISCLAIMER

As a supplement to my video, this documents how I set up CAN bus on the Voron 2.4r2. It utilizes the
Octopus built-in bridge mode, and eliminates the need of a separate USB to CAN adapter. I wrote this to
the best of my ability, but information changes over time. It is your responsibility to familiarize yourself
with the basic process before attempting. I am not responsible for any damage(s), typos, or
misinformation.

Be especially careful when erasing and flashing firmware, the riskiest part of the process. Even after
following the exact same steps, you may encounter unforeseen issues which require re-flashing of the
original bootloader. Have this .hex file ready, as they are typically available online, and can be flashed as
a last resort. It can be the difference between saving the day versus a bricked board. Always have a
backup plan.

There are alternate methods of flashing firmware, which are outside the scope of this document. These
include using the CLI (instead of the GUI), and using Micro SD cards to transfer the firmware files.

PREREQUISITES

-Voron build, with the necessary wiring for power and data communication

-Raspberry Pi. This document has not been tested on alternatives such as the Orange Pi

-Basic Linux Knowledge for understanding of simple commands

-Windows desktop or laptop for WinSCP and STM32CubeProgrammer

-Model/serial number of controller and CAN tool board processors. For this documentation, I am using
the Octopus Pro v1.0 w/ F446 chip and EBB36 v1.2 w/ G0B1 chip.
INSTALLING KIAUH (KLIPPER INSTALLATION AND UPDATE HELPER)

Download/Install the Raspberry Pi Imager and launch the application. Under Operating System, click
‘CHOOSE OS’ and select ‘Raspberry Pi OS (other)’ and ‘Raspberry Pi OS Lite (32-bit)’
Insert a Micro SD card into your computer and under ‘Storage’ click ‘CHOOSE STORAGE’ to select it

IMPORTANT: Click the gear icon on the bottom right corner before clicking ‘Write’.
Enable SSH with the ‘Use password authentication’ option. Enable ‘Set username and password.’ Leave
the default username (if possible) and enter a password. Enable ‘Configure wireless LAN’ and enter Wi-
Fi credentials. Click ‘SAVE’. NOTE: Recent versions of the Pi no longer support the default username ‘pi’
and password ‘raspberry.’ Make sure to set login credentials now, or you won’t be able to log in later.
Click ‘WRITE’ and click ‘YES’ on the prompt. Wait for the imager to complete, and it should power off
USB gracefully for removing the Micro SD card.
Insert the Micro SD card and connect a 5V Micro USB power cable to the Pi. No other peripherals are
required, since this runs headless with SSH previously set up. The first boot will take a couple minutes as
the system updates and prepares for first login.

By default, routers dynamically assign IP addresses. In this example 192.168.1.121


Open the Windows command prompt by searching for ‘cmd’

Log in by typing: ‘ssh username@pi IP address.’ Substitute italics with your username (set earlier in the
Pi Imager) along with the Pi’s IP address. Type: ‘yes’ on the prompt to continue.
Enter your password and it will default to your Linux home directory ~
Type: ‘sudo apt-get update’ to download and install package updates.

Type: ‘sudo apt-get install git -y’ to install Git and all dependency packages.
Type: ‘cd ~ && git clone https://github.com/th33xitus/kiauh.git’ which clones KIAUH by th33xitus to your
home directory.

Type: ‘./kiauh/kiauh.sh’ to execute the KIAUH shell script. If you get access denied errors, you may need
to sudo or check file and owner permissions chmod/chown.
On the main menu, type: 1 for ‘Install,’ and 1 again on the following screen to install Klipper firmware.
Accept the recommended option of installing Python 3.x. On the following screen, I am installing one
instance of Klipper, but this can be changed to suit your needs.
Add your user to the group when prompted by typing: ‘y’

Repeat to install Moonraker firmware. These scripts are fully automated and require minimal user input.
After Moonraker is set up, install Mainsail (or whichever Web GUI you choose). I installed all three,
which is easily done using KIAUH.
Accept the download of recommended macros, type: ‘y’

Repeat to install Fluidd if desired. NOTE: Mainsail and Fluidd cannot run on the same port. Choose a
different port for Fluidd, in this example 8080. OctoPrint has its own default port of 5000.
After installs are done, type: ‘b’ to return to the main menu. Here, it shows what is installed. Type: ‘q’ to
exit.
Check website availability. Make sure to use http, not https, and append the appropriate port number.

Mainsail ‘http://yourIPaddress:80’

Fluidd ‘http://yourIPaddress:8080’
OctoPrint ‘http://yourIPaddress:5000’

Whichever GUI you choose, update the software if desired. Each interface has in depth customizations
and preferences that can be set. For the remainder of this document, I will use Mainsail.
Optional: Back up configuration files before proceeding as they have default parameters for future
reference.
GENERATE CANBOOT FIRMWARE

Type: ‘git clone https://github.com/Arksine/CanBoot’ to download CanBoot by Arksine

Type: ‘cd CanBoot’ and ‘make menuconfig’ to enter the CanBoot Configuration. Note that Linux is case
sensitive and typing: ‘canboot’ will throw an error.
There are several lines to change. Micro-controller Architecture to ‘STMicroelectronics STM32’,
Processor model to (controller chipset), and Clock Reference to ‘12 MHz crystal’. These are specifically
for my Octopus Pro F446. Screenshot of my settings:

The processor model is labeled on the chip.


Type: ‘q’ then ‘y’ to save.

Type: ‘make’ which compiles the firmware into a subdirectory called ‘out’.
Type: ‘cd out’ which navigates to the subfolder and ‘ls -l’ lists the generated files. The ‘canboot.bin’ file is
here and typing: ‘pwd’ lists the full path which can be used for file copying.

This entire directory gets overwritten once we re-run menuconfig, so rename ‘canboot.bin’ to
‘octopus_canboot.bin’ or similar. Type: ‘mv canboot.bin octopus_canboot.bin’ to rename the file.
From your Windows machine, download and run WinSCP. Connect using your Pi’s IP address and simply
move the ‘octopus_canboot.bin’ file over to the Desktop. Reference the full file path from earlier to
locate the .bin file.
Back in CMD, make sure you are in the right directory. Type: ‘cd ~/CanBoot’
Type: ‘make clean’ followed by ‘make menuconfig’

Repeat for the EBB36 v1.2 board. Note that I am using the default CAN bus speed of 500000. This
number should not be set lower, especially if using ADXL input shaping. Some have had better luck
increasing this to 1000000, which may resolve certain data communication issues.
Quit and save. Type: ‘make’ to generate a new firmware which saves to the same ‘out’ subdirectory.

Navigate to the subdirectory and rename this new ‘canboot.bin’ file to ‘ebb36_canboot.bin’ or similar.
Copy this file over to Windows Desktop using WinSCP.
FLASH CANBOOT FIRMWARE

If you did not read the disclaimer at the beginning, please do so before proceeding.

Download STM32CubeProgrammer:

https://www.st.com/en/development-tools/stm32cubeprog.html#get-software

At this time, version 2.13.0 will not work and must be downgraded for the firmware flash to work. I am
using version 2.8.0. Accept all installation defaults and dependency packages (not shown).

Unless the Octopus is powered by the 24V PSU, you need jumpers installed on BOTH the ‘USB-C Power’
AND ‘Boot0’ pins on the board. Otherwise, a USB A to C cable connected from the Windows computer is
not powerful enough. This is contrary to many guides stating to remove the ‘USB-C Power’ jumper.
Remove all other jumpers and motor drivers if you have difficulty powering the board.
Press and hold the reset button for at least five seconds to set the Octopus to DFU mode.

Start the STM32CubeProgrammer software. The following steps do not work if the software is started
before setting the board in DFU mode. Click ‘Connect’. Status should change from ‘Not connected’ to
‘Connected’ which reads the memory contents.
Erase by clicking the icon on the left, clicking ‘Erase external memory’ and then ‘Full chip erase’. I could
not grab proper screenshots, so you will see much more information. It will prompt to ‘erase full chip
flash memory’ and once finished, notify that ‘Mass erase command correctly executed’. Be aware of
error messages that may indicate problems with the process or a botched attempt. You may need to
repeat this several times.

Once successfully erased, click the write icon on the left and click ‘Open File’. Choose the
octopus_canboot.bin file from earlier, and click ‘Download’. Again, my screenshot is slightly off since I

wrote this documentation after the fact 😊


If everything goes well, you should see success messages. If this is the case, click the ‘Disconnect’ button
and unplug the board from computer.

Be aware of errors such as this. You may have to re-attempt or investigate why it is happening. In this
scenario, it was due to the buggy 2.13 version of software, and the reason I rolled back to 2.8
REMOVE BOTH JUMPERS FROM 5V USB C AND BOOT0 PINS ON THE MCU

Repeat for the EBB36 board. Start by placing a jumper on the VBUS header pins and plug in the same
USB cable for power. Find a way to press these two buttons simultaneously for five seconds to enter DFU
mode.
Start STM32CubeProgrammer as before and follow the exact same steps of erasing and re-writing the
memory, only this time using the ebb36_canboot.bin file. Once completed, remove the jumper from
VBUS and place it on the 120R pins.
SET UP KLIPPER FIRMWARE

Return to CMD and navigate to the Klipper directory, type: ‘cd ~/klipper’ and ‘make menuconfig’

Here are the configuration settings for the F446 Octopus Pro. Note the CAN bus speed must match what
was specified earlier. Some other settings are copied over from earlier.
Type: ‘make’ to compile the Klipper firmware

As before, rename the Klipper file to prevent overwriting in the next step. Type: ‘cd out’ followed by ‘mv
klipper.bin octopus_klipper.bin’. Move the file by typing: ‘mv octopus_klipper.bin ~\klipper’
Type: ‘cd ..’ and ‘ls -l’ to make sure renamed file exists in the parent Klipper directory.

Type: ‘make clean’ and ‘make menuconfig’ to repeat for the EBB36 board
Quit, Save, and type: ‘make’ to generate another firmware for the EBB36 board.
Repeat previous steps to rename and move EBB36 Klipper .bin file to parent Klipper directory.

Type: ‘make clean’


Plug in Octopus to Pi via USB A to C cable and power printer on. Use a proper cable with data capability,
some USB cables only provide power. From CMD, type: ‘ls /dev/serial/by-id/*’ which returns the serial
device ID of the Octopus board. Copy this down.

Type: ‘cd CanBoot/scripts’ then ‘pip3 install pyserial’


Type: ‘cd (serial number)’ to flash Octopus over serial.

Type: ‘cd’ then ‘if

Paste the following, once again noting that bitrate matches the speed specified earlier.
Press CTRL X to save and quit.

Finish any wiring. You need a USB cable connecting the Pi to Octopus along with the CAN wiring (Usually
a telephone cable connected from Octopus to EBB36 board, along with 24V+/- from the 24V PSU).

From CMD, type: ‘ifconfig’. Look for the can0 entry.

ifco

Type: ‘cd CanBoot/scripts’ and ‘python3 flash_can.py -i can0 -q’ which now lists the UUID for both the
Octopus and EBB36. The Klipper label references Octopus, and CanBoot references the EBB36. Copy
both down.
Type: ‘python3 flash_can.py -f ~/klipper/ebb_klipper.bin -u (ebbID canboot)’ to flash Klipper to the EBB36
board via CAN.

Load Mainsail, which may still show errors. Add both UUID from previous step into the printer.cfg file.
Click ‘Save and Restart’. You may also need to do a firmware restart.
Click ‘Machine’, check that both CAN UUIDs are present and you are done! As with non-CAN installs,
time to configure printer.cfg and continue with set up/tuning. Best of luck!

You might also like