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

Don't forget to set your locale before starting a virtualenv, it's not set by default on some distributions... (I'm using a NanoPi Neo with FriendlyCore (base on UbuntuCore) Image File, Kernel: Linux-4.14)

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
1 Like

So I tried this on a xubuntu host and I managed to follow the instructions without too much hiccups. But I couldn't get the autostart scripts to work for the life of me (nor the octoprint, nor the mjpg-streamer worked). I tried poking around in them, adjusting them to my folder structure and username but they didn't work none the less. I type in "sudo service octoprint start" and it just echoes back to me something like "octoprint started" and then stops and doesn't do anything. Can somebody give me some recommendations where to look? Sorry if I didn't provide sufficient information I really don't know what else I could do to this to make it work.

What does 'stops' mean? It returns you to the shell? Or hangs? Generally that is the correct behavior, Octoprint is running in the background.

Sorry for not being clear, what I mean about "stops" is that it returns to the command prompt waiting for an input (I can see how that can be misunderstood). My first thought was also that it must run in the background but I tried loading the website and it either returned back with connection lost (if the page have been loaded before the server restarted) or just loaded for a long time. I might just have been a little impatient, will keep testing tomorow. Thanks a bunch for the help, it has cleared something up. If you have any other suggestions, please do share

Look for the logs. Also run this:

ps waxu | grep octoprint

and post the output.

at startup

avahi      368  0.0  0.2   6160  2956 ?        Ss   07:47   0:00 avahi-daemon: running [octoprint.local]
root       887  0.0  0.3   8920  3568 ?        S    07:47   0:00 /bin/bash /home/octoprint/scripts/webcamDaemon
octopri+  1407  0.0  0.0   8084   788 pts/0    S+   07:49   0:00 grep --color=auto octoprint

after manualy running the script

avahi      368  0.0  0.2   6160  2956 ?        Ss   07:47   0:00 avahi-daemon: running [octoprint.local]
root       887  0.0  0.3   8920  3568 ?        S    07:47   0:00 /bin/bash /home/octoprint/scripts/webcamDaemon
octopri+  1429  2.6  3.1 119984 31712 ?        Sl   07:50   0:01 mousepad /home/octoprint/Desktop/out
octopri+  1472  0.0  0.0   8084   796 pts/0    S+   07:51   0:00 grep --color=auto octoprint

after manualy running the server

avahi      368  0.0  0.2   6160  2956 ?        Ss   07:47   0:00 avahi-daemon: running [octoprint.local]
root       887  0.0  0.3   8920  3568 ?        S    07:47   0:00 /bin/bash /home/octoprint/scripts/webcamDaemon
octopri+  1429  1.1  3.1 119984 31712 ?        Sl   07:50   0:01 mousepad /home/octoprint/Desktop/out
octopri+  1520 14.8  4.3 208168 44348 pts/0    Sl+  07:52   0:05 /home/octoprint/OctoPrint/venv/bin/python2 ./octoprint
octopri+  1698  0.0  0.0   8084   820 pts/1    S+   07:52   0:00 grep --color=auto octoprint

It appears to be running in the third case.

It is. And that's because I started it myself and posted it for comparison's sake. Still the problem remains. After running sudo service octoprint status it get's back with a warning for fake startup-deamon could that be the problem?

EDIT: running mv /sbin/start-stop-daemon.REAL /sbin/start-stop-daemon a solution found online for the above mentioned warning message, looks like it fixed the problem. Posted the solution here for people having the same problem

It is. And that's because I started it myself and posted it for comparison's sake. Still the problem remains

I seem to have the same problem. I see you found a solution online, but any reasons as to why it works?

UPDATE: I think I figured out the issue (I'm assuming @Bence_Voros was also setting up octo on a non raspberry pi computer). If you're not using a pi you need to change the username pi to whatever your username is in the /etc/default/octoprint (there should be two places you need to change it)

The nginx webcam location configuration requires proxy_buffering set to off, otherwise it will load forever.

        location /webcam/ {
                proxy_pass http://192.168.0.11:8080/;
                proxy_buffering off;
        }
1 Like

The steps worked flawlessly setting up a Pi 4 (1GB). I replaced my Zero W which worked despite discouragement everywhere and... wow, the Pi 4 is so much faster.
I used the backup/restore plugin which also worked great.
Many thanks for such great software!

3 Likes

Thanks for posting this guide.... I know just enough to be dangerous and a little surprised I got it all to work.... Thanks again

1 Like

Note that if you're using another shell (I'm using fish), this line will not work - you'll need to switch to bash or source a different file. Luckily, an activate.fish is also included, so I could just source that instead.

This install guide worked well on a Pine 64 and the Armbian Buster server image.

Andy

2 Likes

I installed this on a RPi4 with no issues starting from "2019-07-10-raspbian-buster-full.img" as I have an 7" LCD attached. My question is I installed TouchUI and boot directly into the epiphany browser as per the instruction but when I exit the browser I just get a black screen. Is there anyway to get it to go back to the default GUI?

It may be necessary to change what the display sees:

Ctrl-Shift-F1 through F7 or F8 to the best of my knowledge will select the different ones. The X11 screens start at F7 and all before that are tty.

1 Like

Just ran through these steps on a shiny new Raspberry Pi 4 (4Gb) and everything seems to be up and running. I think the only trouble I had was when I accidentally skipped over steps, or things didn't save correctly because I didn't sudo first.

Hello. Completely new to the Raspberry Pi platform, but have been doing Arduino for years. I want to run OctoPrint on a 3B+ running regular Raspian so I can also run Pi-Hole and who knows what else simultaneously. I print a lot and have no qualms about leaving it on. Of course, I do want the webcam to keep an eye on things remotely. Would this guide be appropriate for me?

Note that PiHole is known to block the software update process within OctoPrint. Personally, I wouldn't put non-related things also on this Pi since the quality of print jobs is what you're after, IMHO.

For me, I'd rather just buy more Pi computers and dedicate those to these other tasks.

2 Likes