Skip to content

Commit

Permalink
publish KIAUH v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dw-0 committed Jan 31, 2021
2 parents 18e8523 + 431f58a commit 16e6dde
Show file tree
Hide file tree
Showing 35 changed files with 2,633 additions and 2,159 deletions.
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,23 @@

This script acts as a helping hand for you to get set up in a fast and comfortable way.\
**This does not mean, it will relieve you of using your brain.exe! 🧠**\
Please also always pay attention to the individual component repositories (all linked below).\
Feel free to give it a try. If you have suggestions or encounter any problems, please report them.

---

## **🛠️ Instructions:**

For downloading this script it is best to have git already installed.\
For downloading this script it is necessary to have git installed.\
If you haven't, please run `sudo apt-get install git -y` to install git first.\
You will need it anyways!
You will need it anyways! 😄

After git is installed, use the following commands in the given order to download and execute the script:

```shell
cd ~
git clone https://github.com/th33xitus/kiauh.git
cd kiauh
chmod +x kiauh.sh scripts/*
./kiauh.sh
./kiauh/kiauh.sh
```

## Additional Instructions:
Expand All @@ -43,11 +42,14 @@ Feel free to check out his work.

## **🧰 Functions and Features:**

- **New in v3.0** You can now install multiple instances (Klipper/Moonraker/DWC/Octoprint) on the same Pi!
---
### **Core Functions:**

- **Installing** of the Klipper Firmware to your Raspberry Pi or other Linux Distribution which makes use of init.d.
- **Installing** of several different web interfaces such as Duet Web Control, Mainsail, Fluidd or OctoPrint including their dependencies.
- **Installing** of the Moonraker API
- **Installing** Klipper to your Raspberry Pi or other Debian based Linux Distribution.
- **Installing** of the Moonraker API (needed for Mainsail, Fluidd and KlipperScreen)
- **Installing** several different web interfaces such as Mainsail, Fluidd, Duet Web Control or OctoPrint including their dependencies.
- **Installing** of KlipperScreen (OctoScreen but for Klipper!)
- **Updating** of all the listed installations above excluding OctoPrint. For updating OctoPrint, please use the OctoPrint interface!
- **Removing** of all the listed installations above.
- **Backup** of all the listed installations above.
Expand All @@ -56,8 +58,7 @@ Feel free to check out his work.

- Build the Klipper Firmware
- Flash the MCU
- Read ID of the currently connected printer (only one at the time)
- Write necessary entries to your printer.cfg, some of them customizable right in the CLI.
- Read ID of the currently connected MCU
- and more ...

### **For a list of additional features please see: [Feature List](docs/features.md)**
Expand All @@ -67,13 +68,18 @@ Feel free to check out his work.
## **📝 Notes:**

- Tested **only** on Raspberry Pi OS Lite (Debian Buster)
- ( Although similar Debian based distributions might also work... )
- During the use of this script you might be asked for your sudo password. There are several functions involved which need sudo privileges.

---

## **🛈 Sources & Further Information**

For more information or instructions, please check out the appropriate repositories listed below:
If you need some more detailed instructions on how to install Klipper and Mainsail with KIAUH, check out this website:\
[Installing Klipper and Mainsail](https://3dp.tumbleweedlabs.com/firmware/klipper-firmware/installing-klipper-and-mainsail-on-your-raspberry-pi)\
Credits for these instructions go to [@tumbleweedlabs](https://github.com/tumbleweedlabs).

For more information or instructions to the various components KIAUH can install, please check out the corresponding repositories listed below:

---

Expand Down Expand Up @@ -135,6 +141,6 @@ https://github.com/OctoPrint/OctoPrint

## **❓ FAQ**

**_Q: Can i use this script to install multiple instancec of Klipper on the same Pi? (Multisession?)_**
**_Q: Can i use this script to install multiple instances of Klipper on the same Pi? (Multisession?)_**

**A:** No, and at the moment i don't plan to implement this function. For multisession installations take a look at this script manu7irl created: https://github.com/manu7irl/klipper-DWC2-installer . Keep in mind that klipper-DWC2-installer and KIAUH are **NOT** compatible with each other.
**A:** Yes, it is finally possible 🙂
54 changes: 54 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,60 @@

This document covers possible important changes to KIAUH.

### 2021-01-31

* **This is a big one... KIAUH v3.0 is out.**\
With this update you can now install multiple instances of Klipper, Moonraker, Duet Web Control or Octoprint on the same Pi. This was quite a big rework of the whole script. So bugs can appear but with the help of some testers, i think there shouldn't be any critical ones anymore. In this regards thanks to @lixxbox and @zellneralex for testing.

* Important changes to how installations are set up now: All components get installed as systemd services. Installation via init.d was dropped completely! This shouldn't affect you at all, since the common linux distributions like RaspberryPi OS or custom distributions like MainsailOS, FluiddPi or OctoPi support both ways of installing services. I just wanted to mention it here.

* Now with KIAUH v3.0 and multi-instance installation capabilities, there are some things to point out. You will now need to tell KIAUH where your printers configurations are located when installing Klipper for the first time. Even though it is not recommended, you can change this location with the help of KIAUH and rewrite Klipper and Moonraker to use the new location.

* When setting up a multi-instance system, the folder structure will only change slightly. The goal was to keep it as compatible as possible with the custom distributions like mainsailOS and FluiddPi. This should help converting a single-instance setup of mainsailOS/FluiddPi to a multi-instance setup in no time, but keeping single-instance backwards compatibility if needed at a later point in time.

* The folder structure is as follows when setting up multi-instances:\
Each printer instance will get its own folder within your configuration location. The decision to this specific structure was made to make it as painless and easy as possible to convert to a multi-instance setup.
Here is an example:
```shell
/home/<username>
└── klipper_config
├── printer_1
│ ├── printer.cfg
│ └── moonraker.conf
├── printer_2
│ ├── printer.cfg
│ └── moonraker.conf
└── printer_n
├── printer.cfg
└── moonraker.conf
```
* Also when setting up multi-instances of each service, the name of each service slightly changes.
Each service gets its corresponding instance added to the service filename.

**This only applies to multi-instances! Single instance installations with KIAUH will keep their original names!**

Corresponding to the filetree example from above that would mean:
```
Klipper services:
--> klipper-1.service
--> klipper-2.service
--> klipper-n.service

Moonraker services:
--> moonraker-1.service
--> moonraker-2.service
--> moonraker-n.service
```
* The same service file rules from above apply to DWC and OctoPrint even though only Klipper and Moonraker are shown in this example.

* You can start, stop and restart all Klipper, Moonraker, DWC and OctoPrint instances from the KIAUH main menu. For doing this, just type "stop klipper", "start moonraker", "restart octoprint" and so on.

* KIAUH v3.0 relocated its ini-file. It is now a hidden file in the users home-directory calles `.kiauh.ini`. This has the benefit of keeping all values in that file between possible re-installations of KIAUH. Otherwise that file would be lost.

* The option of adding more trusted clients to the moonraker.conf file was dropped. Since you can edit this file right inside of Mainsail or Fluidd, only some basic entries are made which get you running.

* I bet i have missed mentioning other stuff as well because it took me quite some time to re-write many functions. So i just hope you like the new version 😄

### 2020-11-28

* KIAUH now supports the installation, update and removal of [KlipperScreen](https://github.com/jordanruthe/KlipperScreen). This feature was was provided by [jordanruthe](https://github.com/jordanruthe)! Thank you!
Expand Down
5 changes: 0 additions & 5 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ That means:
- set the behavior to "Cancel any ongoing prints but stay connected to the printer"
- **Enable/Disable OctoPrint Service:**\
Usefull when using DWC2/Mainsail/Fluidd and OctoPrint at the same time to prevent them interfering with each other
- **Set up reverse proxy for DWC2, Mainsail, Fluidd and OctoPrint and changing the hostname:**
- The script can install and configure Nginx for the selected webinterface
- It also allows you to make your webinterface reachable over an URL like `<hostname>.local` via avahi
- Example: If you name the host "my-printer", type `my-printer.local` in your webbrowser to open the installed webinterface
- If there is more than one webinterface installed, you have to append the port to that adress

- **Installing a G-Code Shell Command extension:**\
For further information about that extension please see the [G-Code Shell Command Extension Doc](gcode_shell_command.md)
Expand Down
18 changes: 5 additions & 13 deletions kiauh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,29 @@ for script in "${SRCDIR}/kiauh/scripts/ui/"*.sh; do . $script; done
### set important directories
#klipper
KLIPPER_DIR=${HOME}/klipper
KLIPPY_ENV_DIR=${HOME}/klippy-env
KLIPPER_SERVICE1=/etc/init.d/klipper
KLIPPER_SERVICE2=/etc/default/klipper
KLIPPER_SERVICE3=/etc/systemd/system/klipper.service
KLIPPY_ENV=${HOME}/klippy-env
#nginx
NGINX_SA=/etc/nginx/sites-available
NGINX_SE=/etc/nginx/sites-enabled
NGINX_CONFD=/etc/nginx/conf.d
#moonraker
MOONRAKER_DIR=${HOME}/moonraker
MOONRAKER_ENV_DIR=${HOME}/moonraker-env
MOONRAKER_SERVICE1=/etc/init.d/moonraker
MOONRAKER_SERVICE2=/etc/default/moonraker
MOONRAKER_ENV=${HOME}/moonraker-env
#mainsail
MAINSAIL_DIR=${HOME}/mainsail
#fluidd
FLUIDD_DIR=${HOME}/fluidd
#dwc2
DWC2FK_DIR=${HOME}/dwc2-for-klipper-socket
DWC_ENV_DIR=${HOME}/dwc-env
DWC2_DIR=${HOME}/sdcard/web
DWC2_DIR=${HOME}/duetwebcontrol
#octoprint
OCTOPRINT_DIR=${HOME}/OctoPrint
OCTOPRINT_CFG_DIR=${HOME}/.octoprint
OCTOPRINT_SERVICE1=/etc/init.d/octoprint
OCTOPRINT_SERVICE2=/etc/default/octoprint
#KlipperScreen
KLIPPERSCREEN_DIR=${HOME}/KlipperScreen
KLIPPERSCREEN_ENV_DIR=${HOME}/.KlipperScreen-env
#misc
INI_FILE=${SRCDIR}/kiauh/kiauh.ini
INI_FILE=${HOME}/.kiauh.ini
BACKUP_DIR=${HOME}/kiauh-backups

### set github repos
Expand Down Expand Up @@ -75,7 +67,7 @@ title_msg(){
echo -e "${cyan}$1${default}"
}
get_date(){
current_date=$(date +"%Y-%m-%d_%H-%M")
current_date=$(date +"%y%m%d-%H%M")
}
print_unkown_cmd(){
ERROR_MSG="Invalid command!"
Expand Down
File renamed without changes.
87 changes: 0 additions & 87 deletions resources/fluidd_nginx.cfg

This file was deleted.

60 changes: 60 additions & 0 deletions resources/kiauh_macros.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#########################################################################################
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AUTOCREATED WITH KIAUH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
#########################################################################################
# Those are the recommended macros and config entries if you use Mainsail or Fluidd! #
# Feel free to edit or delete those macros if you already have them defined elsewhere! #
#########################################################################################

[pause_resume]

[display_status]

[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT

[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.x|float %}
{% if act_z < (max_z - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000

[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### end of definitions #####
G91
G1 E{E} F2100
RESTORE_GCODE_STATE NAME=PAUSE_state
BASE_RESUME

#########################################################################################
#########################################################################################
Loading

0 comments on commit 16e6dde

Please sign in to comment.