Cannot start Octoprint automatically

Hello everyone.

one month ago i bought my first 3d printer, and already had a lot of fun with it. Now i want to try controlling it from an raspberry pi4, so ik have raspbian with octoprint installed, according foosels guide.

until i reached this step:

You should then be able to start the OctoPrint server:

pi@raspberrypi ~ $ ~/OctoPrint/venv/bin/octoprint serve
 * Running on

When i type that command, the terminal returns: No such file or directory.
So I looked with the file browser in the bin folder, and indeed there is not such a file, also not hidden.

but the strange thing is, i am able to start octoprint in this way:

cd OctoPrint
cd venv
cd bin
octoprint serve

This method works fine, octoprint starts, and i can connect using the browser.
I can connect to printer, control it, and upload and print gcode files.

So i thought, octoprint is working fine, so i continued to the automatic startup section in the guide.
Followed every step, deleted the # in front of deamon, but i cannot get it to work.

I cannot start octoprint with:

sudo service octoprint start

And also, octoprint does not start automatically.

The first problem didn't really bother me, because octoprint worked fine.
But when the autostart didn't work, i started to think these two problems are related to eachother.

I already checked to logfile, cut the moment the autostart should occur, there is nothing in the logfile. I started the pi this moring around 7:30am. At 8:43am i started it manualy, which is in the logfile attached.
octoprint.log (37.6 KB)

Is there any one who can help me with this problem?

You say the doublequoted stuff above didn't work. I assume those two lines are from the intruction manual, as it shows that it is running correctly.

So, what exact command did you type? Copy and paste the exact command you typed and the exact error you got.

You say you can't start it like that, what error(s) do you get? Again, copy and paste the exact command and errors.

After doing this sudo service command above, immediately run and save the output from tail /var/log/daemon.log.

tedder42, thanks for your reply.

I copied that from the manual indeed.

I did the command again, and also tried to start the service and tail log command.

Here is the screenshot with my commands and the responses:

for fun, show the output from this:
ls -l ~/OctoPrint/venv/bin/

Please copy text rather than giving a screenshot.

1 Like

Here is the reply:

pi@RPI3D:~ $ ls -l ~/OctoPrint/venv/bin/
total 2960
-rw-r--r-- 1 pi pi    2082 Jan  3 17:31 activate
-rw-r--r-- 1 pi pi    1024 Jan  3 17:31 activate.csh
-rw-r--r-- 1 pi pi    2178 Jan  3 17:31
-rw-r--r-- 1 pi pi    1137 Jan  3 17:31
-rwxr-xr-x 1 pi pi     252 Jan  3 17:31 easy_install
-rwxr-xr-x 1 pi pi     252 Jan  3 17:31 easy_install-2.7
-rwxr-xr-x 1 pi pi     239 Jan  3 17:31 pip
-rwxr-xr-x 1 pi pi     239 Jan  3 17:31 pip2
-rwxr-xr-x 1 pi pi     239 Jan  3 17:31 pip2.7
lrwxrwxrwx 1 pi pi       7 Jan  3 17:31 python -> python2
-rwxr-xr-x 1 pi pi 2984816 Jan  3 17:31 python2
lrwxrwxrwx 1 pi pi       7 Jan  3 17:31 python2.7 -> python2
-rwxr-xr-x 1 pi pi    2341 Jan  3 17:31 python-config
-rwxr-xr-x 1 pi pi     230 Jan  3 17:31 wheel
pi@RPI3D:~ $ 

Very weird that there is no file named octoprint, but i still can start octoprint like this:

pi@RPI3D:~ $ cd ~/OctoPrint/venv/bin
pi@RPI3D:~/OctoPrint/venv/bin $ octoprint
Starting the server via "octoprint" is deprecated, please use "octoprint serve" from now on.
2020-01-04 18:35:22,860 - octoprint.startup - INFO - ******************************************************************************
2020-01-04 18:35:22,862 - octoprint.startup - INFO - Starting OctoPrint 1.3.12
2020-01-04 18:35:22,862 - octoprint.startup - INFO - ******************************************************************************

When i do octoprint serve it starts also:

pi@RPI3D:~/OctoPrint/venv/bin $ octoprint serve
2020-01-04 18:36:29,318 - octoprint.startup - INFO - ******************************************************************************
2020-01-04 18:36:29,319 - octoprint.startup - INFO - Starting OctoPrint 1.3.12
2020-01-04 18:36:29,320 - octoprint.startup - INFO - ******************************************************************************

Wait a minute.

Why not use octopi distro? It's muuuuch easier. I just realized you aren't doing that.

Well, i have 4 raspberry pi's running in my house as home automation, and they all run codesys software on raspbian. So that why i wanted raspbian, because i dont know anything about octopi. If an application run on raspbian, wil it also work on octopi?

Yeah, roughly speaking, they're the same thing. It's just a lot more user-friendly because you won't get stuck in these types of oddities.

Okay will try optopi today.

One more thing you can try:
which octoprint
this tells you which binary it runs. It sounds like you installed it in another directory and that directory is in the global path. If you give an absolute path (/path/to/binary) it'll only run exactly this one.

When you switched the path you're not running the octoprint from the local path at all - you would need to run it with ./octoprint serve (the ./ marking that you want to run the binary in the current path.

I support @tedder42 s recommendation of running octopi - it's a raspbian with all the dirty work already done. Although I have to admit I don't own a Pi4 and can't say how it works there ...


1 Like

just installed octopi in another sd card, works perfectly. Later this week i will try to install the software for my home automation and see if that works as well.

@bahmrockk, I will try your suggestion.

For as far as i can see at this point, octopi/octoprint works without any problems on pi4.