Skip to content

asnajder/zero-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 

Repository files navigation

Mainline Sovol Zero (Klipper, Armbian Trixie)

Special thanks to: Teapot-Apple, matt73210, Atomique13, jedi 2^10, wildBill, Rappetor, and others of the discord coming together to share information!


Initial Setup

  1. Backup your config
  2. Download Armbian Imager, insert your 32GB EMMC (note that 8GB will NOT work), Select BTT (BIQU) Manufacturer, Select BigTreeTech CB1 Board, Select Minimal tab, then Armbian Trixie cli, then Erase and Flash
  3. On the eMMC, edit /boot/armbianEnv.txt, COPY your rootdev=UUID= (for example, save this line: rootdev=UUID=938afde5-6689-4a1a-a044-680f6247d523 NOTE that your UUID will be unique to you!) then replace everything else with:
verbosity=1
bootlogo=false
console=both
disp_mode=1920x1080p60
overlay_prefix=sun50i-h616
fdtfile=sun50i-h616-bigtreetech-cb1-emmc.dtb
rootdev=UUID=YOUR_COPIED_UUID_HERE
rootfstype=ext4
overlays=sun50i-h6-uart3 sun50i-h616-ws2812 sun50i-h616-spidev1_1
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

You can fix the partition size now if you have access to another linux host:
sudo fdisk /dev/<device> then e, 2, <enter>, w

If not, I believe it will do it on first boot.

Note: On Mac you’ll need a VM and to share the EMMC drive to it after flashing- you just need this VM to access the file system on your EMMC, so you can use UTM and pick an easy to setup / use Linux VM (Matt suggested: Debian 11 xfce or something easy)

  1. You can either use an Ethernet cable and then SSH in (if it asks, default user is root / password 1234), or connect a keyboard to the printer, and an HDMI from printer to a monitor, then follow the first login steps. Note that if you're going to be using wifi, DO NOT configure it here when it asks. Select N and just configure it later with armbian-config. My installs (on here and my SV08) just froze at this step.
    You can run sudo armbian-config and under network you can add your wifi.

  2. Mask networkd to avoid boot delays (Rappetor/Sovol-SV08-Mainline#229 (comment)):

systemctl disable systemd-networkd-wait-online.service
systemctl mask systemd-networkd-wait-online.service  
  1. Install Git:
    sudo apt install git python3-pip -y

  2. Clone and run KIAUH

git clone https://github.com/dw-0/kiauh.git
./kiauh/kiauh.sh

CREDIT FOR THIS SECTION:
ljg-dev (https://github.com/ljg-dev/sovol-sv08-mainline/tree/main)


Installing Stuff

  1. Via KIAUH, install Klipper, Moonraker, Mainsail, and Crowsnest

Reboot after Crowsnest

I also installed KIAUH main menu -> Advanced -> Extra Dependencies: -> [Input Shaper]

Note you will also need python3-serial (sudo apt install python3-serial) and to do ~/klippy-env/bin/pip install scipy (scipy is used for eddy we set up later)

  1. Install moonraker-timelapse:
cd ~/
git clone https://github.com/mainsail-crew/moonraker-timelapse.git
cd ~/moonraker-timelapse
make install

Add what it outputs at the end to your moonraker.conf

In Orca (or your preferred slicer) add TIMELAPSE_TAKE_FRAME to:

-> Printer settings
-> Machine G-Code
-> 'Before layer change G-code'

(I had some other stuff there, I removed it and just kept the above)

  1. Install Katapult:
    cd ~ && git clone https://github.com/Arksine/katapult

  2. If you haven't already, maybe a good idea to reboot here:
    sudo reboot now


Set up CAN

  1. It should be, but check that this service is "loaded active running"
    systemctl | grep systemd-networkd

If not, sudo systemctl enable systemd-networkd, then sudo systemctl start systemd-networkd, then sudo systemctl disable systemd-networkd-wait-online.service then check again that it is running

  1. Configure the txqueuelen for can0:
echo -e 'SUBSYSTEM=="net", ACTION=="change|add", KERNEL=="can*"  ATTR{tx_queue_len}="128"' | sudo tee /etc/udev/rules.d/10-can.rules > /dev/null

Check it with:
cat /etc/udev/rules.d/10-can.rules, should see:

SUBSYSTEM=="net", ACTION=="change|add", KERNEL=="can*"  ATTR{tx_queue_len}="128"
  1. Enable the can0 interface and set the speed:
echo -e "[Match]\nName=can*\n\n[CAN]\nBitRate=1M\n\n[Link]\nRequiredForOnline=no" | sudo tee /etc/systemd/network/25-can.network > /dev/null

Check it with:
cat /etc/systemd/network/25-can.network
Should see:

[Match]
Name=can*

[CAN]
BitRate=1M

[Link]
RequiredForOnline=no
  1. Reboot:
    sudo reboot now

  2. Next, upload your printer.cfg. You need to COMMENT out all mcu/extruder_mcu/mcu hot_mcu sections, then reboot (I recommend a hard power off, then power back on. Sometimes a soft reboot I was still not able to see the canbus IDs)

This is so we can see the canbus IDs to note and to flash.
Thanks to Teapot-Apple on the discord for this note.

Note the following:

  • sovol hardcodes the UUIDs for mainboard/toolhead/chamber heater
  • after flashing, the UUIDs WILL change
  1. sudo service klipper stop, then run python3 ~/katapult/scripts/flashtool.py -i can0 -q and SAVE THE OUTPUT.

This was my output (I have a chamber heater, so we see 3, if you don't have it, you'll see 2):

biqu@Zero:~$ python3 ~/katapult/scripts/flashtool.py -i can0 -q
Resetting all bootloader node IDs...
Checking for Katapult nodes...
Detected UUID: 0d1445047cdd, Application: Klipper
Detected UUID: 58a72bb93aa4, Application: Klipper
Detected UUID: 61755fe321ac, Application: Klipper
CANBus UUID Query Complete
biqu@Zero:~$

You should see your CANBUS devices here, if you don't, something above was done wrong, OR, you were like me, and had a hard time seeing them, take my info on how to see them above.


Multiple Ways to Flash Mainboard

Warning

There are two methods going forward to flash your mainboard.

Method One is using Sovol's 128KiB offset (which technically we are not sure how it works, since the chip only has 128KiB TOTAL

Method Two is using an ST-LINK (or possibly in the future, command line) to flash a 32KiB offset Katapult bootloader, then from command line, flashing Klipper

It is up to you to determine which method you think is right and what you want to do. I have personally tested both options and they both work.

Method One

Mainboard

make menuconfig reference:
STM32H750
128KiB bootloader offset
Clock Reference: 25 MHz crystal
USB to CAN bus bridge (USB on PA11/PA12)
CAN bus on PB8/PB9
GPIO pins to set at micro-controller startup: !PE11,!PB0
These are the aux and exhaust fans. If this isn't set, both of these will come on full blast at boot until Kalico takes control of the board

Credit for this info:
Vlad (vvuk)
https://github.com/vvuk/printer-configs/wiki/Kalico-on-the-Sovol-Zero

  1. Edit ~/klipper/src/stm32/Kconfig
    You will then scroll down until you see bootloader and then scroll down til you see "config STM32_FLASH_START_20000"
    you will then need to add MACH_STM32H750 to the end of the line under that as such:

From:
bool "128KiB bootloader" if MACH_STM32H743 || MACH_STM32H723 || MACH_STM32F7
To:
bool "128KiB bootloader" if MACH_STM32H743 || MACH_STM32H723 || MACH_STM32F7 || MACH_STM32H750

Note, this will make Kalico or Klipper repo Dirty.
Thanks to Teapot-Apple on the discord for this info.

  1. For the mainboard, reference the menuconfig settings above. Then,
    cd ~/klipper, make menuconfig, make clean, make
    It will save the firmware to ~/klipper/out/klipper.bin

  2. Flash your mainboard:
    sudo service klipper stop, then python3 ~/katapult/scripts/flashtool.py -i can0 -q, this lists all CANBUS IDs, in my case mainboard was 0d1445047cdd

Flash it:
python3 ~/katapult/scripts/flashtool.py -i can0 -f ~/klipper/out/klipper.bin -u 0d1445047cdd

Note the 1 CANBUS ID that changed here, that's your new mainboard ID:
python3 ~/katapult/scripts/flashtool.py -i can0 -q

Important

Now, skip to section Make Klipper Configs for Toolhead and Chamber Heater

Method Two

Mainboard

make menuconfig reference:
STM32H750
32KiB bootloader offset
Clock Reference: 25 MHz crystal
USB to CAN bus bridge (USB on PA11/PA12)
CAN bus on PB8/PB9
GPIO pins to set at micro-controller startup: !PE11,!PB0
These are the aux and exhaust fans. If this isn't set, both of these will come on full blast at boot until Kalico takes control of the board
  1. Edit ~/klipper/src/stm32/Kconfig
    You will then scroll down until you see bootloader and then scroll down til you see "config STM32_FLASH_START_8000"
    you will then need to add MACH_STM32H750 to the end of the line under that as such:

From:
bool "32KiB bootloader" if MACH_STM32F1 || MACH_STM32F2 || MACH_STM32F4 || MACH_STM32F7
To:
bool "32KiB bootloader" if MACH_STM32F1 || MACH_STM32F2 || MACH_STM32F4 || MACH_STM32F7 || MACH_STM32H750

Note, this will make Kalico or Klipper repo Dirty.
Thanks to wildBill on the discord for this info.

  1. For the mainboard, reference the menuconfig settings above. Then,
    cd ~/klipper, make menuconfig, make clean, make
    It will save the firmware to ~/klipper/out/klipper.bin

  2. Use STM32CubeProgrammer to flash the stm32h750_katapult.bin file to your mainboard (found here). Turn off your printer (unplug it too, just in case), hook your st-link up to the boards pins, other end to your computer, full chip erase, open file -> use stm32h750_katapult.bin, "Download" will write the file

  3. Upon boot, you can verify with ls /dev/serial/by-id, should see something like usb-katapult_stm32h750xx_1C0027000651333233353131-if00

  4. Stop Klipper sudo service klipper stop, then flash:

python3 ~/katapult/scripts/flashtool.py -f ~/klipper/out/klipper.bin -d /dev/serial/by-id/usb-katapult_your_board_id
so for me it was:
python3 ~/katapult/scripts/flashtool.py -f ~/klipper/out/klipper.bin -d /dev/serial/by-id/usb-katapult_stm32h750xx_1C0027000651333233353131-if00
  1. Verify with: lsusb Should see: Bus 008 Device 003: ID 1d50:606f OpenMoko, Inc. Geschwister Schneider CAN adapter

  2. Verify can0 is up, run ip -s -d link show can0, it should show 5: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 128

  3. To get your ID for printer.cfg, run: python3 ~/katapult/scripts/flashtool.py -i can0 -q and note the new ID.

Important

Carry on to Make Klipper Configs for Toolhead and Chamber Heater

Make Klipper Configs for Toolhead and Chamber Heater

This is the info to reference when you do make menuconfig below.

Toolhead

make menuconfig reference:
STM32F103
8KiB bootloader offset
Clock Reference: 8 MHz crystal
CAN bus on PB8/PB9

Chamber Heater

make menuconfig reference:
STM32F103
8KiB bootloader offset
Clock Reference: 8 MHz crystal
CAN bus on PB8/PB9

Credit for this info:
Vlad (vvuk)
https://github.com/vvuk/printer-configs/wiki/Kalico-on-the-Sovol-Zero

Now, remake the firmware, but for your toolhead/chamber heater (they both use the same config, but it is DIFFERENT than the mainboard)
Repeat steps to flash for toolhead and then for chamber (REMEMBER TO CHANGE UUID IN THE COMMAND!), noting what UUID changes each time using the query command above.

  1. Reference the menuconfig settings above for toolhead and chamber heater.
    cd ~/klipper, make menuconfig, make clean, make
    It will save the firmware to ~/klipper/out/klipper.bin

  2. Flash your mainboard:
    sudo service klipper stop, then python3 ~/katapult/scripts/flashtool.py -i can0 -q, this lists all CANBUS IDs, in my case toolhead was 61755fe321ac

Flash it:
python3 ~/katapult/scripts/flashtool.py -i can0 -f ~/klipper/out/klipper.bin -u 61755fe321ac

Note the 1 CANBUS ID that changed here, that's the ID of the device you just flashed:
python3 ~/katapult/scripts/flashtool.py -i can0 -q

If you mess up and forget to check, you can turn the printer off, unplug the toolhead CAN connection, boot it back up, run the query, and the new ID is your chamber heater.
Power down, plug toolhead CAN connection back in, query again, and that new ID is your toolhead.

  1. Once you have everything flashed, start klipper back up: sudo service klipper start

Credit for this section:
Esoterical
https://canbus.esoterical.online/Getting_Started.html
https://canbus.esoterical.online/toolhead_flashing.html


If something goes wrong

I have the files uploaded here, each file can be flashed using st-link, which gets you back to Sovol firmware. Reference Rappetor's guide Step 6/Step 7 to get you through it.


Finishing Up

  1. You can use my config (uploaded here), or go through and edit yours. Note that when you start, IF using the original Sovol config, you'll need to play "remove config whack-a-mole" to remove things we cannot use anymore. That consists of removing a section klipper errors out about, then going back and removing the next thing. Do this til no errors.

  2. Change all canbus_uuid in your configs to your new ones. Save and restart. Everything should connect.

  3. Add your webcam back, I had to edit crowsnest.conf and change device to /dev/v4l/by-id/usb-HHW_microelectronics_Co.__Ltd._MGS1-video-index0, save, then add the webcam in mainsail.

  4. You can remove [virtual_sdcard] location, since there is one in mainsail.cfg

  5. If you use my macros.cfg, the START_PRINT and END_PRINT (credit https://github.com/jontek2/A-better-print_start-macro/blob/main/README.md) requires you to update Orca's START_PRINT and END_PRINT in your:

-> Printer settings
-> Machine G-Code
-> 'Machine Start G-code'
M104 S0 ; Stops OrcaSlicer from sending temp waits separately
M140 S0
START_PRINT EXTRUDER=[first_layer_temperature] BED=[first_layer_bed_temperature] CHAMBER=[chamber_temperature] MATERIAL=[filament_type]

Just remove everything else there

-> 'Machine End G-code'
END_PRINT

  1. Calibrate eddy:
    Reference my SV08 guide here, but NOTE that there are some significant changes:
    https://github.com/asnajder/sv08-config/blob/main/README.md

-No need to edit ldc1612.py, it seems to work fine with div=2

-You can remove reg_drive_current: 22 from [probe_eddy_current my_eddy_probe], we will auto calibrate

Additional short form steps:

# home the printer, it will fail on Z, that's ok
SET_KINEMATIC_POSITION X=96 Y=76.2 Z=2
# baby step it (manually move it to around z=2 if you can)
LDC_CALIBRATE_DRIVE_CURRENT CHIP=my_eddy_probe
# save_config after it finds the current, mine was set to 16
# after reboot:
SET_KINEMATIC_POSITION X=96 Y=76.2 Z=2
PROBE_EDDY_CURRENT_CALIBRATE CHIP=my_eddy_probe
# do paper test, etc

Just note that setting the kinematic position you will want to do within bounds of the Zero bed size, and of course in "How to use it", we don't QGL, etc

NOTE: I had an error when calibrating my eddy:
I2C request to addr 42 reports error START_NACK

I did this change:
sudo nano /etc/systemd/system/klipper.service
and then add Nice=-10 to the bottom of what is already there
and restarted, and it fixed it

  1. PID tune, SHAPER_CALIBRATE, etc

  2. Print!

About

Repo for my mainlined Sovol Zero config

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors