Skip to content

Commit

Permalink
Install doc cleanup (#13)
Browse files Browse the repository at this point in the history
* Moved install.sh to scripts/

* Reorganized content and added back how-to-run section
  • Loading branch information
encetamasb authored Jan 31, 2022
1 parent 28ed52f commit 160d808
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 30 deletions.
92 changes: 62 additions & 30 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -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: <path to existing dir>
[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 = <by default it connects to TSD Cloud>
url = <by default it connects to TSD Cloud, optional>
auth_token = <filled in by link command, see bellow>
[moonraker]
Expand All @@ -63,9 +49,11 @@ snapshot_url = <defaults to http://127.0.0.1:8080/?action=snapshot>
# 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

Expand All @@ -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
File renamed without changes.

0 comments on commit 160d808

Please # to comment.