Octopi/print fails to update web page during print - then crashes after print complete

What is the problem?

Octoprint/pi fails to update webpage information, including gcode viewer, temperature, webcam and terminal. However the print continues (thankfully). Refreshing the page doesn't work as the server is not responding.

What did you already try to solve it?

Refresh page, look at different tabs. Hard to do much during a print.

Have you tried running in safe mode?

No

Did running in safe mode solve the problem?

No

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
System bundle is in my Arducam 64MP post. Octoprint has crashed at the moment.

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

MacOS Sonoma 14.3, Octoprint 1.9.3, Octopi 1.0.0 build 2023.10.09.154319 with camera-streamer.

Octoprint locked up while trying to get a SystemInfo Bundle just after finishing the print. Have to hard reboot it. Cannot ping the RPI, cannot ssh in. Hard fail. I'm actually disappointed in this version, it's buggy. This is not the first time the server has failed to respond. But this is the first time the server failed to respond during a print.

Here's the system bundle. Had to power cycle the RPI4.
octoprint-systeminfo-20240201183725.zip (40.9 KB)

Good to hear you got the webcam working.

If you can't ping the RPi, and you can't SSH - these are outside of OctoPrint. If you can't access it via the network via ping or SSH, then you won't be able to access OctoPrint but it might not be that OctoPrint has crashed.

I think that you have a network connection issue with the Pi. So it looks like OctoPrint has 'crashed' or become 'unresponsive', but actually it is just a connection issue outside of OctoPrint's control. The print continued - this shows OctoPrint has not crashed.

Why? In your log, just before the power is pulled, OctoPrint detects that it has lost internet connectivity:

2024-02-01 17:36:47,114 - octoprint.util.connectivity.connectivity_checker - INFO - Connectivity changed from online to offline
2024-02-01 17:36:47,115 - octoprint.util.connectivity.connectivity_checker - INFO - Connecting to 192.168.40.119:53 is not working
2024-02-01 17:36:47,115 - octoprint.util.connectivity.connectivity_checker - INFO - Resolving octoprint.org is not working

It also looks like you've changed the connectivity check to a local IP - this is not particularly useful for checking internet connection, as it just checks a local DNS that it looks like you have. If you are running your own DNS, then either it or the Pi's connection to it died.

This could be a weak wifi signal for example. The Raspberry Pi 4 had a ton of issues with the wifi drivers dropping out all the time in the past, and while these are less common now it still happens. You have to go trawling through the system logs to try and work out if that is the case, or access the Pi offline (eg. HDMI cable & keyboard) to try and poke the underlying drivers in a disconnect situation.

Ethernet is always more stable than wifi.

Thanks for the read on that. Interesting that my Pi3B+ never had these issues, running Octopi while on WiFi. The local IP is my Pi-hole ad blocker. I point all my network traffic there. Pi-hole didn't die. It's on Ethernet tied to the router via a network switch. I would have noticed if Pi-hole went down, as well as my wife. Anyways, my router is set up to use Pi-hole for DNS blocking, so all network traffic for DNS requests goes through it. Frankly, it doesn't matter if I lose internet connectivity while printing, but I do care if I lose the local network while printing. But, for some reason Octopi dropped off the network, and it couldn't recover. But me just being 6 feet away, on my computer, did have connectivity and could access pihole, and the internet. I wrote the original ticket about 1 minute after the print finished. And Octoprint was unreachable at that time.

Yes, a wired connection is always better, but this is not possible unless I move the printer and myself elsewhere. Can't be running cords on the floor permanently, across hallways, etc. The perfect situation for wireless seems to be an open room with no walls. But if you had that, you could run cables along the walls and connect everything up. I live in an older house, with rooms and walls and stairways, etc. It was built in 1853, long before WiFi or Ethernet was a glimmer in anyone's eye. Definitely not new construction with CAT6 in the walls, like what my daughter has.

Not sure what to do about this. It's not a good situation to have Octoprint unreachable, since it basically erases the value of Octoprint in my mind. I've used Octoprint for a couple years, without much trouble, so this is puzzling. I've had pihole for even longer.

The Pi 4 has far more issues with it's WiFi drivers & chipsets than any of the other Pi models have done in the past. No numbers & specific, but a general sense that these issues crop up with Pi 4s but not 3B etc. It was far worse earlier on in it's lifecycle, some of the large issues were patched.

There's a plugin that can check for the connectivity issue and kick the WiFi driver to try and bring it back to life - many people have said this works Network Health

A similar thing is also built in to OctoPi, and can be enabled with the switch at the bottom of /boot/octopi.txt configuration file.

You need to disable WiFi power save on the Pi4. Add 1 line to the /etc/rc.local file right before the exit 0 line

iwconfig wlan0 power off

That is awesome. I'll try that.

I had that very same problem in a laptop with power saving on wifi. Stuttering and everything. Poor responses. Changing the WiFi power save fixed that problem.

Killing WiFi power save, does indeed help, some. I find that if I open a browser that has Octoprint in a tab, it will allow navigation to other tabs, but it is not communicating with Octoprint - the terminal shows no activity. Sometimes the webstream is active.

However, (so far anyways) it seems a refresh of the webpage shows OctoPrint is active and receiving printer status messages. If this is the case, I'd think it would be good to have the option of no wifi power save in OctoPi. The RPI was dropping off the network and not regaining access, or was having extremely low throughput.

For what it is worth, nearly every RPI, at least from Pi2, has had this kind of network problem. I have a Pi2 based sprinkler controller on a wifi dongle, and it becomes unreachable sporadically during the year. Think I will try a similar thing on that controller as well. Yes, it should be hard wired, but it's in a terrible place to get ethernet. It would be about 16 hours of labor, and awful dirty work. My 170 YRO house is not really amenable to ethernet.

did you end up finding a solution? I'm getting the same issue where the web interface will become unresponsive, or crash during/ after print and I'm hardwired to my pi 4.

Disabling wifi power save did the trick, just like @5ft24 said. Haven't had problems since.

You need to disable WiFi power save on the Pi4. Add 1 line to the /etc/rc.local file right before the exit 0 line

iwconfig wlan0 power off

If the pi is running on Ethernet and not wifi, I would suspect power issues or a questionable SD card