From 160d8080fc7dc0ef27810d92880f9f6a12587a49 Mon Sep 17 00:00:00 2001 From: Bence Tamas <47483431+encetamasb@users.noreply.github.com> Date: Mon, 31 Jan 2022 15:50:59 +0100 Subject: [PATCH] Install doc cleanup (#13) * Moved install.sh to scripts/ * Reorganized content and added back how-to-run section --- Readme.md | 92 +++++++++++++++++++++----------- install.sh => scripts/install.sh | 0 2 files changed, 62 insertions(+), 30 deletions(-) rename install.sh => scripts/install.sh (100%) diff --git a/Readme.md b/Readme.md index ee1735a..614f06c 100644 --- a/Readme.md +++ b/Readme.md @@ -1,56 +1,42 @@ -Standalone application for TheSpaghettiDetective - moonraker integration ------------------------------------------------------------------------- +TheSpaghettiDetective - Moonraker plugin +---------------------------------------- Alpha version, with limited functionality and for development only. Please don't use it in production and be careful while using it! -Preparing Klipper and Moonraker -------------------------------- +Klipper Configuration Requirements +---------------------------------- Following sections are mandatory in printer.cfg (of Klipper): ``` - [virtual_sdcard] path: [display_status] [pause_resume] - ``` +Moonraker Configuration Requirements +------------------------------------ + Following sections are mandatory in Moonraker's config file: ``` - [history] - -[update_manager tsd-moonraker] -type: git_repo -path: ~/tsd-moonraker -origin: https://github.com/TheSpaghettiDetective/tsd-moonraker.git -primary_branch: main -env: ~/tsd-moonraker-env/bin/python3 -requirements: requirements.txt -install_script: install.sh -is_system_service: True - - ``` -Grab moonraker api key from ```/access/api_key```. -If TSD agent connects from a [trusted host](https://moonraker.readthedocs.io/en/latest/configuration/#authorization), you can skip this. +Configuration +------------- - -config.ini ----------- +Create plugin's config.ini with following content: ``` [thespaghettidetective] -url = +url = auth_token = [moonraker] @@ -63,9 +49,11 @@ snapshot_url = # stream_url = http://127.0.0.1:8080/?action=stream ``` +You can grab Moonraker api key from ```/access/api_key```. +If TSD plugin connects from a [trusted host](https://moonraker.readthedocs.io/en/latest/configuration/#authorization), you can skip this. -How to run ----------- +How to install (systemd) +------------------------ # clone repo @@ -75,18 +63,62 @@ How to run # when the process is done, run the install script: cd tsd-moonraker - ./install.sh + ./scripts/install.sh # fill in essential configuration nano ~/klipper_config/config.ini # link printer (grab tsd auth token) - + source ~/tsd-moonraker-env/bin/activate python3 -m tsd_moonraker.link -c ~/klipper_config/config.ini # start service sudo systemctl start tsd-moonraker - + +Add an entry for Moonraker's update manager: + +``` +[update_manager tsd-moonraker] +type: git_repo +path: ~/tsd-moonraker +origin: https://github.com/TheSpaghettiDetective/tsd-moonraker.git +primary_branch: main +env: ~/tsd-moonraker-env/bin/python3 +requirements: requirements.txt +install_script: scripts/install.sh +is_system_service: True +``` + +How to run without installation +------------------------------- + + # requires python3; install python3 packages + + sudo apt-get install python3 python3-pip python3-venv + + # clone repo + + git clone https://github.com/TheSpaghettiDetective/tsd-moonraker.git + + # setup virtual environment + + python3 -m venv tsd-moonraker/ + cd tsd-moonraker + source ./bin/activate + pip3 install -r requirements.txt + + # fill in essential configuration + + cp config.sample.ini config.ini + nano config.ini + + # link printer (grab tsd auth token) + + python3 -m tsd_moonraker.link -c config.ini + + # start app + + python3 -m tsd_moonraker.app -c config.ini -l tsd_moonraker.log diff --git a/install.sh b/scripts/install.sh similarity index 100% rename from install.sh rename to scripts/install.sh