This repository contains a Yocto Project-based firmware build system for the Elegoo Centauri Carbon 3D printer family. The mainboard of these printers is powered by an Allwinner R528 SoC.
Unsure about what COSMOS is? Check the FAQ to learn more
Before starting the build process, you need to install the required dependencies on your host system (Ubuntu/Debian is assumed):
sudo apt update
sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential \
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool file locales \
bmap-tools sunxi-toolsThe build supports different machine configurations for the Centauri Carbon variants:
| Machine | Description |
|---|---|
centauri-carbon-1 |
Centauri Carbon 1 (default) |
centauri-carbon-2 |
Centauri Carbon 2 (including C2, C2C, CC2C) |
The default in build/conf/local.conf is set to CC1:
MACHINE ?= "centauri-carbon-1"To build for CC2, specify the machine on the command line:
MACHINE=centauri-carbon-2 bitbake cosmos-image-usbChoose the appropriate image type based on your target boot media:
| Image Recipe | Target Media | Use Case |
|---|---|---|
cosmos-image-usb |
USB drive | Development, testing, or running from USB |
cosmos-image-mmc |
Internal eMMC | Production installation on printer internal storage |
- Boots from USB drive
- Read-write root filesystem
- Suitable for development and testing
- Larger partition layout for USB storage
- Installs to internal eMMC storage
- Read-only SquashFS root with overlay filesystem for
/etcon/datapartition - Optimized for production use
- Includes A/B boot partition scheme for safe updates via swupdate
-
Initialize the build environment: Source the environment setup script provided by Openembedded Core to prepare your shell for BitBake.
TEMPLATECONF="$PWD/meta-opencentauri/conf/templates/opencentauri" source openembedded-core/oe-init-build-env build
-
Configure your target (if needed): Ensure
MACHINEis set correctly inbuild/conf/local.conf:# For CC1 or CC2 MACHINE ?= "centauri-carbon-1"
-
Run BitBake: Choose the appropriate image recipe for your target:
For USB booting:
bitbake cosmos-image-usb
For eMMC/internal storage:
bitbake cosmos-image-mmc
Note: The first build will take a significant amount of time as it downloads and compiles all necessary packages from source.
After a successful build, the output files are located in:
tmp/deploy/images/centauri-carbon-1/
cosmos-image-usb-centauri-carbon-1.wic.gz- Compressed disk image for USB drives
cosmos-image-mmc-centauri-carbon-1.wic.gz- Full disk image for eMMCbootA.img- Extracted boot partition image (for swupdate)bootlogos.img- Extracted boot logos partition image (for swupdate)cosmos-image-mmc-centauri-carbon-1.squashfs- SquashFS root filesystem
Building a complete Yocto image requires a substantial amount of disk space. Based on current build sizes, you should expect the project directory (including downloaded sources, build artifacts, and caches) to use approximately 38GB to 40GB of disk space. Please ensure you have adequate free space before starting the build.
Note that the current install requires having a serial UART connected to the CC1 motherboard, as well as a FEL USB cable attached. This will prevent the toolhead from being plugged in!
-
Install built firmware image to a USB drive. (Warning: This is a destructive operation! Replace
sdXwith your actual USB drive device likesdb,sdc, etc.)sudo bmaptool copy tmp/deploy/images/centauri-carbon-1/cosmos-image-usb-centauri-carbon-1.wic.gz /dev/sdX
-
Boot into FEL Mode. Connect via serial UART. Power on the printer and boot into the Elegoo u-boot, pressing any key to abort the normal boot process. Issue the following command to boot to FEL mode:
efex -
Boot the new Yocto firmware image via USB from FEL mode. Run the following commands on your host machine to load the mainline u-boot:
sunxi-fel uboot tmp/deploy/images/centauri-carbon-1/u-boot-sunxi-with-spl.bin
The mainline u-boot followed by the mainline Linux kernel should now boot! This will start up Klipper, Moonraker, Mainsail daemons, and a dropbear SSH server.
Important: You need to unplug the FEL USB as it will conflict with the mainboard's ability to talk to the toolhead.
-
Connect and Configure WiFi. Login as the
rootuser via the serial UART console.Configure your WiFi SSID and password:
wpa_passphrase "SSID" "password" > /etc/wpa_supplicant.conf
Then restart the WiFi adapter:
ifdown wlan0 && sleep 5 && ifup wlan0
-
Access the Printer Interface. Find the printer's IP address by running
ip a. Access the Mainsail interface by visiting the printer's IP address via HTTP (port 80) in your web browser!
For installing to internal eMMC storage, use the swupdate-based installation:
- Build the
cosmostarget. This recipe depends oncosmos-image-mmcand produces the SWUpdate bundle:bitbake cosmos
- Locate the generated
.swufile intmp/deploy/images/centauri-carbon-1/(e.g.cosmos-centauri-carbon-1.swu). - Copy the
.swufile to a FAT32-formatted USB drive in theinstall_opencentaurifolder, renaming it toupdate.swu. - Insert the USB drive into the printer
- Import the
IMPORT_ME_DO_NOT_PRINTfile via the printer screen as you would for stock OpenCentauri
For installing to internal eMMC storage, use the signed archive installation:
- Build the
cosmostarget. This recipe depends oncosmos-image-mmcand produces the .zip.sig bundle:bitbake cosmos
- Locate the generated
.zip.sigfile intmp/deploy/images/centauri-carbon-2/(e.g.cc2_eeb001_26.09.00.00.zip.sig). - Copy the
.zip.sigfile to the root of a FAT32-formatted USB drive. - Insert the USB drive into the printer
- Import the offline update via the printer screen
- Klipper Configuration: In the current build, the Klipper
printer.cfgis located in/etc/klipper/config/printer.cfg. - Services: Everything is running as an
init.dservice. You can restart Klipper by running:service klipper restart
If you encounter build issues, try cleaning the specific package:
bitbake -c cleansstate <package-name>
bitbake <image-target>For a complete clean build (removes all build artifacts):
rm -rf tmp/
source openembedded-core/oe-init-build-env build
bitbake <image-target>