Update README.

This commit is contained in:
cyteen 2020-11-03 10:36:43 +00:00
parent 2f081892e4
commit f65bc2827d
2 changed files with 3 additions and 65 deletions

Binary file not shown.

View File

@ -1,13 +1,9 @@
OctoPrint containers [![Build Status](https://travis-ci.org/AmedeeBulle/octoprint-containers.svg?branch=master)](https://travis-ci.org/AmedeeBulle/octoprint-containers)
OctoPrint containers
====================
# Contents
<!-- TOC START min:1 max:3 link:true update:false -->
- [Introduction](#introduction)
- [Resin.io setup](#resinio-setup)
- [Install ResinOS on your Pi](#install-resinos-on-your-pi)
- [Configure your OctoPrint device](#configure-your-octoprint-device)
- [Install the software on the Device](#install-the-software-on-the-device)
- [Docker setup](#docker-setup)
- [Prepare the Raspberry Pi](#prepare-the-raspberry-pi)
- [Get the containers](#get-the-containers)
@ -21,10 +17,10 @@ OctoPrint containers [![Build Status](https://travis-ci.org/AmedeeBulle/octopri
<!-- TOC END -->
# Introduction
This is a Docker setup for [OctoPrint](https://octoprint.org/) on Raspberry Pi.
It can be run with [resin.io](https://resin.io/) or as _Plain Docker_ on Raspbian.
The setup is made of 3 containers:
- `octoprint`: runs the main [OctoPrint](https://octoprint.org/) application
- `klipper`: runs the [klipper](https://github.com/KevinOConnor/klipper) application
- `webcam`: runs the webcam streaming service (`mjpg-streamer`)
- `haproxy`: exposes the above containers on http and https ports
@ -32,24 +28,6 @@ The build will use by default the latest [OctoPrint](https://octoprint.org/) rel
This setup will run on any Raspberry Pi, however [OctoPrint](https://octoprint.org/) recommends a Raspberry Pi 3 or 3+.
# Resin.io setup
Although it may seem complex at first, [resin.io](https://resin.io/) allows you to install and configure [OctoPrint](https://octoprint.org/) on a Pi in a few clicks.
Also if you have multiple [OctoPrint](https://octoprint.org/) servers, they will be managed from a central place.
For additional help and nice screenshots of the [resin.io](https://resin.io/) interface look at [Get started with Raspberry Pi 3 and Python](https://docs.resin.io/learn/getting-started/raspberrypi3/python/) on the [resin.io](https://resin.io/) site.
## Install ResinOS on your Pi
1. Create an account at [resin.io](https://resin.io/) and sign in
1. Add your public SSH key to your [resin.io](https://resin.io/) profile
1. On [resin.io](https://resin.io/), create an "Application" for managing your Pi.
Choose "Raspberry Pi 3" as Device Type.
1. Add a Device to your Application.
- Configure wifi here if your Pi is wireless.
- Download the ResinOS image for your Pi.
1. Follow the instructions to write the OS on your SD-Card and boot your Pi.
After a while your Pi will appear in your Application Dashboard.
1. If you like you can change the name of your device.
## Configure your OctoPrint device
The Environment Variables menu "E(x)" allows you to add variables to configure the device for your usage.
@ -60,35 +38,7 @@ Name | Default | Description
WEBCAM_START | `true` | Start the webcam streaming at boot time.<br>Use false if you have no webcam or want to start it from the [OctoPrint](https://octoprint.org/) menu
WEBCAM_INPUT | `input_raspicam.so -fps 5` | The input plugin for [`mjpg-streamer`](https://github.com/jacksonliam/mjpg-streamer).<br>Default is for the Raspberry Pi camera, see the documentation for others.<br>Example for an USB webcam: `input_uvc.so -d /dev/video0 -r 640x480 -fps 5`.
## Install the software on the Device
The device is now ready, we need to push the containers through [resin.io](https://resin.io/).
The following commands need to be executed from the terminal on your local machine -- __not__ on the Raspberry Pi!
(On Windows, use [Git BASH](https://gitforwindows.org/) or something similar).
Clone this repository:
```
$ git clone https://github.com/AmedeeBulle/octoprint-containers.git
$ cd octoprint-containers/
```
Add the address of your [resin.io](https://resin.io/) repository. This command is displayed in the top-left corner of your application dashboard on the web site and looks like:
```
$ git remote add resin <USERNAME>@git.resin.io:<USERNAME>/<APPNAME>.git
```
Push the code to [resin.io](https://resin.io/):
```
$ git push resin master
```
This will trigger a build on the [resin.io](https://resin.io/) servers. If all goes well it will finish with a nice unicorn &#x1f984; ASCII art.
Your Raspberry Pi will download and run the containers automatically; after that your [OctoPrint](https://octoprint.org/) server will be ready to go!
For future updates, you simply need to pull the new code and push it back to [resin.io](https://resin.io/) and your device will be updated!
```
$ git pull origin master
$ git push resin master
```
# Docker setup
If you do not want to use the [resin.io](https://resin.io/) services, you can run the exact same configuration directly on your Raspberry Pi.
## Prepare the Raspberry Pi
Download and install [Raspbian Stretch Lite](https://www.raspberrypi.org/downloads/raspbian/) to your Pi (Follow the instructions from the Foundation).
@ -111,7 +61,7 @@ From here, __you don't need root access anymore__.
Clone this repository:
```
$ git clone https://github.com/AmedeeBulle/octoprint-containers.git
$ git clone https://git.ring-zero.co.uk/docker/octoprint-containers.git
$ cd octoprint-containers/
```
@ -137,12 +87,6 @@ $ docker-compose build
__If you are not using a Raspberry Pi 3__: copy the `.env-distr` to `.env` and select you Raspberry Pi version.
## Configure and run the OctoPrint server
To customise your setup, create a file named `.env` with the environment variables described in the [resin.io](https://resin.io/) section. You can use the file `.env-distr` as template.
__Important__: in `docker-compose.yml` uncomment the following line:
```
- /run/dbus:/host/run/dbus
```
If you don't do that, you won't be able to restart or shut down you Pi from the [OctoPrint](https://octoprint.org/) user interface.
Run the [OctoPrint](https://octoprint.org/) server:
@ -165,7 +109,6 @@ $ docker-compose up -d
```
# First run
For a _Plain Docker_ setup, you know the IP address of your Pi; if you run [resin.io](https://resin.io/), you will find the address in the application console.
Point your browser to the IP address of your Raspberry Pi and enjoy [OctoPrint](https://octoprint.org/)!
@ -175,16 +118,11 @@ Enjoy!
# Note about persistence
All working files (configuration, G-Code, time-lapses, ...) are stored in the `octoprint_vol` Docker volume, so they won't disappear unless you explicitly destroy the volume.
If you really need/want to destroy the volume and re-start from scratch:
- [resin.io](https://resin.io/): select 'Purge Data' in the Device Menu
- _Plain Docker_: run
```
docker-compose down -v
```
The same applies to the containers themselves: they won't be destroyed by default even if you reboot the Pi. To remove existing container and re-create them:
- [resin.io](https://resin.io/): click on the 'Restart' icon in the Device Dashboard
- _Plain Docker_: run
```
docker-compose down
docker-compose up -d