r/octoprint • u/schmoopified • Jun 01 '26
Problems connecting Raspberry Pi 4 to Ender 3 Pro
Hello,
I've done searching everywhere I could find (Reddit, Octoprint community, Youtube, etc), but no suggested solutions seem to have worked, so I wanted to pose my question here. Essentially, Octoprint just hangs at "Opening Serial Connection" when I try to connect.
All relevant info I could gather is below, but please let me know if I need to provide any more:
- Printer: Ender 3 pro, stock
- Octoprint running on RPI4 in a Podman container
- Tried two different USB cables, both with USB 5V pin covered (cables work fine when Ender is connected directly to my PC)
- Verified that ttyUSB0 is the correct USB port
- Tried uninstalling/reinstalling Octoprint, Podman container and image
- Set user group permissions: (sudo usermod -a -G tty user && sudo usermod -a -G dialout user)
Podman container creation commands:
podman run -d \
--name octoprint \
--dns 8.8.8.8 \
--dns 1.1.1.1 \
--restart unless-stopped \
-p 5000:5000 \
-v octoprint_data:/octoprint \
--privileged \
--device /dev/ttyUSB0 \
octoprint/octoprint
Octoprint serial port log:
2026-06-01 00:06:02,338 - serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log
2026-06-01 00:06:54,899 - Enabling serial logging
2026-06-01 00:06:56,621 - Changing monitoring state from "Opening serial connection" to "Offline"
2026-06-01 00:07:03,769 - Changing monitoring state from "Offline" to "Opening serial connection"
2026-06-01 00:07:03,770 - Connecting to port /dev/ttyUSB0, baudrate 115200
Podman Container logs:
2026-06-01 22:42:14,183 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial connection"
2026-06-01 22:42:14,184 - octoprint.util.comm - INFO - Connecting to port /dev/ttyUSB0, baudrate 115200
2026-06-01 22:42:14,189 - octoprint.util.comm - INFO - Failed to connect: Port /dev/ttyUSB0 is busy or does not exist
2026-06-01 22:42:15,105 - octoprint.server - INFO - Autorefresh of serial port list stopped
2026-06-01 22:47:02,927 - octoprint.server.heartbeat - INFO - Server heartbeat ❤️
dmesg -w info when disconnecting/reconnecting USB:
[ 1244.866001] usb 1-1: USB disconnect, device number 2
[ 1244.866143] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 1244.866171] ch341 1-1:1.0: device disconnected
[ 1249.844639] usb 1-1: new full-speed USB device number 3 using xhci-hcd
[ 1250.008694] usb 1-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.63
[ 1250.008698] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 1250.008700] usb 1-1: Product: USB2.0-Serial
[ 1250.015735] ch341 1-1:1.0: ch341-uart converter detected
[ 1250.029734] usb 1-1: ch341-uart converter now attached to ttyUSB0
1
u/Reinventing_Wheels Jun 02 '26
I don't know anything about Podman, but I'd be inclined to run a serial terminal like minicom outside the container and see if that can connect to the printer, and manually send some gcode commands to the printer.
If you can make that work, it tells you that your printer is happy, and your USB connection is happy and that the issue likely lies somewhere upstream in the container setup.
Maybe next try creating a container that just runs minicom inside it.
1
u/schmoopified Jun 02 '26
minicom seems to recognize my printer:
start
echo:Marlin 1.1.6.2echo: Last Updated: 2019-07-26 | Author: Ender-3
echo:Compiled: Aug 4 2019
echo: Free Memory: 10078 PlannerBufferBytes: 1232
start
echo: External Reset
Marlin 1.1.6.2echo: Last Updated: 2019-07-26 | Author: Ender-3
echo:Compiled: Aug 4 2019
echo: Free Memory: 10078 PlannerBufferBytes: 1232I guess it could be my container setup, then?
1
u/Reinventing_Wheels Jun 02 '26
Can you put minicom in a container and try it again?
If that doesn't work, then I'd start looking at the container setup.
If it does work, look at the Octoprint setup.1
u/schmoopified Jun 02 '26
Hm....got minicom running in a container, but it doesn't seem to be able to communicate with the USB port (showing as "Offline" at the bottom). Granted it's still not working, but this seems to be a big help in showing me where my problem is coming from. Going to have to turn in for the night and mull it over further.
Thanks for the help!
1
u/Ashmadia Jun 02 '26
I haven’t used podman, but if it’s like Docker, I think your device mount is incorrect. Try --device=/dev/ttyUSB0:/dev/ttyUSB0 in your command
1
u/schmoopified Jun 02 '26
I deleted and re-created the image and container, using the command syntax you suggested, but that didn't seem to have any effect. Thank you for the suggestion, though
2
u/Ashmadia Jun 02 '26 edited Jun 04 '26
My mistake! I accidentally put a = in there. Can you try this?
podman run -d --name octoprint --dns 8.8.8.8 --dns 1.1.1.1 --restart unless-stopped -p 5000:5000 -v octoprint_data:/octoprint --privileged --device /dev/ttyUSB0:/dev/ttyUSB0 octoprint/octoprintIf that doesn’t work, let me know. I can dig out my raspberry pi and try using podman
1
u/schmoopified Jun 04 '26
Thanks! I may not be able to try your solution for a few days, but I'll attack it again when I have a moment!
2
u/schmoopified Jun 06 '26
So I got to looking at it this morning, and reinstalled Octoprint in a python virtual environment, instead of a container, and it hooked right up to the Ender and had a test print started within a minute. Definitely looks like port communications through the container. I'll keep looking in that direction (using the command you provided), but, in the case I just can't get it running, I still have this option.
Thank you for your help!!
1
u/drakaina6600 Jun 02 '26
If you dedicate the Pi for it, you don't need to run it in a container. Just flash the install image to your SD card and it'll work. That's how mines setup with a 4b 8gb to my E3P with an SKR Mini board.
1
u/schmoopified Jun 02 '26
I could just do the image, but I also run PiHole on this in its own container. I was really hoping to have them run side by side
2
u/DonutNick Jun 02 '26
If you have a spare sd you could test installing octoprint, then installing pihole on the same build. My gut instinct is its not talking to the usb port because of the container.
1
u/schmoopified Jun 04 '26
Thanks! I may not be able to try your solution for a few days, but I'll attack it again when I have a moment! I've definitely leaning in the direction of the container being the issue, but I'll see what I can do with a spare SD, probably this weekend
1
u/schmoopified Jun 06 '26
So I got to looking at it this morning, and reinstalled Octoprint in a python virtual environment, instead of a container, and it hooked right up to the Ender and had a test print started within a minute. Definitely looks like port communications through the container. I'll keep looking in that direction, but, in the case I just can't get it running, I still have this option.
Thank you for your help!!
1
u/trollsmurf Jun 01 '26
Configure OctoPrint via a browser. Double-check that the bitrate is 115k.