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

Wainlux K6: Win 10: 'Underlying input stream returned zero bytes' #170

Open
darchivist opened this issue Apr 5, 2021 · 14 comments
Open
Labels
bug needs-info Waiting for information / for a reply by the submitter

Comments

@darchivist
Copy link

Trying to send to a Wainlux K6 on COM3. I’ve not been able to send a simple pattern the the engraver; it errors out with the above message. I was able to get it to trace the bounding box once by running the app in admin mode; I’ve not been able to get this to repeat.

The laser’s native app (such as it is) works fine on the same COM port. I’ve rebooted the system between attempts.

@mgmax mgmax transferred this issue from t-oster/VisiCut Apr 5, 2021
@mgmax
Copy link
Collaborator

mgmax commented Apr 5, 2021

Which laser driver do you use?

Please try running VisiCut from the command line and post a screenshot of the detailed error message.

@mgmax
Copy link
Collaborator

mgmax commented Apr 5, 2021

We had a similar issue previously, where the error message indicated a timeout. #25

Maybe the driver does not correctly set the serial mode (baud rate, flow control, parity and so on), and only randomly works if you used the native app before so that the serial mode is already set?

@darchivist
Copy link
Author

darchivist commented Apr 5, 2021 via email

@darchivist
Copy link
Author

darchivist commented Apr 5, 2021 via email

@darchivist
Copy link
Author

Debug results:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.dom4j.io.SAXContentHandler (file:/C:/Program%20Files%20(x86)/VisiCut/Visicut.jar) to method com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy.getEncoding()
WARNING: Please consider reporting this to the maintainers of org.dom4j.io.SAXContentHandler
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Security framework of XStream not explicitly initialized, using predefined black list on your own risk.
Security framework of XStream not explicitly initialized, using predefined black list on your own risk.
Security framework of XStream not explicitly initialized, using predefined black list on your own risk.
using single-instance port: 6546
Security framework of XStream not explicitly initialized, using predefined black list on your own risk.
Security framework of XStream not explicitly initialized, using predefined black list on your own risk.
java.io.IOException: Underlying input stream returned zero bytes
at java.base/sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at java.base/sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at java.base/sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.base/java.io.InputStreamReader.read(Unknown Source)
at java.base/java.io.Reader.read(Unknown Source)
at de.thomas_oster.liblasercut.drivers.K3EngraverDriver.waitForACK(K3EngraverDriver.java:336)
at de.thomas_oster.liblasercut.drivers.K3EngraverDriver.sendLine(K3EngraverDriver.java:353)
at de.thomas_oster.liblasercut.drivers.K3EngraverDriver.moveRelative(K3EngraverDriver.java:507)
at de.thomas_oster.liblasercut.drivers.K3EngraverDriver.sendJob(K3EngraverDriver.java:669)
at de.thomas_oster.visicut.VisicutModel.sendJob(VisicutModel.java:778)
at de.thomas_oster.visicut.gui.MainView.lambda$executeOrSaveJob$7(MainView.java:2209)
at java.base/java.lang.Thread.run(Unknown Source)
java.io.IOException: Underlying input stream returned zero bytes
at java.base/sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at java.base/sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at java.base/sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.base/java.io.InputStreamReader.read(Unknown Source)
at java.base/java.io.Reader.read(Unknown Source)
at de.thomas_oster.liblasercut.drivers.K3EngraverDriver.waitForACK(K3EngraverDriver.java:336)
at de.thomas_oster.liblasercut.drivers.K3EngraverDriver.sendLine(K3EngraverDriver.java:353)
at de.thomas_oster.liblasercut.drivers.K3EngraverDriver.moveRelative(K3EngraverDriver.java:507)
at de.thomas_oster.liblasercut.drivers.K3EngraverDriver.sendJob(K3EngraverDriver.java:669)
at de.thomas_oster.visicut.VisicutModel.sendJob(VisicutModel.java:778)
at de.thomas_oster.visicut.gui.MainView.lambda$executeOrSaveJob$7(MainView.java:2209)

@Madz83
Copy link

Madz83 commented Jul 23, 2021

I have the same issue. I've installed the Driver that came with Wainlux K6 and then installed the latest Visicut software. It gives the same error as highlighted above. Please help.
I'm attaching screenshots of port configuration and error message from Visicut.
Capture 1
Capture 2

@mgmax
Copy link
Collaborator

mgmax commented Jul 24, 2021

VisiCut seems to get stuck waiting for a response from the laser cutter. There are two possible reasons:

  1. We are using the wrong baud rate / handshake setting
  2. The protocol is different

for 1.:

Does it work if you first laser something with the manufacturer's app and then with VisiCut?

What are the serial port settings while/after using the manufacturer's app?
(Device manager - right click - properties - port settings)

for 2.:

Can you record a trace of how the manufacturer's app communicates with the laser, compared to how VisiCut does it? I'm not sure how exactly this works on Windows, you may try the following links. (Disclaimer: I have not tested any of these)

https://lorgor.blogspot.com/2010/01/tracing-serial-port-on-windows.html
http://www.simpleterm.co.uk/site/
https://www.eltima.com/products/serial-port-monitor/

@t-oster
Copy link
Owner

t-oster commented Jul 27, 2021

@Madz83 can you provide a log from running VisiCut via command line (https://github.com/t-oster/VisiCut/wiki/Development:-Running-from-commandline) and try to just vector-cut a simple shape? I would like to see where exactly the timeout occurs.

@mgmax mgmax added the needs-info Waiting for information / for a reply by the submitter label Sep 12, 2021
@dokh
Copy link

dokh commented Nov 28, 2021

Attached COM port traces (using https://www.eltima.com/products/serial-port-monitor/) when using application from vendor and using Visicut.
Simple square shape used.
Hope that helps.
Wainlux K6 - COM trace.zip

@dokh
Copy link

dokh commented Nov 28, 2021

@Madz83 can you provide a log from running VisiCut via command line (https://github.com/t-oster/VisiCut/wiki/Development:-Running-from-commandline) and try to just vector-cut a simple shape? I would like to see where exactly the timeout occurs.

See debug posted by @darchivist (#170 (comment)).
That is all the debug output we get.

@mgmax
Copy link
Collaborator

mgmax commented Aug 12, 2022

I can't open that "COM trace" file on Linux, maybe you can post a screenshot of the start of the communication?

Please also consider the questions about "1. We are using the wrong baud rate / handshake setting" I asked earlier. Maybe the COM trace will also show us which settings were used. Or at worst we would have to use a logic analyzer on the to look at the communication on the hardware level.

The question is still to find out what VisiCut does different than the original software, to find out at which point the communication fails.

@JarrettR
Copy link

JarrettR commented Aug 12, 2022

Also getting 'Underlying input stream returned zero bytes'. Windows and K6.
Quite probably related, I'm unable to get the software that this driver is based on to work:
RBEGamer/K3_LASER_ENGRAVER_PROTOCOL#6

@mgmax
Copy link
Collaborator

mgmax commented Aug 12, 2022

What do you mean with "this"? Please post an error message to avoid misunderstanding.

Edit: from the context, I understand we're talking about the "returned zero bytes" error.

@mgmax
Copy link
Collaborator

mgmax commented Aug 12, 2022

from the issue you linked, it looks like the communication works for multiple packets/commands (ACKs) and then suddenly dies. I would guess we are doing something subtly wrong, like not enough delay, or not waiting for some software or hardware flow control (XON-XOFF or RTS-CTS). Looking at the exact port configuration and timing of VIsicut and also of the original software with the the serial port monitor could help us find out this.

@mgmax mgmax added the bug label Dec 24, 2023
@mgmax mgmax changed the title Win 10: 'Underlying input stream returned zero bytes' Wainlux K6: Win 10: 'Underlying input stream returned zero bytes' Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-info Waiting for information / for a reply by the submitter
Projects
None yet
Development

No branches or pull requests

6 participants