Update Readme

This commit is contained in:
paukstelis
2021-07-07 12:30:05 -04:00
parent 5234eacb30
commit fd7008d4cb

View File

@@ -1,62 +1,37 @@
Updated July, 2021
# octoprint_deploy # octoprint_deploy
These files provide a simple bash script for quickly deploying multiple octoprint instances on a single computer (Ubuntu/debian based systems). These files provide a simple bash script for quickly deploying multiple octoprint instances on a single computer.
# How to use # How to use
* Install Ubuntu on computer of interest. * Ready to go images:
* Install Octoprint. You can follow the directions here: https://octoprint.org/download/ -- For OctoPi and OctoBuntu installations, you can download an image that contains this repo and all necessary things here: https://bit.ly/3qPfmti
or here: https://community.octoprint.org/t/setting-up-octoprint-on-a-raspberry-pi-running-raspbian/2337 -- OctoPi setup is just like for a normal OctoPi installation. OctoBuntu setup uses standard Ubuntu installation.
-- Follow instructions in README.txt file (either /home/pi/README.txt or /home/octouser/README.txt)
* Start up Octoprint for the first time to setup a base instance profile (running on localhost:5000). The base profile will be edited in several places with `INSTANCE` to allow modifications during deployment. You can make this as extensive as you like as far as adding different printers, plugins, etc. They can be added for each instance later. This only needs to be done once. -- Default user for Octobuntu images is `octouser` with password `fooselrulz`; please change this password immediately. No root password is set, but this can be done with `sudo passwd`.
* During setup, edit the restart script: `sudo systemctl restart INSTANCE` * Stand-alone usage:
-- This is for more advanced users that have realtively high command line/Linux familiarity.
-- Start up Octoprint for the first time to setup a base instance profile (running on localhost:5000). The base profile will be edited in several places with `INSTANCE` to allow modifications during deployment. You can make this as extensive as you like as far as adding different printers, plugins, etc. They can be added for each instance later. This only needs to be done once.
-- During setup, edit the restart script: `sudo systemctl restart INSTANCE`
![alt text](/deploy_01.png) ![alt text](/deploy_01.png)
* After the initial setup is done, reload the server and edit the Additional Serial Port field: `/dev/octo_INSTANCE` -- After the initial setup is done, reload the server and edit the Additional Serial Port field: `/dev/octo_INSTANCE`
![alt text](/deploy_02.png) ![alt text](/deploy_02.png)
* You can also edit the server name under apperance with: `INSTANCE` -- You can also edit the server name under apperance with: `INSTANCE`
![alt text](/deploy_03.png) ![alt text](/deploy_03.png)
-- SAVE your changes, then STOP your currently running octoprint server (Ctrl+C in the terminal you started is sufficient)
-- Make sure whichever printer you are installing for is not plugged in via USB
-- Go to wherever you downloaded octoprint_deploy: `$ cd octoprint_deploy`
-- Run the bash script: `$ sudo ./addnew_printer.sh`
-- Select 'Other' option and fill in the appropriate information.
* SAVE your changes, then STOP your currently running octoprint server (Ctrl+C in the terminal you started is sufficient) # Other Features
* Make sure whichever printer you are installing for is not plugged in via USB * Uninstall
* Go to wherever you downloaded octoprint_deploy: `$ cd octoprint_deploy` -- Any instance installed through these scripts can be removed by running the uninstall script. If you use one of the pre-made images, don't remove your base instance!
* Run the bash script: `$ sudo ./addnew_printer.sh` * USB testing
* And follow the instructions. Defaults are shown in brackets. ENTER accepts defaults: -- The script `usbtesting.sh` provides information to help debug auto-detection.
* Add printer udev entries
>UNPLUG PRINTER FROM USB -- You can use the `printer_udev.sh` script to just use the serial number/USB port detection features of these scripts to add udev entires to your machine. This way if you have multiple octoprint instances being run through other means (docker) they can always be linked to a particular device. This will default to /dev/octo_[INSTANCE], so you must change the additional serial port field (see above) in your octoprint setup in order to see these (easiest is just to use /dev/octo_*).
>Enter the name for new printer/instance:
>*printer01*
>Port on which this instance will run (ENTER will increment last value in /etc/octoprint_ports):
>Selected port is: 5000
>Octoprint Daemon User [paul]:
>Octoprint Daemon Path [/home/paul/OctoPrint/venv/bin/octoprint]:
>Octoprint Config Path [/home/paul/]:
>Auto-detect printer serial number for udev entry?*y*
>Plug your printer in via USB now (detection time-out in 2 min)
>Serial number detected as: AL03M8MG
>Octoprint instance template base folder [/home/paul/.octoprint]:
>Do you want to proceed? *y*
This will do the following:
1. Copy everything in ~/.octoprint to ~/.printer01 with the modifications for a server instance on port 5000
2. Update udev rules so this printer will always be at port /dev/octo_printer01
3. Create, start, and enable the service printer01 to control that octoprint instance.
You can now go through and run the script for each printer you want connected to the computer. The limit of instances you can run will likely be dependent on your computer hardware, but I have run 11 printers on an old Core 2 Duo with 4Gb of RAM without issue.
Because each octoprint instance is coming from the same source files, any global modifications you make to octoprint (adding/removing plugins, updating octoprint) are all automatically applied to all of your instances and will take effect when you restart that instance. Because each octoprint instance is coming from the same source files, any global modifications you make to octoprint (adding/removing plugins, updating octoprint) are all automatically applied to all of your instances and will take effect when you restart that instance.
# Other # Other
You likely want to allow the user that is running the octoprint instance (paul in the example) to start/stop/restart services. This can be accomplished with: `sudo visudo`. It is recommended to read up on how to do this without a password. Most generall this can be done by adding `paul ALL=(ALL) NOPASSWD:ALL` to the sudoers file. However, THERE ARE RISKS TO DOING THIS, so consider wisely. You likely want to allow the user that is running the octoprint instance to start/stop/restart services. This can be accomplished with: `sudo visudo`. It is recommended to read up on how to do this without a password. Most generally this can be done by adding `paul ALL=(ALL) NOPASSWD:ALL` to the sudoers file. However, THERE ARE RISKS TO DOING THIS, so consider wisely.