This repository contains things related to the Anycubic Kobra 2 Series 3D printer.
Note
REAL Custom firmware is not yet available, as far as we know. But you can use the tools in this repository to create your own "custom" firmware. Which is really just a modified stock firmware.
- Kobra2ProInsights: A collection of insights and findings about the Kobra 2 Pro and some other printers
- Kobra Unleashed: A custom frontend/GUI for the Kobra 2 Series via MQTT
Warning
For the python scripts to work, you will need to install pycryptodome
pip install pycryptodome
Caution
The K2 Pro firmware is NOT COMPATIBLE with the K2 Machine. These machines are completely different in firmware, so ensure you have the correct firmware for the correct machine.
To update the firmware via USB:
- Format a USB drive to FAT32 or exFAT.
- Create a folder called
update
on the USB drive. - Copy the
update.swu
file to theupdate
folder. - Plug the USB drive into the printer.
- The printer should detect it, and you can update the firmware via USB.
Important
- To update to version 3.0.5, you first need to update via 3.0.3.
- The firmwares are uploaded using git-lfs, so you may need to download git-lfs to work with large files such as these.
Note
Currently, the only way to get root access is through the serial console, available on the 4-pin header on the mainboard.
UART specifications: 5 Volt, 115200 baud rate.
Warning
If you can't see anything on the serial console, it's likely because you're running newer firmware. You need to downgrade to 2.3.9 first to get root access, as Anycubic disabled the serial console in newer firmware versions in the uboot
binary.
To establish root access:
- Hold down the
S
key while powering on the printer. - Enter these commands to change bootargs:
setenv init /bin/sh
saveenv
bootd
- Mount the overlay partition:
mount -t proc p /proc
. /lib/functions/preinit.sh
. /lib/preinit/80_mount_root
do_mount_root
. /etc/init.d/boot
link_by_name
. /lib/preinit/81_initramfs_config
do_initramfs_config
- Override the root password:
cp /etc/shadow /overlay/upper/etc/shadow
-
Replace the password hash. You can use unix4lyfe.org website to generate a password hash.
-
Reboot into U-Boot and change the bootargs back to normal:
setenv init /sbin/init
setenv bootdelay 3
saveenv
reset
Now you can login with the password you set.
Tip
Thanks to rol for providing these commands! 👏
For permanent SSH access:
wget http://bin.entware.net/armv7sf-k3.2/installer/generic.sh
chmod 755 generic.sh
./generic.sh
sed -i '$i\/opt/etc/init.d/rc.unslung start' /etc/rc.local
echo 'export PATH="$PATH:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"' >> /etc/profile
reboot
opkg update
opkg install dropbear
reboot
Tip
Thanks to Sineos for the firmware extraction commands! 👏
To extract update.swu:
cpio -idv < update.swu
To extract the rootfs:
unsquashfs rootfs
Check out: Anycubic Kobra 2 SWU Decryption Script 😊