Octoprint + Octodash system losing communication after time - printing continuing

### What is the problem?

Octoprint and octodash are no longer accessible after about 10 minutes of printing whilst the print is continuing and successfully complete!

It seems to come from the serial communication as my setup is auto/115200 but before crashing communication is displayed as auto/auto

I managed for weeks before installing octodash or octoscreen to print with octopi with no issue

From what I understand: Octodash or Octoscreen are sending API request to Octoprint and the Nb of thread is continuously growing up to reaching 31 (which seems to be the limit for my system).

I don't see any error in the log

What did you already try to solve it?

The same issue occured with Octoscreen and I replaced Octoscreen with octodash with exactly the same problem

Have you tried running in safe mode?

Yes

Did running in safe mode solve the problem?

No

Complete Logs

Log are attached

Additional information about your setup

Raspberry PI4 4Go + PI official Touch screen 7''
CR10S Pro V2 - MArlin firmware - 1.70.0
Raspberry Cam PI NoIR
Wifi ng connection
DHCP connection with lease of 24 hours

octoprint.log
octoprint.log (83.1 KB)

Top
top - 10:26:23 up 3:53, 2 users, load average: 2,07, 2,11, 2,15
Tasks: 130 total, 1 running, 129 sleeping, 0 stopped, 0 zombie
%Cpu(s): 5,2 us, 1,0 sy, 0,0 ni, 93,8 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st
MiB Mem : 3776,9 total, 3186,8 free, 229,3 used, 360,9 buff/cache
MiB Swap: 100,0 total, 100,0 free, 0,0 used. 3407,4 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
393 pi 20 0 326388 59208 9860 S 4,7 1,5 9:46.61 octoprint
832 pi 20 0 329712 116888 70528 S 4,0 3,0 8:28.54 octodash
844 pi 20 0 210356 44988 34796 S 4,0 1,2 6:58.80 octodash
731 pi 20 0 567792 119448 80932 S 0,7 3,1 2:37.49 octodash
654 haproxy 20 0 16188 10992 4952 S 0,3 0,3 0:09.75 haproxy
703 root 20 0 193248 38736 27896 S 0,3 1,0 0:44.93 Xorg
814 pi 20 0 202856 42972 36988 S 0,3 1,1 1:47.92 octodash
1589 pi 20 0 10192 2776 2416 R 0,3 0,1 0:01.13 top
1 root 20 0 33780 8284 6572 S 0,0 0,2 0:04.52 systemd
2 root 20 0 0 0 0 S 0,0 0,0 0:00.01 kthreadd
3 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 rcu_par_gp
8 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 mm_percpu+
9 root 20 0 0 0 0 S 0,0 0,0 0:01.09 ksoftirqd+
10 root 20 0 0 0 0 I 0,0 0,0 0:03.18 rcu_sched
11 root rt 0 0 0 0 S 0,0 0,0 0:00.01 migration+
12 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/0

octoprint server message

The OctoPrint server is currently not running

If you just started up your Raspberry Pi, please wait a couple of seconds, then try to refresh this page.

If the issue persists, please log into your Raspberry Pi via SSH and check the following:

  • Verify that the process is running: ps -ef | grep -i octoprint | grep -i python should show a python process:

pi@octopi:~ $ ps -ef | grep -i octoprint | grep -i python
pi 1441 1 6 11:12 ? 00:00:15 /home/pi/oprint/bin/python
/home/pi/oprint/bin/octoprint --host=127.0.0.1 --port=5000

  • If it isn't, the question is why. Take a look into ~/.octoprint/logs/octoprint.log , there might be an error logged in there that helps to determine what's wrong.
  • You might also want to try if you can restart the server (if no obvious error is visible): sudo service octoprint restart .

If all that doesn't help to trouble shoot the issue, you can seek support on the OctoPrint Community Forum. Please provide your OctoPi and OctoPrint versions as well as your octoprint.log and explain what you already tried and observed as detailed as possible.

List of threads
pi@peshawar:~/.pki $ while true; do { date && ps hH -p 393 | wc -l && sleep 10; } done
mardi 15 décembre 2020, 10:27:51 (UTC+0100)
31

These two sentences don't make sense together, unless you are printing from SD (which according to your log you are not).

If you are not printing from SD, OctoPrint streams your print to the printer. If the print completes successfully, that means there's nothing wrong with the serial connection or communication, as the print would be the first thing to fail. I think we can rule out your serial communication here and concentrate on other things.

What happens when it is in this state and you try to do a curl http://localhost:5000?

Hi @foosel,

I might found solution to catch these errors. I'm preety shure it's about Pi firmware network driver in certain configurations, and found temporary solution.

I was expecting disconnecing my whole Pi4 (4 GB) instance over WiFi. Prints were successfull, but there was no possibility to connect over ssh after few minutes.
I have static IP over MAC set up on my Archer6 router. After router restart, Pi4 didn't even established connection to router.

Temporary solution:

  1. Change your Pi WiFi configuration from 5 GHz frequency, to regular 2,4 Ghz frequency
  2. in terminal issue sudo rpi-update

It fixed all my issues regarding disconnecting over my WiFi.

I found multiple errors in syslog, regarding ethernet driver. Maybe you can establish this config and confirm that bug is related to Pi itself, rather than Octoprint.
Please stay to 5G WiFi network and issue heavy network load, like getting FullHD stream from two separate devices.

If Pi disconnects from network, restart it and run:

cat /var/log/syslog | grep 'failed w/status'

Hi,

I have shutdown Octodash and started a print - the issue has reappeared - so definitely not related to the octodash system. The curl command doesn't bring any result. I realise that I forgot to mention that I am using Octoprint 1.5.2 and octopi 0.18.0.

The suggested cat command doesn't return any results.

I am printing a 59.8Mb G Code file. It seems that the issue is linked to gcode file size. but I don't see any memory leak nor over usage of CPU. Actually, I have very low ressource usage. Printing is still continuing as if nothing has happened.

Hi @foosel,

Any idea print still running smooth

Make sure, that your Octoprint has static IP.
In Octoprint:

  1. Go to Settings -> Webcam & Timelapse
  2. Change /webcam/?action=stream to http://yourStaticIP/webcam/?action=stream
  3. Test snapshot

That solved all my problems with disconnecting Pi4 from my network and beeing unavalaible to connect again.

Please give it a try and tell me if this solution works for you as well.