Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue connecting to a remote port #1027

Closed
DemoN3579 opened this issue Nov 22, 2019 · 6 comments
Closed

Issue connecting to a remote port #1027

DemoN3579 opened this issue Nov 22, 2019 · 6 comments

Comments

@DemoN3579
Copy link

When I try to connect from Pronterface to my 3D printer through the network. An error occurs:
Connecting... Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/dmitriy/tmp/Printrun/printrun/printcore.py", line 356, in _listen self._listen_until_online() File "/home/dmitriy/tmp/Printrun/printrun/printcore.py", line 319, in _listen_until_online self._send("M105") File "/home/dmitriy/tmp/Printrun/printrun/printcore.py", line 683, in _send self.printer.write((command + "\n").encode('ascii')) TypeError: write() argument must be str, not bytes
The problem occurred after upgrade Ubuntu to 19.10 and it happens whether I use Pronterface from a package or from a repository

@volconst
Copy link
Collaborator

Delete .encode('ascii') at line 683 Printrun/printrun/printcore.py. Maybe the serial library has changed.

@DemoN3579
Copy link
Author

It did not help. Line 683 now looks like this
self.printer.write((command + "\n"))
resulting error
Connecting... Can't write to printer (disconnected ?): Traceback (most recent call last): File "/home/dmitriy/tmp/Printrun/printrun/printcore.py", line 683, in _send self.printer.write((command + "\n")) io.UnsupportedOperation: not writable Exception in thread Thread-2: Traceback (most recent call last): File "/home/dmitriy/tmp/Printrun/printrun/printcore.py", line 271, in _readline line = self.printer.readline().decode('ascii') File "/usr/lib/python3.7/socket.py", line 586, in readinto raise OSError("cannot read from timed out object") OSError: cannot read from timed out object During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/dmitriy/tmp/Printrun/printrun/printcore.py", line 356, in _listen self._listen_until_online() File "/home/dmitriy/tmp/Printrun/printrun/printcore.py", line 325, in _listen_until_online line = self._readline() File "/home/dmitriy/tmp/Printrun/printrun/printcore.py", line 292, in _readline if 'Bad file descriptor' in e.args[1]: IndexError: tuple index out of range

@Azertyaaaa
Copy link

Same problem here.

@volconst
Copy link
Collaborator

Please test if this branch fixes the problem and if so I will create a pull request to integrate it officially

@DemoN3579
Copy link
Author

Please test if this branch fixes the problem and if so I will create a pull request to integrate it officially

It works. In this branch the problem is resolved

@volconst
Copy link
Collaborator

Thanks, created pull request #1030

@kliment kliment closed this as completed in c6228e2 Jan 2, 2020
kliment added a commit that referenced this issue Jan 2, 2020
Fix #1027, reimplementing tcp printer communication
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants