node-escpos prints twice
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 40/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, nodejs
- Domain
- embedded-iot
Research direction
Start with index.js and the device.open callback shown in the report, then run node index.js while observing the callback log and printer output. Trace why the callback is entered twice and verify that the callback and text are each processed only once.
Written by the indexing model from the issue text.
Description
I have the following code
const escpos = require('escpos');
escpos.USB = require('escpos-usb');
const device = new escpos.USB(2727, 772);
const options = { encoding: "ISO8859-15" /* default */ }
const printer = new escpos.Printer(device, options);
device.open(function(error){
console.log("internal call")
printer
.text("Test123 This is a happy printer doing it's job twice. Too happy?")
.close()
});
when I run the code with
$node index.js
the thermal printer will print the text twice. I have also tried to add the cut() flush() method within the open callback method. I can see that this callback method is called two times, as in the console it prints "internal call" twice.
Expected: the printer only prints the text once.
Thanks for the help
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 443
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lsongdev/node-escpos
-
[BUG]:Openbug
Difficulty 4/5 3-5 days Newbie friendliness 15/100
lsongdev/node-escpos#447 ·
-
[BUG]: AJCBOSEOpenbug
Difficulty 5/5 Over a week Newbie friendliness 10/100
lsongdev/node-escpos#446 ·
-
Capt BilalOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
lsongdev/node-escpos#443 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
lsongdev/node-escpos#442 · 2 reactions ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 38/100
lsongdev/node-escpos#441 · 5 comments · 1 reaction ·
All issues in lsongdev/node-escpos
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
openzim/mwoffliner#2933 ·
Maintainers usually reply within 1 day
-
Use the README category name for website links and submissionsPossibly taken @dajiaohuang claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
birobirobiro/awesome-shadcn-ui#647 ·
Maintainers usually reply within 2 days
-
check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Urigo/accounter-fullstack#4604 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day