WICG / serial

Serial ports API for the platform.
https://wicg.github.io/serial/
Other
255 stars 46 forks source link

Serial Port H/W Issue #199

Open johyeoncheol opened 4 months ago

johyeoncheol commented 4 months ago

HW Environment

Equipment: kiosks OS: Window 7 Pro Web Browser : Chrome Scale: AND GF-4000 Series Serial port communication in progress ( 9 Pin Serial Port - 25 Pin Serial Port )

  1. PortRequest fetched information about the port.
  2. Open the port.
  3. The value of the scale is well over.
  4. turn off the scale.
  5. turn on the scale
  6. The value of the scale does not exceed.

I have encountered this problem and am asking for your help. I really want to solve this problem. Please!

reillyeon commented 4 months ago

I don't understand what "The value of the scale is well over" and "The value of the scale does not exceed" mean. This sounds like an issue with the data returned by the scale, which is out of scope for this issue tracker. If you believe the scale is returning the correct data but Chrome is passing it to your application incorrectly please file an issue at crbug.com.

johyeoncheol commented 4 months ago

I'm sorry. There's an error because I wrote it using a translator.

Data comes in port.readable.getReader(). But, when the hardware is powered off and turned on, data does not come in port.readable.getReader().

reillyeon commented 4 months ago

Are you using the RS-232 interface or the USB interface? When the hardware is powered off and powered back on a USB interface will disconnect and you will need to call navigator.serial.requestPort() or navigator.serial.getPorts() to get a new SerialPort object representing the new device connection. The RS-232 interface doesn't have this behavior.

johyeoncheol commented 4 months ago

I'm using the RS-232C interface. I'm transferring data from scale to COM 2, and when I connect to COM 2 through navigator.serial.requestPort(), I was able to receive the data.

reillyeon commented 4 months ago

There may be an error when the scale is powered off or turned back on which would require you to call port.readable.getReader() again. For example, the scale may generate a "break" signal at power-on. Does your code handle errors returned by the reader and request a new reader on the new ReadableStream returned by port.readable in that case?