aegean-odyssey / mpmd_marlin_1.1.x

a fork of Marlin firmware (bugfix-1.1.x) for the Monoprice MP Mini Delta 3d printer
GNU General Public License v3.0
76 stars 19 forks source link

Pronterface Serial Exception #80

Open aegean-odyssey opened 3 years ago

aegean-odyssey commented 3 years ago

@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 https://github.com/aegean-odyssey/mpmd_marlin_1.1.x/issues/5#issuecomment-894618440_

aegean-odyssey commented 3 years ago

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 commented 3 years ago

VideoCapture_20210808-162321

aegean-odyssey commented 3 years ago

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:

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 commented 3 years ago

Thanks. I will try that in a few days.

nathanielstenzel commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

More of those tuple related error messages.

aegean-odyssey commented 3 years ago

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 commented 3 years ago

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.