Skip to content

Commit

Permalink
handle k1 variants
Browse files Browse the repository at this point in the history
  • Loading branch information
ballaswag committed Jun 21, 2024
1 parent 7676f02 commit 4ac6abd
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 41 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The mod is adapted for the K1 from the great work done by the [Flashforge Mod Pr
## Feature Overview

- [Klipper](https://www.klipper3d.org/) (Currently on the BTT Eddy branch) ‒ with improved configuration and default macros
- [Klipper](https://www.klipper3d.org/) ‒ with improved configuration and default macros
- [Moonraker](https://github.com/Arksine/moonraker) on port 7125
- [Mainsail](https://docs.mainsail.xyz/) on port 4000
- [Fluidd](https://docs.fluidd.xyz/) on port 4001
Expand All @@ -33,18 +33,17 @@ The mod is adapted for the K1 from the great work done by the [Flashforge Mod Pr
## Guppy Mod vs K1 Stock
| Guppy Mod | Stock |
|-----------|-------|
| Mainline Klipper * | Creality Klipper |
| Mainline Klipper | Creality Klipper |
| Buildroot 2024 | Buildroot 2020 |
| Python 3.11.8 | Python 3.8.2 |
| ustreamer | mjpeg-streamer |
| Guppy Screen | Creality display-server |
| Open source | Source?
| No bloatware | Creality services |
| More performant ** | ?? |
| More performant * | ?? |


\* Guppy Mod is using the mainline + a PR for rapid bed mesh scan. Will switch to mainline once rapid bed mesh scan is merged.
\** Python 3.11.8 is *FASTER* than 3.8.2 (Faster Klipper/Moonraker). Since Guppy Mod also do not install any bloated software, it uses significantly less memory by default. On a fresh boot, Guppy Mod shows 36% used System memory in fluidd compared to 46% used by stock.
\* Python 3.11.8 is *FASTER* than 3.8.2 (Faster Klipper/Moonraker). Since Guppy Mod also do not install any bloated software, it uses significantly less memory by default. On a fresh boot, Guppy Mod shows 36% used System memory in fluidd compared to 46% used by stock.

## Roadmap

Expand Down
2 changes: 0 additions & 2 deletions build_scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,8 @@ package_variant() {
rm -f "$br_chroot"
xz -cT`nproc` "$br_image" > "$br_chroot"
package_name="K1-KlipperMod-$GIT_VERSION-$variant.tgz"
package_name_pro="K1Max-KlipperMod-$GIT_VERSION-$variant.tgz"
mkdir -p $BUILD_PACKAGE
tar -cf "$BUILD_PACKAGE/$package_name" -C "$GIT_ROOT/device_files/install" . -C "$br_builddir/images/" ./chroot.tar.xz
cp "$BUILD_PACKAGE/$package_name" "$BUILD_PACKAGE/$package_name_pro"
log_info "variant-$variant: created $package_name"
}

Expand Down
69 changes: 36 additions & 33 deletions device_files/install/k1mod_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,41 +77,44 @@ do_setup()
##############################
# which k1 are you?
##############################

PRINTER_CONF_DIR="${CHROOT_DIR}//root/printer_data/config"
machine_info=$(tr -d '\0' </dev/mmcblk0p2)
if [[ $machine_info == *"CR-K1;CR4CU220812S12;;;;;"* ]]; then
echo "Identified machine as K1. Configuring printer.cfg for a K1."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
rm $PRINTER_CONF_DIR/printer_k1c.cfg $PRINTER_CONF_DIR/printer_variant1.cfg

elif [[ $machine_info == *"CR-K1;CR4CU220812S12;;;1;;"* ]]; then
echo "Identified machine as K1 New Variant. Configuring printer.cfg for a K1 New Variant."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_variant1.cfg $PRINTER_CONF_DIR/printer.cfg
rm $PRINTER_CONF_DIR/printer_k1c.cfg

elif [[ $machine_info == *"CR-K1 Max;CR4CU220812S12;;;;;"* ]]; then
echo "Identified machine as K1 Max. Configuring printer.cfg for a K1 Max."
cp $PRINTER_CONF_DIR/k1max/*.cfg $PRINTER_CONF_DIR/
rm $PRINTER_CONF_DIR/printer_variant1.cfg

elif [[ $machine_info == *"CR-K1 Max;CR4CU220812S12;;;1;;"* ]]; then
echo "Identified machine as K1 Max New Variant. Configuring printer.cfg for a K1 Max New Variant."
cp $PRINTER_CONF_DIR/k1max/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_variant1.cfg $PRINTER_CONF_DIR/printer.cfg

elif [[ $machine_info == *"K1C;CR4CU220812S12;;;;;"* ]]; then
echo "Identified machine as K1C. Configuring printer.cfg for a K1C."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_k1c.cfg $PRINTER_CONF_DIR/printer.cfg
rm $PRINTER_CONF_DIR/printer_variant1.cfg

else
echo "Failed to idenity K1 model. Exiting.."
exit 1
fi

case "$machine_info" in
*"CR-K1;CR4CU220812S12;;;;;"*)
echo "Identified machine as K1. Configuring printer.cfg for a K1."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
rm $PRINTER_CONF_DIR/printer_k1c.cfg $PRINTER_CONF_DIR/printer_variant1.cfg
;;

*"CR-K1;CR4CU220812S12;;;1;;"*)
echo "Identified machine as K1 New Variant. Configuring printer.cfg for a K1 New Variant."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_variant1.cfg $PRINTER_CONF_DIR/printer.cfg
rm $PRINTER_CONF_DIR/printer_k1c.cfg
;;

*"CR-K1 Max;CR4CU220812S12;;;;;"*)
echo "Identified machine as K1 Max. Configuring printer.cfg for a K1 Max."
cp $PRINTER_CONF_DIR/k1max/*.cfg $PRINTER_CONF_DIR/
rm $PRINTER_CONF_DIR/printer_variant1.cfg
;;
*"CR-K1 Max;CR4CU220812S12;;;1;;"*)
echo "Identified machine as K1 Max New Variant. Configuring printer.cfg for a K1 Max New Variant."
cp $PRINTER_CONF_DIR/k1max/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_variant1.cfg $PRINTER_CONF_DIR/printer.cfg
;;

*"K1C;CR4CU220812S12;;;;;"*)
echo "Identified machine as K1C. Configuring printer.cfg for a K1C."
cp $PRINTER_CONF_DIR/k1/*.cfg $PRINTER_CONF_DIR/
mv $PRINTER_CONF_DIR/printer_k1c.cfg $PRINTER_CONF_DIR/printer.cfg
rm $PRINTER_CONF_DIR/printer_variant1.cfg
;;

*)
echo "Failed to idenity K1 model. Exiting.."
exit 1
esac

# do intial setup
$CHROOT_DIR/etc/init/S00klipper_mod setup
Expand Down

0 comments on commit 4ac6abd

Please sign in to comment.