64 |
The OctoPrint server is currently not running
65 |
66 |
67 | If you just started up your Raspberry Pi, please wait a couple of seconds, then
68 | try to refresh this page.
69 |
70 |
71 |
72 | If the issue persists, please log into your Raspberry Pi via SSH and check the following:
73 |
74 |
75 |
96 |
97 |
98 | If all that doesn't help to trouble shoot the issue, you can seek
99 | support on the OctoPrint Community Forum.
100 | Please provide your OctoPi and OctoPrint versions as well as your octoprint.log
101 | and explain what you already tried and observed as detailed as possible.
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/haproxy/errors/503-no-webcam.http:
--------------------------------------------------------------------------------
1 | HTTP/1.0 503 Service Unavailable
2 | Cache-Control: no-cache
3 | Connection: close
4 | Content-Type: text/html
5 |
6 |
7 |
8 |
64 |
The webcam server is currently not running
65 |
66 |
67 | If you do not have a camera attached, this is normal and can be safely ignored.
68 |
69 |
70 |
71 | Otherwise, if you just started up your Raspberry Pi or just plugged in your camera,
72 | please wait a couple of seconds.
73 |
74 |
75 |
76 | If the issue persists, please check the following:
77 |
78 |
79 |
101 |
102 |
103 | If all that doesn't help to trouble shoot the issue, you can seek
104 | support on the OctoPrint Community Forum.
105 | Please provide your camera model, lsusb
output and /var/log/webcamd.log
and explain what you
106 | already tried and observed as detailed as possible.
107 |
108 |
109 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/haproxy/haproxy.cfg:
--------------------------------------------------------------------------------
1 | global
2 | maxconn 4096
3 | user haproxy
4 | group haproxy
5 | log 127.0.0.1 local1 debug
6 |
7 | defaults
8 | log global
9 | mode http
10 | option httplog
11 | option dontlognull
12 | retries 3
13 | option redispatch
14 | option http-server-close
15 | option forwardfor
16 | maxconn 2000
17 | timeout connect 5s
18 | timeout client 15min
19 | timeout server 15min
20 |
21 | frontend public
22 | bind :::80 v4v6
23 | bind :::443 v4v6 ssl crt /etc/ssl/snakeoil.pem
24 | option forwardfor except 127.0.0.1
25 | use_backend webcam if { path_beg /webcam/ }
26 | default_backend octoprint
27 |
28 | backend octoprint
29 | acl needs_scheme req.hdr_cnt(X-Scheme) eq 0
30 |
31 | reqrep ^([^\ :]*)\ /(.*) \1\ /\2
32 | reqadd X-Scheme:\ https if needs_scheme { ssl_fc }
33 | reqadd X-Scheme:\ http if needs_scheme !{ ssl_fc }
34 | option forwardfor
35 | server octoprint1 127.0.0.1:5000
36 | errorfile 503 /etc/haproxy/errors/503-no-octoprint.http
37 |
38 | backend webcam
39 | reqrep ^([^\ :]*)\ /webcam/(.*) \1\ /\2
40 | server webcam1 127.0.0.1:8080
41 | errorfile 503 /etc/haproxy/errors/503-no-webcam.http
42 |
43 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/init.d/change_hostname:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ### BEGIN INIT INFO
3 | # Provides: change_hostname
4 | # Required-Start: $local_fs
5 | # Required-Stop:
6 | # Default-Start: 3
7 | # Default-Stop:
8 | # Short-Description: Change pi's hostname via /boot/octopi-hostname.txt
9 | # Description:
10 | ### END INIT INFO
11 |
12 | . /lib/lsb/init-functions
13 |
14 | do_start () {
15 | text_file="/boot/octopi-hostname.txt"
16 | if [ ! -f "$text_file" ]
17 | then
18 | exit 0
19 | fi
20 |
21 | old_hostname=`hostname`
22 | new_hostname=`head -n1 "$text_file" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | tr -d '\n'`
23 |
24 | if [ ! -n "$new_hostname" ]
25 | then
26 | log_failure_msg "No new host name provided, refusing to change to empty host name"
27 | exit 1
28 | fi
29 |
30 | # make sure we do have a valid hostname here (see RFC 952 and 1123, a-zA-Z0-9 only)
31 | sanitized_hostname=`echo "$new_hostname" | tr -cd '[[:alnum:]]-'`
32 | if [ "$new_hostname" = "$sanitized_hostname" ]
33 | then
34 | rm "$text_file"
35 | echo "$new_hostname" > /etc/hostname
36 | sed -i -e "s@$old_hostname@$new_hostname@g" /etc/hosts
37 |
38 | log_success_msg "Change of host name prepared, rebooting to apply..."
39 | /sbin/reboot
40 | else
41 | log_failure_msg "Hostname $new_hostname contains invalid characters (only a-zA-Z0-9 are allowed), refusing to change"
42 | fi
43 | }
44 |
45 | case "$1" in
46 | start|"")
47 | do_start
48 | ;;
49 | restart|reload|force-reload)
50 | echo "Error: argument '$1' not supported" >&2
51 | exit 3
52 | ;;
53 | stop)
54 | # No-op
55 | ;;
56 | *)
57 | echo "Usage: change_hostname [start|stop]" >&2
58 | exit 3
59 | ;;
60 | esac
61 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/init.d/change_password:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ### BEGIN INIT INFO
3 | # Provides: change_password
4 | # Required-Start: $local_fs
5 | # Required-Stop:
6 | # Default-Start: 3
7 | # Default-Stop:
8 | # Short-Description: Change pi's password via /boot/octopi-password.txt
9 | # Description:
10 | ### END INIT INFO
11 |
12 | . /lib/lsb/init-functions
13 |
14 | do_start () {
15 | text_file="/boot/octopi-password.txt"
16 | if [ ! -f "$text_file" ]
17 | then
18 | exit 0
19 | fi
20 |
21 | new_password=`head -n1 "$text_file" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | tr -d '\n'`
22 | if [ ! -n "$new_password" ]
23 | then
24 | log_failure_msg "No new password provided, refusing to change to empty password"
25 | exit 1
26 | fi
27 |
28 | (echo "pi:$new_password" | chpasswd && rm "$text_file" && log_success_msg "Password for user pi changed and change file deleted") || log_failure_msg "Could not change password"
29 | }
30 |
31 | case "$1" in
32 | start|"")
33 | do_start
34 | ;;
35 | restart|reload|force-reload)
36 | echo "Error: argument '$1' not supported" >&2
37 | exit 3
38 | ;;
39 | stop)
40 | # No-op
41 | ;;
42 | *)
43 | echo "Usage: change_password [start|stop]" >&2
44 | exit 3
45 | ;;
46 | esac
47 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/init.d/octoprint:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ### BEGIN INIT INFO
4 | # Provides: octoprint
5 | # Required-Start: $local_fs networking
6 | # Required-Stop:
7 | # Should-Start:
8 | # Should-Stop:
9 | # Default-Start: 2 3 4 5
10 | # Default-Stop: 0 1 6
11 | # Short-Description: OctoPrint daemon
12 | # Description: Starts the OctoPrint daemon with the user specified in
13 | # /etc/default/octoprint.
14 | ### END INIT INFO
15 |
16 | # Author: Sami Olmari
17 |
18 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
19 | DESC="OctoPrint Daemon"
20 | NAME="OctoPrint"
21 | DAEMON=/usr/bin/octoprint
22 | PIDFILE=/var/run/$NAME.pid
23 | PKGNAME=octoprint
24 | SCRIPTNAME=/etc/init.d/$PKGNAME
25 |
26 | # Read configuration variable file if it is present
27 | [ -r /etc/default/$PKGNAME ] && . /etc/default/$PKGNAME
28 |
29 | # Exit if the octoprint is not installed
30 | [ -x "$DAEMON" ] || exit 0
31 |
32 | # Load the VERBOSE setting and other rcS variables
33 | [ -f /etc/default/rcS ] && . /etc/default/rcS
34 |
35 | # Define LSB log_* functions.
36 | # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
37 | . /lib/lsb/init-functions
38 |
39 | if [ -z "$START" -o "$START" != "yes" ]
40 | then
41 | log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it."
42 | exit 0
43 | fi
44 |
45 | if [ -z "$OCTOPRINT_USER" ]
46 | then
47 | log_warning_msg "Not starting $PKGNAME, OCTOPRINT_USER not set in /etc/default/$PKGNAME."
48 | exit 0
49 | fi
50 |
51 | #
52 | # Function to verify if a pid is alive
53 | #
54 | is_alive()
55 | {
56 | pid=`cat $1` > /dev/null 2>&1
57 | kill -0 $pid > /dev/null 2>&1
58 | return $?
59 | }
60 |
61 | #
62 | # Function that starts the daemon/service
63 | #
64 | do_start()
65 | {
66 | # Return
67 | # 0 if daemon has been started
68 | # 1 if daemon was already running
69 | # 2 if daemon could not be started
70 |
71 | is_alive $PIDFILE
72 | RETVAL="$?"
73 |
74 | if [ $RETVAL != 0 ]; then
75 | start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
76 | --exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK -- serve $DAEMON_ARGS
77 | RETVAL="$?"
78 | fi
79 | }
80 |
81 | #
82 | # Function that stops the daemon/service
83 | #
84 | do_stop()
85 | {
86 | # Return
87 | # 0 if daemon has been stopped
88 | # 1 if daemon was already stopped
89 | # 2 if daemon could not be stopped
90 | # other if a failure occurred
91 |
92 | start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $OCTOPRINT_USER --pidfile $PIDFILE
93 | RETVAL="$?"
94 | [ "$RETVAL" = "2" ] && return 2
95 |
96 | rm -f $PIDFILE
97 |
98 | [ "$RETVAL" = "0" ] && return 0 || return 1
99 | }
100 |
101 | case "$1" in
102 | start)
103 | [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
104 | do_start
105 | case "$?" in
106 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
107 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
108 | esac
109 | ;;
110 | stop)
111 | [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
112 | do_stop
113 | case "$?" in
114 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
115 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
116 | esac
117 | ;;
118 | restart)
119 | log_daemon_msg "Restarting $DESC" "$NAME"
120 | do_stop
121 | case "$?" in
122 | 0|1)
123 | do_start
124 | case "$?" in
125 | 0) log_end_msg 0 ;;
126 | 1) log_end_msg 1 ;; # Old process is still running
127 | *) log_end_msg 1 ;; # Failed to start
128 | esac
129 | ;;
130 | *)
131 | # Failed to stop
132 | log_end_msg 1
133 | ;;
134 | esac
135 | ;;
136 | *)
137 | echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
138 | exit 3
139 | ;;
140 | esac
141 |
142 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/init.d/webcamd:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ### BEGIN INIT INFO
4 | # Provides: webcamd
5 | # Required-Start: $local_fs networking
6 | # Required-Stop:
7 | # Should-Start:
8 | # Should-Stop:
9 | # Default-Start: 2 3 4 5
10 | # Default-Stop: 0 1 6
11 | # Short-Description: webcam daemon
12 | # Description: Starts the OctoPi webcam daemon with the user specified config in
13 | # /etc/default/webcamd.
14 | ### END INIT INFO
15 |
16 | # Author: Gina Haeussge
17 |
18 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
19 | DESC="Webcam Daemon"
20 | NAME="webcamd"
21 | DAEMON=/root/bin/webcamd
22 | USER=pi
23 | PIDFILE=/var/run/$NAME.pid
24 | PKGNAME=webcamd
25 | SCRIPTNAME=/etc/init.d/$PKGNAME
26 | LOG=/var/log/webcamd.log
27 |
28 | # Read configuration variable file if it is present
29 | [ -r /etc/default/$PKGNAME ] && . /etc/default/$PKGNAME
30 |
31 | # Exit if the octoprint is not installed
32 | [ -x "$DAEMON" ] || exit 0
33 |
34 | # Load the VERBOSE setting and other rcS variables
35 | [ -f /etc/default/rcS ] && . /etc/default/rcS
36 |
37 | # Define LSB log_* functions.
38 | # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
39 | . /lib/lsb/init-functions
40 |
41 | if [ -z "$ENABLED" -o "$ENABLED" != "1" ]
42 | then
43 | log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it."
44 | exit 0
45 | fi
46 |
47 | #
48 | # Function to verify if a pid is alive
49 | #
50 | is_alive()
51 | {
52 | pid=`cat $1` > /dev/null 2>&1
53 | kill -0 $pid > /dev/null 2>&1
54 | return $?
55 | }
56 |
57 | #
58 | # Function that starts the daemon/service
59 | #
60 | do_start()
61 | {
62 | # Return
63 | # 0 if daemon has been started
64 | # 1 if daemon was already running
65 | # 2 if daemon could not be started
66 |
67 | is_alive $PIDFILE
68 | RETVAL="$?"
69 |
70 | if [ $RETVAL != 0 ]; then
71 | start-stop-daemon --start --background --no-close --quiet --pidfile $PIDFILE --make-pidfile \
72 | --startas /bin/bash --chuid $USER --user $USER -- -c "exec $DAEMON" >> $LOG 2>&1
73 | RETVAL="$?"
74 | fi
75 | }
76 |
77 | #
78 | # Function that stops the daemon/service
79 | #
80 | do_stop()
81 | {
82 | # Return
83 | # 0 if daemon has been stopped
84 | # 1 if daemon was already stopped
85 | # 2 if daemon could not be stopped
86 | # other if a failure occurred
87 |
88 | start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $USER --pidfile $PIDFILE
89 | RETVAL="$?"
90 | [ "$RETVAL" = "2" ] && return 2
91 |
92 | rm -f $PIDFILE
93 |
94 | [ "$RETVAL" = "0" ] && return 0 || return 1
95 | }
96 |
97 | case "$1" in
98 | start)
99 | [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
100 | do_start
101 | case "$?" in
102 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
103 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
104 | esac
105 | ;;
106 | stop)
107 | [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
108 | do_stop
109 | case "$?" in
110 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
111 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
112 | esac
113 | ;;
114 | restart)
115 | log_daemon_msg "Restarting $DESC" "$NAME"
116 | do_stop
117 | case "$?" in
118 | 0|1)
119 | do_start
120 | case "$?" in
121 | 0) log_end_msg 0 ;;
122 | 1) log_end_msg 1 ;; # Old process is still running
123 | *) log_end_msg 1 ;; # Failed to start
124 | esac
125 | ;;
126 | *)
127 | # Failed to stop
128 | log_end_msg 1
129 | ;;
130 | esac
131 | ;;
132 | *)
133 | echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
134 | exit 3
135 | ;;
136 | esac
137 |
138 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/logrotate.d/webcamd:
--------------------------------------------------------------------------------
1 | /var/log/webcam.log
2 | {
3 | rotate 4
4 | weekly
5 | missingok
6 | notifempty
7 | compress
8 | delaycompress
9 | sharedscripts
10 | }
11 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/systemd/system/gencert.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Ensure that haproxy certs are generated
3 |
4 | DefaultDependencies=no
5 |
6 | Before=network-pre.target
7 | Wants=network-pre.target
8 |
9 | After=local-fs.target
10 | Wants=local-fs.target
11 |
12 | [Service]
13 | Type=oneshot
14 | ExecStart=/root/bin/gencert
15 |
16 | [Install]
17 | WantedBy=multi-user.target
18 |
--------------------------------------------------------------------------------
/src/modules/octopi/filesystem/root/etc/udev/rules.d/95-ads7846.rules:
--------------------------------------------------------------------------------
1 | SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{name}=="ADS7846*", SYMLINK+="input/touchscreen"
2 |
--------------------------------------------------------------------------------
/src/modules/octopi/start_chroot_script:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # OctoPI generation script
3 | # Helper script that runs in a Raspbian chroot to create the OctoPI distro
4 | # Written by Guy Sheffer