ECONNREFUSED when printing by network
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- nodejs, typescript
- Domain
- networking
Research direction
Start with the supplied escpos.Network(ip, port) call and the ECONNREFUSED connection to 192.168.1.119:9100. Reproduce the network-printing path and compare it with the working USB path; done means determining whether the failure is in the library or the printer/network endpoint.
Written by the indexing model from the issue text.
Description
USB interface tested and worked.
But I'm getting this error while trying to print by Network interface:
Error: connect ECONNREFUSED 192.168.1.119:9100
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '192.168.1.119',
port: 9100
}
Ping to printer:
➜ ~ ping 192.168.1.119
PING 192.168.1.119 (192.168.1.119): 56 data bytes
64 bytes from 192.168.1.119: icmp_seq=0 ttl=64 time=6.388 ms
64 bytes from 192.168.1.119: icmp_seq=1 ttl=64 time=7.135 ms
64 bytes from 192.168.1.119: icmp_seq=2 ttl=64 time=5.781 ms
64 bytes from 192.168.1.119: icmp_seq=3 ttl=64 time=7.053 ms
^C
--- 192.168.1.119 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 5.781/6.589/7.135/0.549 ms
Code:
const escpos = require('escpos');
escpos.Network = require('escpos-network');
const netPrint = (ip: string, text: string, encode: string, fontSize: number, port: number) => {
const device = new escpos.Network(ip, port);
const options = { encoding: 'GB18030' };
const printer = new escpos.Printer(device, options);
device.open(function (err: unknown) {
if (err) {
console.log(err);
return;
}
printer
.font('B')
.align('LT')
.style('NORMAL')
.size(fontSize, fontSize)
.marginBottom(1)
.encode(encode)
.text(text + '\n\n')
.cut()
.close();
});
};
export default netPrint;
Anyone had this problem??
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 443
- PR merge metrics
- No merged PRs in 30d
Contributor 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]: AJCBOSE Openbug
Difficulty 5/5 Over a week Newbie friendliness 10/100
lsongdev/node-escpos#446 ·
-
Capt Bilal Open
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 1/5 1-3 hours Newbie friendliness 88/100
motiondivision/motion#3849 ·
-
Add: S Play Event HD Opencheck:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
i-am-bee/beeai-framework#1697 · 1 reaction ·
-
Support bun dedupe Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
antfu/node-modules-inspector#214 ·