Device Reports Readiness To Read But Returned No Data (Multiple Access On Port?)

What is the problem

Print failed about half way through, however, it only failed once I used a webcam. I ran Octoprint without the webcam and it worked perfectly. Still plugged in, just not operational. As soon as I used the Octolapse plugin, the print failed unexpectedly. The webcam remained operational the entire time, however, it disconnected from the printer and did not reconnect. Somehow, the webcam was uninterrupted. After Checking The logs the keyword that caught my eye was "multiple access on port". Would this cause an issue? As The Zero 2 W only has one access port, I thought using a USB HUB 2.0 would alleviate this issue, maybe I was wrong?

What did you already try to solve it?

I have not tried anything to solve this as I really do not know where to begin. The print was running fine all night until a random occurrence happened. I would also like to note, this is the first time I uploaded the G-code through Octoprint instead of through CURA to Octoprint.

Have you tried running in safe mode?

No, from my research, running in safe mode disables all plugins which I would suspect to cause issues running Octolapse in general.

Did running in safe mode solve the problem?

Not Applicable. Read Above

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)

octoprint-systeminfo-20231219141919.zip (1.7 MB)

Additional information about your setup

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

OctoPrint Version 1.9.3
3D Printer: Ender 3 S1 Pro, Enclosed, 40 C, CURA Slicer
3D Printer Firmware: Stock firmware from Creality which came with printer
Browser: Google Chrome
Operating System: Windows

CURRENT SETUP

Raspberry Pi Zero 2W
-5V Power Supply Directly To Pi (Same Extension Cord Feeding Printer & Pi) - Printer Remained Intact
(NO Reboot)
-Data Transfer Micro USB to USB HUB 2.0

USB HUB 2.0 (Designed For Data Transfer)
-Directly Feeds Logitech C920 Webcam via USB A
-Directly Feeds To Printer USB TYPE C

Hello @brandon1213 !

That is not quite right. safe mode only disables 3rd party plugins. Not those that are bundled with OctoPrint.

1 Like

Depending on the resolution and framerate that you are running the camera at, it could be that the USB hub you're using is struggling to keep up. I'd try reducing those first. If you still can't fix it, perhaps a new USB hub that might help. After that, you are up against the limit of the Pi Zero 2 - webcams test the limits of some USB chips quite easily.

1 Like

Thank you so much for the reply! I will try a shotgun approach by running in safe mode and lowering the resolution! If neither works, I will try a new USB HUB 2.0! I will keep you posted! Again, thanks for the reply!

Thank you for the suggestion! I am going to try and couple your idea with running in safe mode! Instead of 1920x1080 I will try and drop this down to 1080x720 while running in safe mode. If this option is not successful, I will try a new data transfer hub. Do you have any recommendations? Does it still have to be 2.0 or can this be 3.0?

I don't personally use any USB hubs, so I can't make a recommendation in good faith. I believe the USB port on the zero 2 is USB 2 spec, so a USB 3 hub will be capped by that.

Running In safe mode is not possible while using the OctoLapse (Not Just Timelapse) plugin so I did not use safe mode. I changed the resolution to 1280x720 and changed the fps from 20 to 10. I made one fully successful print. A couple of hours later, the print failed again. This print was larger (but less complicated and failed shortly into the print (just over an hour). Do you think I should change to a different pi with multiple ports or just try and change the USB HUB? I will attach the new log.
octoprint-systeminfo-20231220203541.zip (1.0 MB)

Running in safe mode is not possible when using the OctoLapse Plugin as this is considered 3rd party. Thanks for the reply though!

OctoLapse has nothing to do with the connection between OctoPrint and the Printer.

The RPi Zero 2W only has 512MB of memory and this could be the cause of the failure. You can monitor memory usage with top in an SSH terminal or use free -m to get a current snapshot.

The first thing I'd try is increasing the size of the swap space, https://forums.raspberrypi.com/viewtopic.php?t=46472. The existing swap space is probably very small (100MB on my RPi 3B). I'd suggest increasing the size to 512MB on your Zero 2W.

The RPi 3B (and 3B+) have 1GB of memory and they seem to run OctoLapse without issue. If you can't get the Zero 2W to work, then you don't need to get carried away with a maximum memory RPi 4 or 5.

We don't know for definite that it's the USB overloading that is causing the disconnects - so yes keep experimenting. For the sake of troubleshooting, you should be willing to go nuclear and strip everything down to bare bones to try and find the root cause.

I'd say that this includes disconnecting your camera completely, and trying safe mode to rule as much as possible out.

Maybe there is some misinformation on my end, however, when I restart my instance of octoprint in safe mode, octolapse is no longer available. I downloaded octolapse as a plugin. Can you help me identify the diconnect between what you and/or I am saying?

Sorry for the clarity issue. I do appreciate your support more than you know! When running octoprint in safe made, I have zero issues. Prints are wonderful. Webcam works perfectly (in safe mode). The issue arises when I start octoprint outside of safe mode and run octolapse. Maybe the plugin is the issue? I can try and uninstall and start with a fresh install of octolapse? If the issue persists, maybe a new image of pi?

Wow! Great information, I will tackle this tomorrow and let you know what I find! Super informative help! I will keep you posted!

I thought I'd chip in & say that I use a powered USB3 hub with the Zero2W. The webcam (Logitech) is plugged into the hub as is the printer (Creality) & it's been very good, no problems. I upload all my prints from Prusaslicer to Octoprint with the upload & print button. I've not tried time lapse yet, but now I will.

I have recently run into a similar issue, I added some extra plugins to my octoprint (Octolapse as well), I am using and orange PI zero 3 (1,5 Gb). I read this OctoPrint randomly loses connection to the printer with a "SerialException" , and it turns out I have not only added pluggings but extra noice with some devices conected to the same hub as my OPi. the solution was to isolate the Orange Pi with its own stable energy supply, and only leave connected to the hub the printer and the camera. Also remember to tape the 5V pin from the printer USB cable. Put tape on the 5V pin - Why and how

1 Like

Pi zero 2W is not the most powerful, but it can get the job done. Log into your pi with SSH Terminal. If need be, reply back and I can walk you through it. Most operating systems are designed to have multiple programs running and stopping, So the OS can handle multiple things that will vary. Since this is a dedicated device let's prioritize it just for 3d printing with a camera.
At your command prompt type in the following:

sudo renice -20 -p $(pgrep 'systemd')
This will set your system process to the highest priority. Everything will run faster.

sudo renice -5 -p $(pgrep 'octoprint')
This will give octoprint a higher priority to keep constant communication going. Lagging causes errors.

sudo renice -10 -p $(pgrep 'camera-streamer')
This gives your camera a high priority. Make sure you are using reasonable sizes and refresh rate.
(Default is good).

The default priorities for all programs is 0. -20 is the highest. 20 is the lowest. These are just the settings I use on mine (pi 3 w/dual cameras). A few comments were made about memory. these are good points. The OS has memory management processes to keep up with and if it's not fast enough cleaning memory, boom. OS don't have time to do it's housekeeping, boom.

Play with these numbers for each and see what works for your system. You can make changes while printing. You might mess things up. Be patient and DO NOT set everything to -20. If your camera is dropping frames and/or freezing, make it a little higher (closer to -20) or change camera settings.

When you find good numbers in your terminal type the following:

sudo nano /etc/rc.local
(enter your password)

use the arrow keys, go all the way to the bottom, and BEFORE the 'exit 0' and after the last 'Echo", type in your settings. ie;

echo

sudo renice -5 -p (pgrep 'octoprint') sudo renice -10 -p (pgrep 'camera-streamer')
sudo renice -20 -p $(pgrep 'systemd')

exit 0

This will run them on startup so you don't have to type them in over again.

Good luck,
-JC

Sorry the last reply got corrupted....

sudo renice -5 -p $(pgrep 'octoprint')

sudo renice -10 -p $(pgrep 'camera-streamer')

sudo renice -20 -p $(pgrep 'systemd')

when done, hit (CTRL - x), hit 'Y" for yes to write buffer, then hit {enter} for the filename.

-JC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.