Hi guys, today I’m going to take you through the process of setting up the BTT Manta M8P and CB1 board. The Manta is a hybrid board with mounting point available for a Raspberry Pi compute module or BTTs own CB1 drop in replacement. It’s a HV compatible board that is a cost effective option for your VCore3! Be warned though installing RatOS from scratch requires you to be comfortable in the command line.
The Manta boards are fairly well documented in terms of a controller board from a Chinese manufacturer. However there is not currently official RatOS support because of the work load required to support port it over to the standard the RatOS team wish to maintain. Blacksmithforlife wrote a really handy guide for doing the same thing on the OrangePi and it is the basis for this tutorial.
In the box
The Manta comes with the following items in the box
- BTT Manta M8P and CB1 board
- JST connectors for every port on the board
- Jumpers for the motor drivers and voltage selection
- Fuses for the power inputs and bed output (pre-installed)
- 8 x TMC2209 stepper drivers (if you ordered them)
- External WiFi antenna
- Thankyou card
- Rubber ducky!
The board looks fantastic and for an 8 driver board with combined SBC it is surprisingly compact (Don’t get me wrong it is still a big board but not as big as expected). The silkscreen is two colour and someone has put the effort into some nice graphics dotted around the board. Soldering looks very neat and I can’t see any poorly installed parts (On this board – the first one I was sent the USB C connector fell off…).
The CB1 board looks very similar to a CM4 module but features an external WiFi antenna.
Preparing the board
Add a jumper onto vusb to connect the USB connector power to the boards. We will use this to provide power while we install the OS and flash the firmware before wiring the board in. DO NOT LEAVE THIS JUMPER IN PLACE AND CONNECT USB + VIN AS YOU WILL BLOW THE USB CHIP.
We will be using the CB1 board with RatOS installed manually over the top of a vanilla Klipper installation.
CB1 OS + Klipper install
Use micro SD card smaller than 32Gb. Download the image from BTT github pick the latest minimal version and download the .img.xz file. V2.2 at the time of writing which should have fixed WiFi connections on the CB1.
Use raspberry imager to write the image to the SD card.
Now to configure the WiFi. The official guide says that in one of the partitions on the SD card you should be able to find the wpa_supplicant file however on my installation I didn’t get that. The video guide shows using the system configuration file and that was present so I used that. Open it in notepad.
Replace the SSID and password with that of the WiFi network you want the device to join. Save the file.
Plug the SD card into the micro SD card slot. Then plug in a USB C cable to power the board (If you don’t see a green light appear on the CB1 then it is not receiving power – In my case I had not pressed the CB1 board into it’s connectors firmly enough). I use Advanced IP Scanner to locate devices on my network. I find you are best to do a scan before you turn the device on and then repeat it and see which one appears. They often don’t have a useful name!
For me this was 192.168.68.119. Use PuTTY to SSH into the device. This will open a terminal. Trust the SSH key for the first time.
Login with username biqu and password also biqu
To make the scripts for RatOS work later we need to create a new user pi. Fill out your password and the other user data (You can leave them blank like I have).
sudo adduser pi
Add the user to the sudo group and then check that it worked.
sudo usermod -aG sudo pi getent group sudo
Swap to the pi user. You will get visual confirmation as the username at the start of the command line will show pi@BTT-CB1 now.
su - pi
Update the system and make sure git is installed
sudo apt-get update -y sudo apt-get install git -y
git clone https://github.com/th33xitus/kiauh.git
Run the Kiauh script to and enter 1 to go to the install menu. We need to install Klipper, Moonraker and Mainsail.
Install Klipper using option 1. Choose python 2 and a single instance of Klipper when prompted. Also say yes to adding the user to the groups tty and dialout.
Install Moonraker using option 2. There shouldn’t be any options to choose for this one.
Install Mainsail using option 3. Choose Yes (Y) when prompted for all the options.
Lastly install KlipperScreen using option 5.
Now it’s time to step outside the standard Klipper install and begin getting RatOS installed. Press B and go back to the main Kiauh menu. Choose option 4 to enter the advanced menu.
Enter option 8 and acknowledge the warning.
Enter Y to create an example command.
Run the following set of commands. This will update your moonraker.conf file. You can copy the whole set of commands at once and paste them. They will run consecutively as if you entered them a line at a time.
mkdir /home/pi/klipper_config/config echo 1.2.3-armbian | sudo tee /etc/ratos_version echo "[update_manager RatOS]" >> /home/pi/klipper_config/config/moonraker.conf echo "type: git_repo" >> /home/pi/klipper_config/config/moonraker.conf echo "path: /home/pi/klipper_config/config" >> /home/pi/klipper_config/config/moonraker.conf echo "origin: https://github.com/Rat-OS/RatOS-configuration.git" >> /home/pi/klipper_config/config/moonraker.conf echo "" >> /home/pi/klipper_config/config/moonraker.conf echo "[update_manager RatOS-configurator]" >> /home/pi/klipper_config/config/moonraker.conf echo "type: git_repo" >> /home/pi/klipper_config/config/moonraker.conf echo "path: /home/pi/ratos-configurator" >> /home/pi/klipper_config/config/moonraker.conf echo "origin: https://github.com/Rat-OS/RatOS-configurator.git" >> /home/pi/klipper_config/config/moonraker.conf echo "primary_branch: deployment" >> /home/pi/klipper_config/config/moonraker.conf echo "" >> /home/pi/klipper_config/config/moonraker.conf echo "[update_manager RatOS-theme]" >> /home/pi/klipper_config/config/moonraker.conf echo "type: git_repo" >> /home/pi/klipper_config/config/moonraker.conf echo "path: /home/pi/klipper_config/.theme" >> /home/pi/klipper_config/config/moonraker.conf echo "origin: https://github.com/Rat-OS/RatOS-theme.git" >> /home/pi/klipper_config/config/moonraker.conf
Next we need to install node. Again paste this entire set of commands in one go and run them.
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt update sudo apt install nodejs yarn -y
Clone the RatOS repositories
cd /home/pi/klipper_config git clone https://github.com/Rat-OS/RatOS-configuration.git config sed -i 's/.*raspberry_pi.*/[temperature_sensor orange_pi]/' /home/pi/klipper_config/config/printers/base.cfg git clone https://github.com/Rat-OS/RatOS-theme.git .theme cd /home/pi git clone https://github.com/Rat-OS/RatOS-configurator.git ratos-configurator cd ratos-configurator/ git checkout deployment
Next run the install script
next run the configurator script. If successful you should see an output like the one below.
Change write permissions on the following files
sudo chmod 775 /tmp/031-ratos-configurator-wifi sudo chmod 775 /tmp/031-ratos-configurator-scripts sudo chmod 775 /tmp/030-ratos-configurator-githooks sudo chmod 775 /tmp/030-ratos-configurator-scripts
Next configure the RatOS service
cd ~ sudo touch /var/log/vcore.log wget https://raw.githubusercontent.com/Rat-OS/RatOS/master/src/modules/ratos/filesystem/root/etc/init.d/ratos sudo mv ratos /etc/init.d/ratos sudo chmod +x /etc/init.d/ratos sudo chown root:root /etc/init.d/ratos sudo update-rc.d ratos defaults sudo service ratos start
Configure the CB1 as MCU
cd /home/pi/klipper cp -f /home/pi/klipper_config/config/boards/rpi/firmware.config /home/pi/klipper/.config sudo make olddefconfig sudo make clean sudo make flash sudo cp ./scripts/klipper-mcu-start.sh /etc/init.d/klipper_mcu sudo update-rc.d klipper_mcu defaults sudo chown pi:pi -R /home/pi/klipper sudo service klipper_mcu start
Now enter the IP address in your browser and you should be greeted with the RatOS UI!
Flashing the MCU firmware
SSH back into the device if you exited it (Use user ‘biqu’ and password ‘biqu’) otherwise swap to the user by doing ‘su biqu’
Navigate to the klipper directory and open the klipper menu.
cd ~/klipper/ make menuconfig
Change the settings to match the image below. Press q to exit and save when prompted.
Run make to compile firmware，”klipper.bin” file will be generated in
home/pi/kliiper/out folder when make is finished.
You now just need to get this file, rename it to firmware.bin and load it onto the sd card. My preferred way of doing this is to use WinSCP to copy the file to my pc and then manually move it over onto the sd card. Create a new session in WinSCP and select the SCP file protocol. Enter the IP address and user info. Leave the port as the default 22.
If successful you will get a visual display of the file system on the CB1. Go into the klipper file and the out file and copy the klipper.bin file onto your pc. From there copy it to the second sd card as you would normally.
Remove power from the Manta board and Insert SD card into the MCU-SD slot. Plug the USB C cable back in to turn the board back on.
Head over to the BTT github and copy the contents of the config file into your printer.cfg.
We now need to get the board ID. Enter the command below and then copy the output and replace the one in the printer.cfg file.
Now restart the board and go back to the ip address and take a look inside mainsail. You should now see that your have communication with the MCU and if like me you like to set all the firmware up in advance you will get an error telling you the MCU has shutdown because an ADC is out of range. This is expected because you haven’t connected the thermistors yet! Congratulations you have reached the finish line. Now it’s time to go away and follow the wiring guide for your specific printer!
My Klipper and Klipper screen were ‘dirty’ after completing the install using the image provided by BTT. I am not 100% of the changes they had made and the effects of hard resetting these just yet but clearing them didn’t seem to break the basic printer functionality.
To update Klipper in the future you will need to use the hard reset on both and this will then enable you to receive Klipper updates.
Support 3DP and ME! Help us keep producing tutorials, content and mods!