paukstelis / octoprint_deploy

Bash script for rapid deployment of multiple octoprint instance on a single machine
MIT License
416 stars 40 forks source link

Octoprint not connecting to printer #101

Closed joelstitch closed 1 year ago

joelstitch commented 1 year ago

I have followed this guide on a Le Potato and a Raspberry Pi 4 with a Ender 3 and a Ender 3 Pro and wasn't able to connect Octoprint to the printers. When I add the instances and plugin the usb it doesn't detect the serial (which I believe it happens with Creality printers). When I try to connect I get the message:

No more candidates to test, and no working port/baudrate combination detected.

joelstitch commented 1 year ago

I just iinstalled Octopi on a new microsd. Ran it on the pi and followed the instructions to the T and no matter what I do non of the 2 printers connect. Even though the installation went smooth and it recognized both USB cables being plugged in. When I go to Octoprint on either of the printers and click Connect I just get a error "State: Offline after error No more candidates to test, and no working port/baudrate combination detected."

I am trying it on a Ender 3 and a Ender 3 Pro.

paukstelis commented 1 year ago

You can use the diagnostic tool from the utilities menu to output some useful information. Please share that. You should not need to set the connection to AUTO. If the printers are plugged in and were detected you should have /dev/octo_instancename entries available.

joelstitch commented 1 year ago

This is what I got from the Diagnostic tool. Also, I did not have them set to auto, I had them set to the /dev/instancename.

`octoprint_deploy diagnostic information. Please provide ALL output for support h elp


/etc/octoprint_deploy


octoexec: /home/pi/oprint/bin/octoprint octopip: /home/pi/oprint/bin/pip haproxy: true octopi: true streamer: camera-streamer


/etc/octoprint_instances


instance:octoprint port:5000 udev:true instance:ender3pro port:5001 udev:true cat: /etc/octoprint_cameras** /etc/octoprint_cameras


: No such file or directory


/etc/udev/rules.d/99-octoprint.rules


KERNELS=="1-1.5:1.0",SUBSYSTEM=="tty",SYMLINK+="octo_octoprint" KERNELS=="1-1.4:1.0",SUBSYSTEM=="tty",SYMLINK+="octo_ender3pro" lrwxrwxrwx 1 root root 7 Jul 23 12:55 /dev/octo_ender3pro -> ttyUSB0 lrwxrwxrwx 1 root root 7 Jul 23 12:55 /dev/octo_octoprint -> ttyUSB1 ls: cannot access '/dev/cam*': No such file or directory


● octoprint.service - The snappy web interface for your 3D printer Loaded: loaded (/etc/systemd/system/octoprint.service; enabled; vendor pres et: enabled) Active: active (running) since Sun 2023-07-23 12:55:11 CDT; 18min ago Main PID: 391 (octoprint) Tasks: 20 (limit: 1472) CPU: 53.021s CGroup: /system.slice/octoprint.service └─391 /home/pi/oprint/bin/python /home/pi/oprint/bin/octoprint serv e --host=127.0.0.1 --port=5000

Jul 23 13:02:15 octopi octoprint[391]: 2023-07-23 13:02:15,038 - octoprint.util. comm - INFO - Serial detection: Handshake attempt #2 with timeout 2.0s Jul 23 13:02:15 octopi octoprint[391]: 2023-07-23 13:02:15,043 - octoprint.util. comm - INFO - M110 detected, setting current line number to 0 Jul 23 13:02:18 octopi octoprint[391]: 2023-07-23 13:02:18,024 - octoprint.util. comm - INFO - Serial detection: Handshake attempt #3 with timeout 2.0s Jul 23 13:02:18 octopi octoprint[391]: 2023-07-23 13:02:18,030 - octoprint.util. comm - INFO - M110 detected, setting current line number to 0 Jul 23 13:02:20 octopi octoprint[391]: 2023-07-23 13:02:20,030 - octoprint.util. comm - INFO - Changing monitoring state from "Detecting serial connection" to "E rror" Jul 23 13:02:20 octopi octoprint[391]: 2023-07-23 13:02:20,076 - octoprint.util. comm - INFO - Changing monitoring state from "Error" to "Offline after error" Jul 23 13:02:20 octopi octoprint[391]: 2023-07-23 13:02:20,111 - octoprint.serve r - INFO - Starting autorefresh of serial port list Jul 23 13:02:20 octopi octoprint[391]: 2023-07-23 13:02:20,129 - octoprint.plugi ns.action_command_notification - INFO - Notifications cleared Jul 23 13:02:20 octopi octoprint[391]: 2023-07-23 13:02:20,146 - octoprint.serve r - INFO - Serial port list was updated, refreshing the port list in the fronten d Jul 23 13:02:20 octopi octoprint[391]: 2023-07-23 13:02:20,619 - octoprint.plugi ns.tracking - INFO - Sent tracking event commerror_autodetect, payload: {'commer ror_text': 'No more candidates to test, and no working port/baudrate combination detected.'} None None {'bitrate': '10000k', 'cleanTmpAfterDays': 7, 'defaultWebcam': 'classic', 'ffmpeg': None, 'ffmpegCommandline': '{ffmpeg} -framerate {fps} -i "{input}" -vcodec ' '{videocodec} -threads {threads} -b:v {bitrate} -f ' '{containerformat} -y {filters} "{output}"', 'ffmpegThreads': 1, 'ffmpegThumbnailCommandline': '{ffmpeg} -sseof -1 -i "{input}" -update 1 -q:v ' '0.7 "{output}"', 'ffmpegVideoCodec': 'libx264', 'snapshotWebcam': 'classic', 'timelapse': {'fps': 25, 'options': {'capturePostRoll': None, 'interval': None, 'retractionZHop': None}, 'postRoll': 0, 'type': 'off'}, 'timelapseEnabled': True, 'watermark': True, 'webcamEnabled': True}


● ender3pro.service - The snappy web interface for your 3D printer Loaded: loaded (/etc/systemd/system/ender3pro.service; enabled; vendor pres et: enabled) Active: active (running) since Sun 2023-07-23 12:55:11 CDT; 18min ago Main PID: 383 (octoprint) Tasks: 18 (limit: 1472) CPU: 52.738s CGroup: /system.slice/ender3pro.service └─383 /home/pi/oprint/bin/python /home/pi/oprint/bin/octoprint serv e --config=/home/pi/.ender3pro/config.yaml --basedir=/home/pi/.ender3pro --port= 5001

Jul 23 13:01:31 octopi octoprint[383]: 2023-07-23 13:01:31,157 - octoprint.util. pip - INFO - Using "/home/pi/oprint/bin/python -m pip" as command to invoke pip Jul 23 13:01:31 octopi octoprint[383]: 2023-07-23 13:01:31,159 - octoprint.util. pip - INFO - pip installs to /home/pi/oprint/lib/python3.9/site-packages (writab le -> yes), --user flag needed -> no, virtual env -> yes Jul 23 13:01:31 octopi octoprint[383]: 2023-07-23 13:01:31,159 - octoprint.util. pip - INFO - ==> pip ok -> yes Jul 23 13:01:31 octopi octoprint[383]: 2023-07-23 13:01:31,264 - octoprint.plugi ns.softwareupdate - INFO - Minimum free storage across all update relevant locat ions is 52.4GB. That is considered sufficient for updating. Jul 23 13:01:32 octopi octoprint[383]: 2023-07-23 13:01:32,116 - octoprint.serve r.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'base_url' : 'http://192.168.69.64/ender3pro/', 'path': '/', 'query_string': 'l10n=en'} Jul 23 13:01:32 octopi octoprint[383]: 2023-07-23 13:01:32,171 - octoprint.plugi ns.tracking - INFO - Sent tracking event ping, payload: {'octoprint_uptime': 12, 'printer_state': 'OFFLINE'} Jul 23 13:01:32 octopi octoprint[383]: 2023-07-23 13:01:32,611 - octoprint.plugi ns.pluginmanager - INFO - Loaded notice data from disk, was still valid Jul 23 13:01:32 octopi octoprint[383]: 2023-07-23 13:01:32,813 - octoprint.plugi ns.tracking - INFO - Sent tracking event pong, payload: {'version': '1.9.2', 'os ': 'linux', 'bits': 32, 'python': '3.9.2', 'pip': '22.3', 'cores': 4, 'freq': 12 00.0, 'ram': 912703488, 'pi_model': 'Raspberry Pi 3 Model B Rev 1.2', 'octopi_ve rsion': '1.0.0', 'octopiuptodate_build': '1.0.0-1.9.2-20230718111854', 'plugins' : ''} Jul 23 13:01:33 octopi octoprint[383]: 2023-07-23 13:01:33,350 - octoprint.plugi ns.tracking - INFO - Sent tracking event startup, payload: {'version': '1.9.2', 'os': 'linux', 'bits': 32, 'python': '3.9.2', 'pip': '22.3', 'cores': 4, 'freq': 1200.0, 'ram': 912703488, 'pi_model': 'Raspberry Pi 3 Model B Rev 1.2', 'octopi _version': '1.0.0', 'octopiuptodate_build': '1.0.0-1.9.2-20230718111854'} Jul 23 13:01:45 octopi octoprint[383]: 2023-07-23 13:01:45,880 - octoprint.serve r.preemptive_cache - INFO - ... done in 13.76s None None {'bitrate': '10000k', 'cleanTmpAfterDays': 7, 'defaultWebcam': 'classic', 'ffmpeg': None, 'ffmpegCommandline': '{ffmpeg} -framerate {fps} -i "{input}" -vcodec ' '{videocodec} -threads {threads} -b:v {bitrate} -f ' '{containerformat} -y {filters} "{output}"', 'ffmpegThreads': 1, 'ffmpegThumbnailCommandline': '{ffmpeg} -sseof -1 -i "{input}" -update 1 -q:v ' '0.7 "{output}"', 'ffmpegVideoCodec': 'libx264', 'snapshotWebcam': 'classic', 'timelapse': {'fps': 25, 'options': {'capturePostRoll': None, 'interval': None, 'retractionZHop': None}, 'postRoll': 0, 'type': 'off'}, 'timelapseEnabled': True, 'watermark': True, 'webcamEnabled': True} cat: /etc/octoprint_cameras: No such file or directory


● haproxy.service - HAProxy Load Balancer Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2023-07-23 13:01:13 CDT; 12min ago Docs: man:haproxy(1) file:/usr/share/doc/haproxy/configuration.txt.gz Process: 685 ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $EXTRAOPTS (code=exited, status=0/SUCCESS) Main PID: 696 (haproxy) Tasks: 5 (limit: 1472) CPU: 381ms CGroup: /system.slice/haproxy.service ├─696 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -S /run/haproxy-master.sock └─702 /usr/sbin/haproxy -Ws -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -S /run/haproxy-master.sock

Jul 23 13:01:13 octopi haproxy[696]: [NOTICE] 203/130113 (696) : New worker #1 (702) forked Jul 23 13:01:13 octopi haproxy[696]: Proxy webcam started. Jul 23 13:01:13 octopi haproxy[696]: Proxy webcam_hls started. Jul 23 13:01:13 octopi haproxy[696]: Proxy ender3pro started. Jul 23 13:01:33 octopi haproxy[702]: ::ffff:192.168.69.111:50946 [23/Jul/2023:13:01:33.012] public octoprint/octoprint1 0/0/2/94/96 200 936 - - ---- 1/1/0/0/0 0/0 "GET /plugin/discovery/discovery.xml HTTP/1.1" Jul 23 13:02:43 octopi haproxy[702]: ::ffff:192.168.69.1:45626 [23/Jul/2023:13:02:43.102] public octoprint/octoprint1 0/0/1/37/38 200 936 - - ---- 2/2/0/0/0 0/0 "GET /plugin/discovery/discovery.xml HTTP/1.1" Jul 23 13:04:52 octopi haproxy[702]: ::ffff:192.168.69.1:45658 [23/Jul/2023:13:04:52.024] public octoprint/octoprint1 0/0/1/49/50 200 936 - - ---- 2/2/0/0/0 0/0 "GET /plugin/discovery/discovery.xml HTTP/1.1" Jul 23 13:06:22 octopi haproxy[702]: ::ffff:192.168.69.1:45676 [23/Jul/2023:13:06:22.106] public octoprint/octoprint1 0/0/0/34/34 200 936 - - ---- 2/2/0/0/0 0/0 "GET /plugin/discovery/discovery.xml HTTP/1.1" Jul 23 13:10:49 octopi haproxy[702]: ::ffff:192.168.69.1:45730 [23/Jul/2023:13:10:49.149] public octoprint/octoprint1 0/0/0/52/52 200 936 - - ---- 2/2/0/0/0 0/0 "GET /plugin/discovery/discovery.xml HTTP/1.1" Jul 23 13:13:22 octopi haproxy[702]: ::ffff:192.168.69.1:45764 [23/Jul/2023:13:13:22.298] public octoprint/octoprint1 0/0/0/49/49 200 936 - - ---- 1/1/0/0/0 0/0 "GET /plugin/discovery/discovery.xml HTTP/1.1" `

paukstelis commented 1 year ago

lrwxrwxrwx 1 root root 7 Jul 23 12:55 /dev/octo_ender3pro -> ttyUSB0 lrwxrwxrwx 1 root root 7 Jul 23 12:55 /dev/octo_octoprint -> ttyUSB1

This is the most important piece of information. It means your printers are detected, and it has the udev rules written.

Make sure that in your OctoPrint instances that you have the appropriate /dev/octo_instancename listed in the Additional Serial Ports section: image

joelstitch commented 1 year ago

I do have it set right on both printers. just like you have it on the image but with the /dev I got when I installed the instance.

paukstelis commented 1 year ago

Then select that printer in the connections list and see if it connects.

joelstitch commented 1 year ago

What do you think Ive been doing? I've had the serial port set to /dev/octo_octoprint since the beginning. Thats what it gave me when I setup the instance.

joelstitch commented 1 year ago

Performing autodetection with 7 port/baudrate candidates: /dev/octo_octoprint@115200, /dev/octo_octoprint@250000, /dev/octo_octoprint@230400, /dev/octo_octoprint@57600, /dev/octo_octoprint@38400, /dev/octo_octoprint@19200, /dev/octo_octoprint@9600 Trying port /dev/octo_octoprint, baudrate 115200 Connecting to port /dev/octo_octoprint, baudrate 115200 Handshake attempt #1 with timeout 2.0s Connected to: Serial<id=0x75014c58, open=True>(port='/dev/octo_octoprint', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor Send: N0 M110 N0*125 Handshake attempt #2 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #3 with timeout 2.0s Send: N0 M110 N0*125 Trying port /dev/octo_octoprint, baudrate 250000 Handshake attempt #1 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #2 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #3 with timeout 2.0s Send: N0 M110 N0*125 Trying port /dev/octo_octoprint, baudrate 230400 Handshake attempt #1 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #2 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #3 with timeout 2.0s Send: N0 M110 N0*125 Trying port /dev/octo_octoprint, baudrate 57600 Handshake attempt #1 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #2 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #3 with timeout 2.0s Send: N0 M110 N0*125 Trying port /dev/octo_octoprint, baudrate 38400 Handshake attempt #1 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #2 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #3 with timeout 2.0s Send: N0 M110 N0*125 Trying port /dev/octo_octoprint, baudrate 19200 Handshake attempt #1 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #2 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #3 with timeout 2.0s Send: N0 M110 N0*125 Trying port /dev/octo_octoprint, baudrate 9600 Handshake attempt #1 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #2 with timeout 2.0s Send: N0 M110 N0*125 Handshake attempt #3 with timeout 2.0s Send: N0 M110 N0*125 Changing monitoring state from "Detecting serial connection" to "Error" Changing monitoring state from "Error" to "Offline after error" Connection closed, closing down monitor

paukstelis commented 1 year ago

Have you tried connecting to /dev/ttyUSB1 on that instance?

paukstelis commented 1 year ago

You could also provide output from doing the following: unplug printer sudo dmesg -C plug printer in sudo dmesg provide output.

joelstitch commented 1 year ago

I've had the instance set right the whole time, it just won't connect. The first command doesnt give me anything. The second command gave me this:

pi@octopi:~ $ sudo dmesg [ 390.123604] usb 1-1.5: new full-speed USB device number 7 using dwc_otg [ 390.256545] usb 1-1.5: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64 [ 390.256581] usb 1-1.5: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 390.256597] usb 1-1.5: Product: USB Serial [ 390.257494] ch341 1-1.5:1.0: ch341-uart converter detected [ 390.259779] usb 1-1.5: ch341-uart converter now attached to ttyUSB0

joelstitch commented 1 year ago

I dont know what else to try. I tried starting fresh with OctoPi and reflashing my printers. Before I use octoprint_deploy, my octoprint connects to my printer with no issues but once I use octoprint_deploy the printers just wont connect.

joelstitch commented 1 year ago

I was able to get the first printer to connect by connecting it to /tmp/printer, disconnecting and connecting back to the /dev location. I disconnected the first printer and connected the second one to /tmp/printer with no problem, disconnected it and tried connecting to the /dev location but it wont connect. But now the first printer connects with no issue to the /dev location.

paukstelis commented 1 year ago

The only reason you would have a /tmp/printer is if you were using Klipper, which you have failed to mention. In that case you do not connect to the /dev/octo_instancename in the first place. Closing.

joelstitch commented 1 year ago

I installed klipper 10 minutes ago to see if it fixed the issue, which it didn't