ECONNREFUSED when printing by network
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- nodejs, typescript
- 领域
- networking
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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??
- 主要语言
- TypeScript
- 星标
- 1.6k
- 派生
- 443
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lsongdev/node-escpos 的其他 Issue
-
[BUG]:未关闭bug
难度 4/5 3-5 天 新手友好度 15/100
lsongdev/node-escpos#447 ·
-
[BUG]: AJCBOSE未关闭bug
难度 5/5 一周以上 新手友好度 10/100
lsongdev/node-escpos#446 ·
-
Capt Bilal未关闭
难度 5/5 一周以上 新手友好度 1/100
lsongdev/node-escpos#443 ·
-
bug
难度 3/5 1-2 天 新手友好度 35/100
lsongdev/node-escpos#442 · 2 个 reaction ·
-
bug
难度 3/5 1-2 天 新手友好度 38/100
lsongdev/node-escpos#441 · 5 条评论 · 1 个 reaction ·
查看 lsongdev/node-escpos 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
jessepollak/home#2223 ·
维护者通常 1 天内回复
-
grep fixture corpus test follows the corpus's loop symlink under the receipt runner (fails on main)未关闭
难度 2/5 1-3 小时 新手友好度 68/100
code-yeongyu/senpi#3756 ·
维护者通常 1 天内回复
-
org:external package:deepagents priority:triage topic:memory topic:middleware type:bug
难度 2/5 1-3 小时 新手友好度 65/100
langchain-ai/deepagents#7059 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
osmlab/name-suggestion-index#12992 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
hemilabs/ui-monorepo#2506 ·
维护者通常 1 天内回复