Setting up OctoPrint on a Raspberry Pi running Raspberry Pi OS (Debian)

I made it
thank

grafik
No Ideas?
Need Help.

Regards Alero

good evening ... excellent guide, perfect even for beginners
I have a problem, I can't find the octopi.txt file, it looks like it hasn't been installed and if I download one from github, it doesn't let me save it in the root folder

As its name implies, the octopi.txt file is OctoPi specific. If you don't use OctoPi (and if you are using this guide you probably aren't or you wouldn't be using the guide) you won't have it.

I need some help/direction pointing...
OctoPrint 1.4.2 on Raspberry Pi 4, fully updated\upgraded
fresh install of Octo everything Octo-wise works fine, but when attempting to get the Raspberry Pi Cam to auto start, I get notta!
I can manually start the cam, and it works as expected, just not as a daemon
followed the instructions here to a TEE..

I created a directory </home/pi/scripts> as it didn't exist, I then created to blank files, an cut\paste the corresponding contents from this page in to the files "webcam" & " webcamDaemon", I also applied executable permissions. and Finely edited the rc.local file as instructed as well!
I get no love!

this is the working manual command I can use...
<./mjpg_streamer -i "./input_raspicam.so -vs -x 1280 -y 720 -fps 32" -o "./output_http.so" >

as a side note, I have looked all over attempting to use all kinds of different configurations

IMHO, the "Optional: Webcam" section is more complicated than it needs to be especially for the latest Raspberry Pi OS based off Debian using systemd.

Build mjpg-streamer

cd ~
git clone https://github.com/jacksonliam/mjpg-streamer.git
cd mjpg-streamer-experimental
make

Start it automatically

Create the systemd service by sudo nano /etc/systemd/system/mjpg-streamer.service and add this inside the file

[Unit]
Description=mjpg streamer for octoprint webcam
After=network.target

[Service]
Restart=always
# Adjust the CLI params (see https://community.octoprint.org/t/available-mjpg-streamer-configuration-options/1106)
# Replace `pi` with your raspberry pi username if different
# For camera plugged via USB cable (i.e. webcam)
ExecStart=/home/pi/mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -o "/home/pi/mjpg-streamer/mjpg-streamer-experimental/output_http.so -p 8080 -w /home/pi/mjpg-streamer/mjpg-streamer-experimental/www" -i "/home/pi/mjpg-streamer/mjpg-streamer-experimental/input_uvc.so -f 15"
# For camera connected via the dedicated camera port using the ribbon cable
# ExecStart=/home/pi/mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -o "/home/pi/mjpg-streamer/mjpg-streamer-experimental/output_http.so -p 8080 -w /home/pi/mjpg-streamer/mjpg-streamer-experimental/www" -i "/home/pi/mjpg-streamer/mjpg-streamer-experimental/input_raspicam.so -fps 15"


[Install]
WantedBy=multi-user.target

Then enable, start with the following commands

sudo systemctl daemon-reload 
sudo systemctl enable mjpg-streamer 
sudo systemctl start mjpg-streamer
sudo systemctl status mjpg-streamer

This is WAY more direct than all the unnecessary bash scripts that make it more fragile.

I request the instructions be updated to reflect this simplicity.

3 Likes

hello I am trying to install octopring manually, on the other hand the above described manipulation uses phyton 2.7 which is obsolete so I can not do the installation.

OMG that was so MUCH easier!!! I had to change the path to MJPG-streamer dude to the git I had pulled previously but FFS those directions were clear and understandably

thanks!!!!!!

At the cost of easy configurability through a simple text file similar to how it is done on OctoPi. Which people then get confused about ("I created /boot/octopi.txt but nothing happens!!1!").

But considering that this part of the guide is years old by now I agree that it's time for an overhaul. The post up there is a wiki node. Anyone who's been on this forum long enough to be in trust level 1 (read: a couple of hours with some minor participation, so pretty much everyone who actually stays a while and doesn't just play hit and run here) can edit it. Be my guest in improving the docs :slight_smile:

If you want to be able to start and stop the webcam server through OctoPrint's system menu, add the following to config.yaml :

Where can I find config.yaml ?

https://docs.octoprint.org/en/master/configuration/config_yaml.html

@user8374585 Works great, thanks for that.

I've followed the tutorial and when I run the serve command this is the last I see:

2020-10-29 00:22:59,937 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/webassets...

2020-10-29 00:22:59,938 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/.webassets-cache...

2020-10-29 00:23:00,636 - octoprint.server - INFO - Shutting down intermediary server...

2020-10-29 00:23:00,773 - octoprint.server - INFO - Intermediary server shut down

2020-10-29 00:23:00,775 - octoprint.events - INFO - Processing startup event, this is our first event

2020-10-29 00:23:00,776 - octoprint.events - INFO - Adding 0 events to queue that were held back before startup event

2020-10-29 00:23:00,779 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...

2020-10-29 00:23:00,783 - octoprint.server.util.watchdog - INFO - Running initial scan on watched folder...

2020-10-29 00:23:00,798 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue

2020-10-29 00:23:00,809 - octoprint.server.util.watchdog - INFO - ... initial scan done.

2020-10-29 00:23:00,839 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on raspberrypi for SSDP

I'm assuming it's supposed to be running, but when I go to 127.0.0.1:5000 or http://raspberrypi:5000/ the browser just keeps loading forever and nothing happens.

Updated 2020-11-03 to use Python 3 instead of 2 for installation.

3 Likes

shouldn't this be
python3 -m venv venv
to properly use python 3 instead of defaulting back to python 2?

You are right, I thought I'd added the --python=python3 to it, but yes by default that will create the venv using Py2. Will have to test it later today, to make sure there are no extra dependency steps etc.

Post has been updated to address this issue, now uses venv

1 Like

Having done an absolute **** tonne of research and work on this, I finally got the correct info to get RPi_Cam_Web_Interface working with Octoprint :smiley:

Install settings for RPi_Cam_Web_Interface:

Cam subfolder: html
Autostart: yes
Server: nginx
Webport: 8080
User: Your username here
Password: your password here
jpglink: yes
php: 7.3

Webcam settings for Octoprint:

Stream url: http://your ip here/html/cam_pic_new.php
Snapshot url: http://your ip here/html/cam.jpg
Path to FFMPEG: /usr/bin/ffmpeg

The main benefit of this is being able to have security on the camera feed.

I've not actually done a build yet to test these (still building my printer) but if someone could test? Everything looks fine from Octoprint settings but the proof is in the pudding so to speak.

1 Like

So stumbled across this in a forum.
Alot cooler than i thought.

Wondering if anyones used it in ubuntu or on android os?

I have an older UDOO board i would like to apply to my workspace. Has lvds and camera support.

Ubuntu is easy, pretty much just substitute the user pi for whatever you setup on ubuntu. Can't commend on android OS.

Hi.
I've installed OctoPrint on Raspbian OS Desktop and all seems to work fine, but when I go to Pluguin manager says:

The pip command could not be found or does not work correctly for this installation of OctoPrint - please consult the log file for details and if necessary configure it manually. No installation and uninstallation of plugin packages is possible while pip is unavailable.

I've checked python2 and python3 and both have pip installed. Any idea?

PS: I want to say thanks who updated this installation guide.

1 Like