Setting up OctoPrint on a Raspberry Pi running Raspbian

Excellent guide. Just the right balance between too brief and too detailed!


To make the webcam work I had to add the script (with file name 'webcam') in directory /etc/init.d and not home/pi/scripts/webcam. Next, I did follow what was required for the webcamDaemon file (Make sure you create the file 'scripts'). Finally I executed the following two commands to make it work.

sudo chmod 755 /etc/init.d/webcam
sudo update-rc.d webcam defaults

Another note is you won't have to add the "/home/pi/scripts/webcam start" in the rc.local file.

Phenomenal post. Made an account just to <3 this!

1 Like

<If you want to be able to start and stop mjpeg-streamer from within OctoPrint, put the following in /home/pi/scripts/webcam :

# Start / stop streamer daemon

case "$1" in

  • start)*
  •    /home/pi/scripts/webcamDaemon >/dev/null 2>&1 &*
  •    echo "$0: started"*
  •    ;;*
  • stop)*
  •    pkill -x webcamDaemon*
  •    pkill -x mjpg_streamer*
  •    echo "$0: stopped"*
  •    ;;*
  • )
  •    echo "Usage: $0 {start|stop}" >&2*
  •    ;;*


Put this in /home/pi/scripts/webcamDaemon :>

i Just want it to start when i startup the pi but it doesn't do shit

I guess you missed that part :wink: