최근 USB 직렬 연결을 통해 Tronxy 3D 프린터를 Ubuntu Server 20.04를 실행하는 Linux 상자에 연결했습니다. 일부 사용자 정의 매크로의 문제를 진단하는 데 도움을 주기 위해 Pronsole(printrun 도구 제품군의 유틸리티)을 사용하고 싶습니다. Pronsole 환경을 시작하고 connect
명령을 사용하여 프린터에 연결할 수 있었으며 문제나 오류가 발생하지 않았습니다. 그러나 예를 들어 Pronsole을 통해 gcode 명령을 프린터에 직접 푸시하면 G28
명령줄에서 다음과 같은 출력이 표시됩니다. 저는 Linux 오류나 Python에 익숙하지 않아 이러한 오류를 읽을 수 없거나 해결책을 찾기 위해 Google에서 무엇을 검색해야 할지 모릅니다. 나는 정말로 설명에 대한 도움을 찾고 있다고 생각합니다.
ttyUSB1 22°> G28
SENDING:G28
ttyUSB1 22°> Exception in thread read thread:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 333, in \_readline
line\_bytes = self.\_readline\_nb()
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 329, in \_readline\_nb
return self.printer.readline()
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 595, in read
raise SerialException(
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in \_bootstrap\_inner
[self.run](https://self.run)()
File "/usr/lib/python3.10/threading.py", line 953, in run
self.\_target(\*self.\_args, \*\*self.\_kwargs)
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 420, in \_listen
line = self.\_readline()
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 354, in \_readline
if 'Bad file descriptor' in e.args\[1\]:
IndexError: tuple index out of range
Can't write to printer (disconnected ?):
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 621, in write
n = os.write(self.fd, d)
OSError: \[Errno 5\] Input/output error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 750, in \_send
self.printer.write((command + "\\n").encode('ascii'))
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 655, in write
raise SerialException('write failed: {}'.format(e))
serial.serialutil.SerialException: write failed: \[Errno 5\] Input/output error
Can't write to printer (disconnected ?):
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 621, in write
n = os.write(self.fd, d)
OSError: \[Errno 5\] Input/output error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 750, in \_send
self.printer.write((command + "\\n").encode('ascii'))
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 655, in write
raise SerialException('write failed: {}'.format(e))
serial.serialutil.SerialException: write failed: \[Errno 5\] Input/output error
Can't write to printer (disconnected ?):
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 621, in write
n = os.write(self.fd, d)
OSError: \[Errno 5\] Input/output error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 750, in \_send
self.printer.write((command + "\\n").encode('ascii'))
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 655, in write
raise SerialException('write failed: {}'.format(e))
serial.serialutil.SerialException: write failed: \[Errno 5\] Input/output error
Can't write to printer (disconnected ?):
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 621, in write
n = os.write(self.fd, d)
OSError: \[Errno 5\] Input/output error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 750, in \_send
self.printer.write((command + "\\n").encode('ascii'))
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 655, in write
raise SerialException('write failed: {}'.format(e))
serial.serialutil.SerialException: write failed: \[Errno 5\] Input/output error
Disconnecting after 4 failed writes.
답변1
글쎄, 내 문제는 소프트웨어 문제가 아니라 하드웨어 문제인 것으로 나타났습니다. 3D 프린터가 명령을 실행하려고 할 때마다 전력 공급이 중단되고 USB 직렬 컨트롤러와 호스트 컴퓨터의 연결이 잠시 끊어집니다.