The Basics of CAN Bus: A Beginner’s Guide to Understanding the CAN Protocol – Part 2

This is a continuation from Part 1. We’ll be setting up a basic CAN bus network with basic components.

BTT Octopus and EBB42 without U2C Basic Setup

Note: Assuming Klipper git was previously installed at ~/klipper. Please note there are other methods to use CAN bus without BTT U2C, but will involve additional hardware at this time.

Hardware being used

  • Octopus (STM32F446)
  • EBB42 V1.2 (STM32G0B1)
  • 1x 120Ω resistor (or any resistors that add up to 120Ω in series, like 3x 40Ω, 2x 60Ω, or 100Ω & 20Ω)

Power Cables

EBB42 V1.2 has maximum of 5A pull. The printer environment we’ll be using is a Voron 2.4r2 and it uses 24V. We estimate maximum 8 ft of cable from the power source. After using two online calculators provided by and with using 6 Amps for higher tolerance, 18 AWG stranded copper cable would work. Unfortunately, we didn’t have 18 AWG stranded copper cable on hand, thus we’ll be using stranded 16 AWG Aluminum cable for power delivery that we had in our inventory.

CAN BUS Signal Cables

For CAN bus, it is recommended to use twisted data bus to enhance its’ high noise immunity and common-mode rejection. We’ll be using a twisted pair from a working CAT5e stranded cable. CAT5e cable contains 4 twisted pairs of cable.


Above image is a typical CAN bus network, below its what logically it’ll look like.

We choose blue and blue/white stranded pair from the CAT5e cable and solid blue will be CAN high. We soldered one end with the resistor and a twisted cable with a RJ11 end (used this external github reference). The RJ11 end can be plugged into the BTT Octopus V1.1.After installing the twisted pair and power cable into the cable chains, we terminated the BTT EBB42 male Molex connector with the diagram provided from Big Tree Tech at this external github reference. We also plugged in the 120R(Ω) jumper on the EBB42 as we weren’t planning on adding additional nodes/devices to the CAN bus network.

Octopus Steps

IMPORTANT NOTICE: We’re currently running into an issue where we cannot re-flash our Octopus board via DFU mode; but Klipper can be re-flashed via SD-Card (rename klipper.bin to firmware.bin on SD-Card). We weren’t able to flash CanBoot to Octopus, this is usually done prior to installing Klipper firmware; these instructions aren’t here since we couldn’t reproduce and test it. We recommend trying to install CanBoot as your bootloader on both devices as it would simplify Klipper updates.

We are using a STM32F446 Octopus V1.1 Board. Please check the MCU of your Octopus as your settings may be different.

Klipper Installation

  1. Run the following commands:
cd ~/klipper
make menuconfig
  1. Set the following settings:
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32)
Processor Model (STM32F446)
Bootloader offset (32KiB bootloader)
Clock Reference (12 MHz crystal)
Communication interface (USB to CAN bus bridge (USB on PA11/PA12)
Can Bus Interface (CAN bus (on PD0/PD1))
(500000) CAN bus speed
  1. Press q and then y.
  2. Type make and confirm no errors occurs.
  3. Our Octopus board was connected via USB, so we used:
    sudo service klipper stop
    make flash FLASH_DEVICE=/dev/serial/by-id/usb-Klipper_stm32f446xx_...
    sudo service klipper start

Raspberry Pi/Klipper Service Host Setup

We will need to setup a CAN interface for Klipper service to interact with. To confirm that the firmware has been installed, run lsusb and one of the connections should show OpenMoko, Inc Geschwister Schneider CAN adapter.

Add /etc/network/interfaces.d/can0 file with the below contents

allow-hotplug can0
iface can0 can static
bitrate 500000
up ifconfig $IFACE txqueuelen 2048

Then reboot the Raspberry Pi/Klipper service host.

EBB42 V1.2 Steps

We are using EBB42 V1.2, however a previous model version or versions have a flaw where the heater is turned on during flashing and caused fire damage. Double check your version with the manufacture and take necessary precaution steps if required.

  1. If CAN bus connection is connected to EBB, remove this CAN bus connection.
    • Important: If you skip this step, you will damage your EBB42.
  2. Place jumper on USB-C power.
  3. Plug in USB-C cable between Klipper host and EBB.
  4. Power LED should be on by this step.
  5. Hold down boot button and reset button, then release boot button.
  6. Type lsusb and hit enter.
  7. Output text should have a STM and DFU for a single USB device. After ID there will be text formatted as ####:#### this will be referred to as <uuid> in the CanBoot Install steps.

Canboot Install

  1. Run following commands:
git clone
cd CanBoot
make menuconfig
  1. Match settings below:
Micro-controller Architecture (STMicroelectronics STM32)
Processor model (SMT32G0B1)
Build CanBoot deployment application (Do not Build)
Clock Reference (8 MHz crystal)
Communication interface (CAN bus (on PB0/PB1))
Application start offset (8KiB offset)
(500000) CAN bus speed
() GPIO pins to set on bootloader entry
[*]Support bootloader entry on rapid double click of reset button
[] Enable bootloader entry on button (or gpio) state
[] Enable Status LED
  1. press q and y.
  2. Type the below commands and replace <uuid> from the previous EBB42 step 6.
sudo dfu-util -a 0 -D ~/CanBoot/out/canboot.bin --dfuse-address 0x08000000:force:mass-erase -d <uuid>
  1. Disconnect USB-C cable and remove USB-C power jumper.
    • Important: If you skip this step, you will damage your EBB42.
  2. Reconnect CAN bus cable.

Klipper Install

These are steps involved to install Klipper on top of CanBoot for EBB42.

  1. Type the following commands:
cd ~/klipper
make menuconfig
  1. Set the following settings:
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32)
Processor Model (STM32G0B1)
Bootloader offset (8KiB bootloader)
Clock Reference (8 MHz crystal)
Communication interface (CAN bus (on PB0/PB1)
(500000) CAN bus speed
  1. Press q and y.
  2. Run the following:
python3 ~/CanBoot/scripts/ -q
  1. From the previous output, there will be a line formatted like
    Detected UUID: ############, Application: CanBoot
    use the ############ portion for the <EBB UUID> going forward.
  2. There will be another UUID listed with Application: Klipper, use this for <Octopus UUID> going forward.
  3. python3 ~/CanBoot/scripts/ -u <EBB UUID>
  4. You should get CAN Flash Success to indicate successful Klipper flashing.

Klipper Configuration

Klipper configuration will need to be modified:

  1. Edit printer.cfg.
  2. Change [mcu] section.
#serial: /dev/serial/by-id/usb-Klipper_stm34f446...
canbus_uuid: <Octopus uuid>
canbus_interface: can0
  1. Save printer.cfg.
  2. Download the example *.cfg for your EBB. For our case we downloaded bigtreetech-ebb-canbus-v1.2.cfg from and uploaded it into the Klipper configurations folder.
  3. We added [include bigtreetech-ebb-canbus-v1.2.cfg] to the top of printer.cfg.
  4. We modified bigtreetech-ebb-canbus-v1.2.cfg.
[mcu EBBCan]
#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
canbus_uuid: <EBB uuid>
  1. Unfortunately, the example config file had a space after EBBCAN: <pin> in multiple locations, these spaces were removed.
  2. Since we were upgrading an existing printer, we transferred most of the [extruder] section settings as well and commented them out in klipper.cfg.

How useful was this post?

Click on a star to rate it!

No votes so far! Be the first to rate this post.

Nate15329's Blog