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

Pronterface Serial Exception #80

Open
aegean-odyssey opened this issue Aug 9, 2021 · 11 comments
Open

Pronterface Serial Exception #80

aegean-odyssey opened this issue Aug 9, 2021 · 11 comments

Comments

@aegean-odyssey
Copy link
Owner

aegean-odyssey commented Aug 9, 2021

@nathanielstenzel commented 2 days ago:

I am getting this issue from Pronterface. I think it might be related to the buffer size or the chip quality, but I may be wrong.

Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 500, 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/dist-packages/printrun/printcore.py", line 260, in _readline
line = self.printer.readline().decode('ascii')
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 509, in read
raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: 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.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 347, in _listen
line = self._readline()
File "/usr/lib/python3/dist-packages/printrun/printcore.py", line 281, in _readline
if 'Bad file descriptor' in e.args[1]:
IndexError: tuple index out of range

Originally posted by @nathanielstenzel in #5 (comment)

@aegean-odyssey
Copy link
Owner Author

I think this portion of the error message, "device disconnected or multiple access on port", hints at the root of the issue. I'll try to reproduce the problem on this end. Btw, what firmware version is installed in the minidelta printer?

@nathanielstenzel
Copy link

VideoCapture_20210808-162321

@aegean-odyssey
Copy link
Owner Author

In firmware relase 119r15, we (credit goes to the testers) fixed a USB issue that caused the printer to hang and reboot during a few connection scenarios with a host computer. Pronterface's connection process may be one of these troublesome scenarios.

I ran a quick test with pronterface and 119r15 firmware:

  • On a low-end laptop, I installed pronterface on Debian Bullseye (linux) directly from the Debian repository;
  • connected laptop and printer via a USB cable;
  • turned on the printer, launched pronterface;
  • clicked on the "connect" button in pronterface.

Pronterface worked without issue. It controlled the printer (move, turn on heaters and fan,...) and read status without a problem. I was able to manually send G/M-code commands as well. When I turned off the printer (removed power), pronterface displayed the error message you reported.

Please give firmware 119r15 a try, and please report your results. I think it will fix your issue. If not, I'll see if I can more accurately replicate your issue here.

Thank you for using mpmd_marlin_1.1.x.

@nathanielstenzel
Copy link

Thanks. I will try that in a few days.

@nathanielstenzel
Copy link

Well, I was a slacker. I updated the firmware. I had to grab my old microSD card to do that. I made a separate issue about that. I tried the console and it has not crashed yet.

On a side note, I was having trouble with G29 not honoring either MPMD style parameters or the LRFB parameters in the old firmware so if I have further issues I will be looking for a good place to comment on it.

@nathanielstenzel
Copy link

nathanielstenzel commented Aug 26, 2021

Alright. It did some crashing but it is certainly more stable. I was able to disconnect and then reconnect again and start using it. With the previous version of the firmware I could not do that.

@nathanielstenzel
Copy link

The crash that happened could have probably been pronsole itself. I do not think you need to worry about it.

`ttyACM0 31°> M503
SENDING:M503
Can't write to printer (disconnected ?):
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 537, 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 672, in _send
self.printer.write((command + "\n").encode('ascii'))
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 571, in write
raise SerialException('write failed: {}'.format(e))
serial.serialutil.SerialException: write failed: [Errno 5] Input/output error

`

@nathanielstenzel
Copy link

Ugh...now it is misbehaving more. I wonder if it has anything to do with the weather since it is a big lightning storm out.

@nathanielstenzel
Copy link

More of those tuple related error messages.

@aegean-odyssey
Copy link
Owner Author

From my quick brush with the latest Pronterface, it is not "gentle and pretty" when informing the user that the serial connection has dropped. The printer usually doesn't drop the USB connection unless it generates a fault (i.e. when the LED is flashing red, the printer resets), or when the USB cable is unplugged. Aside from the ugly messages, I don't think this is too much of a problem. During printing, though, the connection should be very stable. Otherwise, there is indeed a problem somewhere.

@nathanielstenzel
Copy link

Sadly, the interface libraries that Pronterface and Pronsole used are a bit overused and I do not see any alternatives in Linux land. I may have missed some though.

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

2 participants