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

Error: Port is opening (Linux and Windows) #13

Closed
Kaplas85 opened this issue Oct 26, 2022 · 5 comments
Closed

Error: Port is opening (Linux and Windows) #13

Kaplas85 opened this issue Oct 26, 2022 · 5 comments
Assignees
Labels
bug Something isn't working waiting

Comments

@Kaplas85
Copy link

Hi! I'm trying to use a thermal printer Dascom DT-230 with the serialport adapter. Now the printer is connected to my PC using usb but the pc detects that as a serial port

In Windows as COM4
In Linux as /dev/ttyACM0

In both cases that return Error: Port is opening
image

It's the code that I was testing

import { Printer } from "@node-escpos/core";
import Serial from "@node-escpos/serialport-adapter";

const device = new Serial("/dev/ttyACM0", { // In Windows I was put "COM4"
  baudRate: 115200,
  stopBit: 1,
});

const options = {
  encoding: "utf-8",
};

const printer = new Printer(device, options);

device.open((error) => {
  if (error) {
    console.error(error);
    return;
  }

  let printer = new Printer(device, {});

  printer
    .font("a")
    .align("ct")
    .style("bu")
    .size(1, 1)
    .text("The quick brown fox jumps over the lazy dog");

  printer.cut().close();
});

Someone can help me with that? I have been trying different packages to use escpos printers for months and I have not found any that give me results

@dohooo dohooo self-assigned this Oct 27, 2022
@dohooo dohooo added the bug Something isn't working label Oct 27, 2022 — with Volta.net
Copy link
Contributor

dohooo commented Oct 27, 2022

This problem is related to this issue.

Copy link
Contributor

dohooo commented Oct 27, 2022

Try this. Waiting for your feedback. 🍻

@Kaplas85
Copy link
Author

I was update the serial port package and that solve the bug but still the printer don't print any.

I also don't get any output in the console

@dohooo
Copy link
Contributor

dohooo commented Oct 29, 2022

I was update the serial port package and that solve the bug but still the printer don't print any.

I also don't get any output in the console

Okay, let me check again.

@Kaplas85
Copy link
Author

Hello! I will close this issue because the problem was not the package, was the printer.

I was try with a new printer and works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting
Projects
None yet
Development

No branches or pull requests

2 participants