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

Print via serial port (Web) - How to troubleshoot #45

Open
heyfromapp opened this issue Aug 7, 2023 · 2 comments
Open

Print via serial port (Web) - How to troubleshoot #45

heyfromapp opened this issue Aug 7, 2023 · 2 comments

Comments

@heyfromapp
Copy link

Hello,

I am trying to use to connect website for receipt printing. Request prompt is coming to select available port for the printer but nothing is happening after connect.

I can see that data array being passed to Writer instance in debugging mode. Any help to how to get this working.

My code is executing this in a callback function on click event.

const data = await render(
  <Printer type="epson">
    <Text>Hello World</Text>
  </Printer>
);

const port = await window.navigator.serial.requestPort();
await port.open({ baudRate: 9600 });

const writer = port.writable?.getWriter();
if (writer != null) {
  await writer.write(data);
  writer.releaseLock();
}

Thanks,

GJ

@Hassan-jr
Copy link

The same happened to me while using POS80 printer. I had to check if the printer accepts esc/POS commands which it does support.
Still debugging this, Incase you solve this @heyfromapp share it.

@X4M1T0
Copy link

X4M1T0 commented Apr 29, 2024

Did you solve the error? I can´t make my script find my serial port to print my items!

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