Solved Octoprint is unable to connect to Printer via usb

I am trying to connect Octoprint to a 3d printer via usb

The printer is connected to ugen2.2

Code:
 usbconfig
ugen0.1: <ATI OHCI root HUB> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen1.1: <ATI EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen2.1: <ATI OHCI root HUB> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen5.1: <ATI OHCI root HUB> at usbus5, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen4.1: <ATI OHCI root HUB> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen3.1: <ATI EHCI root HUB> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen6.1: <ATI EHCI root HUB> at usbus6, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen2.2: <FTDI FT232R USB UART> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (90mA)

The user "camuser" is added to (what I believe are) the necessary groups


Code:
grep camuser /etc/passwd
camuser:*:1002:1002:camuser:/home/camuser:/bin/sh

grep 1002 /etc/group
wheel:*:0:root,hbauer,logcheck,1002
tty:*:4:1002
operator:*:5:root,1002
dialer:*:68:1002
camuser:*:1002:

But when I try to connect Octoprint to the printer I get this messages


Code:
2023-01-21 16:54:48,799 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/usb/2.2.0, baudrate 115200
2023-01-21 16:54:48,803 - octoprint.util.comm - INFO - Connecting to port /dev/usb/2.2.0, baudrate 115200
2023-01-21 16:54:48,811 - octoprint.util.comm - INFO - Failed to connect: Port /dev/usb/2.2.0 is busy or does not exist
2023-01-21 16:54:48,812 - octoprint.util.comm - INFO - Serial detection: Could not open port /dev/usb/2.2.0, baudrate 115200, skipping
2023-01-21 16:54:48,812 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/usb/2.2.0, baudrate 250000
2023-01-21 16:54:48,815 - octoprint.util.comm - INFO - Connecting to port /dev/usb/2.2.0, baudrate 250000
2023-01-21 16:54:48,831 - octoprint.util.comm - INFO - Failed to connect: Port /dev/usb/2.2.0 is busy or does not exist
2023-01-21 16:54:48,832 - octoprint.util.comm - INFO - Serial detection: Could not open port /dev/usb/2.2.0, baudrate 250000, skipping
2023-01-21 16:54:48,832 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/usb/2.2.0, baudrate 230400
2023-01-21 16:54:48,835 - octoprint.util.comm - INFO - Connecting to port /dev/usb/2.2.0, baudrate 230400
2023-01-21 16:54:48,853 - octoprint.util.comm - INFO - Failed to connect: Port /dev/usb/2.2.0 is busy or does not exist
2023-01-21 16:54:48,853 - octoprint.util.comm - INFO - Serial detection: Could not open port /dev/usb/2.2.0, baudrate 230400, skipping
2023-01-21 16:54:48,854 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/usb/2.2.0, baudrate 57600
2023-01-21 16:54:48,857 - octoprint.util.comm - INFO - Connecting to port /dev/usb/2.2.0, baudrate 57600
2023-01-21 16:54:48,867 - octoprint.util.comm - INFO - Failed to connect: Port /dev/usb/2.2.0 is busy or does not exist

On a first look, it seems that the user that is running Octoprint is missing some rights.

Any idea is appreciated.


 
Check the owner, group and permissions on the usb port that the printer is connected to (from you example above: ls -l /dev/usb/2.2.0). Normally, you can fix this by adding a devd file in /usr/local/etc/devd for the device in question. Her is an example:
Code:
root@kg-core2:~ # cat /usr/local/etc/devd/dirtyjtag.conf
# allow group (operator) to access the usb connection of dirtyjtag

notify 100 {
        match "system"          "USB";
        match "subsystem"       "INTERFACE";
        match "type"            "ATTACH";
        match "vendor" "0x1209";
        match "product" "0xc0ca";
        action "usb_devaddr=`echo $cdev | sed 's#^ugen##'` && chmod g+rw /dev/usb/${usb_devaddr}.*";
};
if the group is the same (operator) all you need to do is change the vendor and product (and possibly rename the file).
 
Hi tingo,

i forgot to mention that I already changed the rights on dev/usb/2.2.0

Code:
 chmod 770 2.2.0
root:/dev/usb # ls -ls
total 0
0 crw-------  1 root  operator  0x46 Jan 21 17:46 0.1.0
0 crw-------  1 root  operator  0x5c Jan 21 17:46 0.1.1
0 crw-------  1 root  operator  0x48 Jan 21 17:46 1.1.0
0 crw-------  1 root  operator  0x5d Jan 21 17:46 1.1.1
0 crw-------  1 root  operator  0x4a Jan 21 17:46 2.1.0
0 crw-------  1 root  operator  0x5e Jan 21 17:46 2.1.1
0 crwxrwx---  1 root  operator  0x6f Jan 21 17:46 2.2.0

But without any luck.
 
i don't know about oktoprint but it looks like it wants to use a serial port
aren't you supposed to use cuaU something. fdti 232 should load a usb to serial driver
 
Code:
 id camuser
uid=1002(camuser) gid=1002(camuser) groups=1002(camuser),0(wheel),4(tty),5(operator),68(dialer)
 
covacat that led to the right direction. the logs for /dev/cuaU were different

Code:
2023-01-21 18:13:36,997 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/cuaU0, baudrate 57600
2023-01-21 18:13:36,998 - octoprint.util.comm - INFO - Serial detection: Handshake attempt #1 with timeout 2.0s
2023-01-21 18:13:37,007 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0

so I increased the timeout in octoprint and...
Code:
2023-01-21 18:14:44,738 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/cuaU0, baudrate 115200
2023-01-21 18:14:44,741 - octoprint.util.comm - INFO - Connecting to port /dev/cuaU0, baudrate 115200
2023-01-21 18:14:44,770 - octoprint.util.comm - INFO - Serial detection: Handshake attempt #1 with timeout 11.0s
2023-01-21 18:14:44,927 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2023-01-21 18:14:54,443 - octoprint.util.comm - INFO - Changing monitoring state from "Detecting serial connection" to "Operational"
2023-01-21 18:14:54,493 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2023-01-21 18:15:03,345 - octoprint.util.comm - INFO - Printer reports firmware name "Marlin Marlin1.1.6 (Creality3D)"

tschaka
 
Back
Top