Skip to content

Commit

Permalink
Add Anet A8
Browse files Browse the repository at this point in the history
  • Loading branch information
tochev committed Jul 8, 2020
1 parent 74ec2c6 commit ba32c05
Show file tree
Hide file tree
Showing 23 changed files with 480 additions and 11 deletions.
16 changes: 13 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
init Lab 3D printers config
# init Lab 3D Printers Config #

- udev files for group permissions
- scripts for uvc_streamer

TODO
- slicer config
- octoprint config
- python3
- auto-deploy
- document cams
- more documentation

## Installing New Printer ##

See `docs/installing-new-printer.md`

## Slicer Install ##

See `docs/install-slic3r.sh`
26 changes: 26 additions & 0 deletions docs/install-slic3r.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -e
set -x

sudo apt-get update
sudo apt install -y git libboost-all-dev libboost-geometry-utils-perl libboost-system-dev libboost-thread-dev git-core build-essential libwxgtk3.0-dev libgtk-3-dev libwx-perl libmodule-build-perl libnet-dbus-perl cpanminus gcc-4.7 g++-4.7 libwx-perl libperl-dev libextutils-cppguess-perl libeigen3-dev libglew-dev cpanminus libcurl4-openssl-dev
sudo cpan ExtUtils::CBuilder ExtUtils::CppGuess Alien::wxWidgets CPAN::Mini ExtUtils::XSpp::Cmd ExtUtils::Typemaps::Basic

SLIC3R_REPO="https://github.com/alexrj/Slic3r.git"
SLIC3R_VERSION="master"
SLIC3R_DIR=~/Slic3r

sudo rm -rf ${SLIC3R_DIR}
git clone ${SLIC3R_REPO} ${SLIC3R_DIR}
cd ${SLIC3R_DIR}
git fetch ${SLIC3R_REPO}
git checkout ${SLIC3R_VERSION}
perl Build.PL --sudo
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release #-DSLIC3R_WX_STABLE=1 #maybe need to use this option by uncommenting
sudo make -j2
ctest --verbose
cd ..
./slic3r.pl --help
85 changes: 85 additions & 0 deletions docs/installing-new-printer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# General System Preparations #

```sh
sudo apt update
sudo apt install python python-dev python-virtualenv
sudo apt install vim-nox mc git screen tmux

# TODO: add more stuff

# TODO: nginx conf
```

# Steps for Installing a New Printer #

## Home Directory ##

Substitute `PRINTER_NAME` and `PORT` appropriately.

```sh
# create new user
sudo useradd -m -s /bin/bash octoprint.PRINTER_NAME`
# add the new printer to `udev-rules.d/99-octoprint.rules`
vim /etc/udev-rules.d/99-octoprint.rules
# add the new camera to `udev-rules.d/99-cameras.rules`
vim /etc/udev-rules.d/99-cameras.rules
sudo -iu octoprint.PRINTER_NAME
# create virtualenv
cd ~/
virtualenv octoprint
cd octoprint
. bin/activate
pip install octoprint # current version is 1.4.0
PORT=5002 # the port of the printer
cat > ~/start.sh <<EOF
#!/bin/bash
screen -dm bash -c '~/octoprint/bin/octoprint serve --host 127.0.0.1 --port $PORT; sleep 60'
EOF
chmod +x ~/start.sh
crontab -e
# add:
# @reboot /home/octoprint.PRINTER_NAME/start.sh
cat >restart.sh <<EOF
#!/bin/bash
/sbin/start-stop-daemon --stop --retry=TERM/30/KILL/5 --user $LOGNAME --exec ~/octoprint/bin/python2 && \
~/start.sh
EOF
chmod +x restart.sh
```

```sh
# as root
# edit nginx/octoprint.conf
vim /etc/nginx/sites-available/octoprint
# add the new printer and streamer, use the other printers as template
```

Restart and follow the instructions.

After the restart you might make a diff with the other configurations and install plugins.

## Plug-ins ##

Plug-ins to install:
- PSU Control
- OctoPrint-Slic3r
- Full-featured Slicer
- OctoPrint-Telegram
- Themeify
- TouchUI

## Web Portal ##

Edit `web/index.html` and transfer it to `[email protected]:/home/web/public/`

31 changes: 29 additions & 2 deletions nginx/octoprint → nginx/octoprint.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@ upstream "octoprint-mendel" {
server 127.0.0.1:5000;
}

upstream "octoprint-i3mega" {
upstream "octoprint-a8" {
server 127.0.0.1:5001;
}

upstream "octoprint-i3mega" {
server 127.0.0.1:5002;
}

upstream "streamer-mendel" {
server 127.0.0.1:8080;
}

upstream "streamer-i3mega" {
upstream "streamer-a8" {
server 127.0.0.1:8081;
}

upstream "streamer-i3mega" {
server 127.0.0.1:8081; # TODO: set when there is a new camera
}

server {
listen 80 default_server;
listen [::]:80 default_server;
Expand Down Expand Up @@ -47,6 +55,20 @@ server {
client_max_body_size 0;
}

location /a8/ {
proxy_pass http://octoprint-a8/;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /a8;
proxy_http_version 1.1;

client_max_body_size 0;
}

location /i3mega/ {
proxy_pass http://octoprint-i3mega/;
proxy_set_header Host $http_host;
Expand All @@ -65,6 +87,11 @@ server {
set $args '';
proxy_pass http://streamer-mendel/;
}

location /streamer/a8/ {
set $args '';
proxy_pass http://streamer-a8/;
}

location /streamer/i3mega/ {
set $args '';
Expand Down
110 changes: 110 additions & 0 deletions octoprint-configs/a8/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
accessControl:
enabled: false
appearance:
closeModalsWithClick: false
color: white
colorTransparent: true
name: A8 - init Lab
plugins:
_disabled:
- announcements
- tracking
- appkeys
- discovery
- errortracking
- virtual_printer
announcements:
_config_version: 1
channels:
_blog:
read_until: 1593102540
_important:
read_until: 1521111600
_octopi:
read_until: 1573722900
_plugins:
read_until: 1593838800
_releases:
read_until: 1594206900
enabled_channels:
- _important
discovery:
upnpUuid: 22792b30-da29-444b-bc78-6edc82ac5eca
errortracking:
unique_id: 35aab4b3-eb01-4799-8a8d-893b32accd41
psucontrol:
_config_version: 3
disconnectOnPowerOff: true
enablePseudoOnOff: true
offSysCommand: 'curl -sX PUT -H "Accept: application/json" http://SECRET/api/relay/0
--data "apikey=SECRET&value=0"'
onSysCommand: 'curl -sX PUT -H "Accept: application/json" http://SECRET/api/relay/0
--data "apikey=SECRET&value=1"'
senseSystemCommand: curl -s 'http://SECRET/api/relay/0?apikey=SECRET'
| grep -q 1
sensingMethod: SYSTEM
switchingMethod: SYSTEM
slic3r:
slic3r_engine: /usr/bin/slic3r-prusa3d
softwareupdate:
_config_version: 7
telegram:
_config_version: 4
chats: {}
messages:
StatusPrinting:
combined: true
themeify:
color:
- deletable: false
enabled: true
rule: background
selector: .navbar-inner
value: gray
enableCustomization: true
theme: discoranged
tracking:
enabled: false
events:
commerror: false
plugin: false
pong: false
printer: false
printer_safety_check: false
printjob: false
slicing: false
startup: false
throttled: false
update: false
printerProfiles:
default: _default
serial:
autoconnect: true
baudrate: 115200
port: /dev/ttyUSB-a8
server:
commands:
serverRestartCommand: ~/restart.sh &
firstRun: false
onlineCheck:
enabled: false
host: 9.9.9.9
pluginBlacklist:
enabled: true
seenWizards:
corewizard: 3
telegram: 1
tracking: null
slicing:
defaultProfiles:
slic3r: slic3r_config_bundle
temperature:
profiles:
- bed: 65
chamber: null
extruder: 210
name: PLA
webcam:
snapshot: http://127.0.0.1/streamer/a8/snapshot.jpeg
stream: /streamer/a8/stream.mjpeg
streamRatio: '4:3'
1 change: 1 addition & 0 deletions octoprint-configs/a8/cron.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@reboot /home/octoprint.a8/start.sh
33 changes: 33 additions & 0 deletions octoprint-configs/a8/printerProfiles/_default.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
axes:
e:
inverted: false
speed: 300
x:
inverted: false
speed: 6000
y:
inverted: false
speed: 6000
z:
inverted: false
speed: 200
color: default
extruder:
count: 1
nozzleDiameter: 0.4
offsets:
- - 0.0
- 0.0
sharedNozzle: false
heatedBed: true
heatedChamber: false
id: a8_-_init_lab
model: Anet A8
name: A8 - init Lab
volume:
custom_box: false
depth: 220.0
formFactor: rectangular
height: 240.0
origin: lowerleft
width: 220.0
File renamed without changes.
Loading

0 comments on commit ba32c05

Please sign in to comment.