Contact me: hankecnc@gmail.com

频繁连接断开场景下的奇怪 tty 行为 #467

推推 grbl 3年前 (2023-01-30) 240次浏览
打开
tsipa 打开了这个问题 2020 年 7 月 4 日 · 7条评论
打开

频繁连接断开场景下的奇怪 tty 行为#467

tsipa 打开了这个问题 2020 年 7 月 4 日 · 7条评论

注释

频繁连接断开场景下的奇怪 tty 行为 #467
齐帕 评论了 2020 年 7 月 4 日  

请回答以下问题。

您使用的是什么版本的固件?Devt 的 0469e7b,带有
spi_daisy_4axis_xyz
master 的 spi_daisy_4axis_xyz fc6926d

问题是否可重复?
是的

什么情况下会出现bug?

raspberry pi, 4.19.66-v7+, esp32 with:
Bus 001 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART 桥接控制器 [CP210x 系列]

我尝试在不使用 cncjs 的情况下使用 重现它,但screen /dev/ttyUSB0未能获得清晰的重现。我试图将多个 FD 生成到 TTY,但问题出在其他地方。使用 CNCJS,它相对容易重现并使其完全无法使用。

打开浏览器 1,对 /dev/ttyUSB0
进行“连接” 打开浏览器 2,对 /dev/ttyUSB0 进行“连接”
打开浏览器 1,对 /dev/ttyUSB0 进行“断开连接”
打开浏览器 2,对 /dev 进行“连接” /ttyUSB0
打开浏览器 1,对 /dev/ttyUSB0 进行“连接”

这样做几次后,您将得到 noop /dev/ttyUSB0,直到您按下 ESP32 上的重置按钮,它才会恢复。
您可以附加到此 /dev/ttyUSB0 但它不会响应任何命令。当点击重置时,它会喷出正常的启动信息。
不行echo '[ESP444]RESTART' > /dev/ttyUSB0,只能物理重置。

频繁连接断开场景下的奇怪 tty 行为 #467 tsipa 添加了 漏洞 有些东西不工作标签 2020 年 7 月 4 日
频繁连接断开场景下的奇怪 tty 行为 #467
作者

它似乎不是 uart 驱动程序或板本身的问题,至少
esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 /root/zalupa/boot_app0.bin 0x1000 /root/zalupa/bootloader_qio_80m.bin 0x10000 /root/zalupa/Grbl_Esp32.ino.bin 0x8000 ~/zalupa/Grbl_Esp32.ino.partitions.bin
我可以重置板

频繁连接断开场景下的奇怪 tty 行为 #467

尝试在 CNCjs 服务器命令行上使用 -vvv 记录所有 CNCjs 消息。

频繁连接断开场景下的奇怪 tty 行为 #467
作者

作品:

2020-07-04T16:34:15.996Z - silly controller:Grbl < [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0.000]
2020-07-04T16:34:15.998Z - silly controller:Grbl < ok
2020-07-04T16:34:15.998Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P|WCO:0.000,0.000,0.000>
2020-07-04T16:34:16.245Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P|Ov:100,100,100>
2020-07-04T16:34:16.495Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
2020-07-04T16:34:16.496Z - silly controller:Grbl < [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0.000]
2020-07-04T16:34:16.498Z - silly controller:Grbl < ok
2020-07-04T16:34:16.765Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
2020-07-04T16:34:17.015Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
2020-07-04T16:34:17.017Z - silly controller:Grbl < [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0.000]
2020-07-04T16:34:17.019Z - silly controller:Grbl < ok
2020-07-04T16:34:17.273Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
2020-07-04T16:34:17.526Z - silly controller:Grbl < [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0.000]
2020-07-04T16:34:17.528Z - silly controller:Grbl < ok
2020-07-04T16:34:17.528Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
2020-07-04T16:34:17.781Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
2020-07-04T16:34:18.033Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
2020-07-04T16:34:18.035Z - silly controller:Grbl < [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0.000]
2020-07-04T16:34:18.036Z - silly controller:Grbl < ok
2020-07-04T16:34:18.295Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P>
2020-07-04T16:34:18.547Z - silly controller:Grbl < <Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P|WCO:0.000,0.000,0.000>
2020-07-04T16:34:18.549Z - silly controller:Grbl < [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0.000]
2020-07-04T16:34:18.551Z - silly controller:Grbl < ok
2020-07-04T16:34:18.712Z - debug service:cncengine socket.close("/dev/ttyUSB0"): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18339:25)

又一个连接断开,仍然有效:

2020-07-04T16:34:19.063Z - debug service:cncengine socket.list(): id=d8IvgPu2GTW1Hgo1AAAB     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:19.079Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:19.095Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:20.317Z - debug service:cncengine socket.open("/dev/ttyUSB0", {"controllerType":"Grbl","baudrate":115200,"rtscts":false}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18269:25)
2020-07-04T16:34:20.323Z - debug controller:Grbl Add socket connection: id=uJ-p7hg2nL1vE3ikAAAC     at GrblController.addConnection (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9277:26)
2020-07-04T16:34:20.345Z - debug controller:Grbl Connected to serial port "/dev/ttyUSB0"     at SerialPort.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9211:28)
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:22.270Z - silly controller:Grbl > $$
2020-07-04T16:34:22.275Z - silly controller:Grbl < $0=3
2020-07-04T16:34:22.279Z - silly controller:Grbl < $1=250
2020-07-04T16:34:22.284Z - silly controller:Grbl < $2=0
2020-07-04T16:34:22.288Z - silly controller:Grbl < $3=0
2020-07-04T16:34:22.290Z - silly controller:Grbl < $4=0
2020-07-04T16:34:22.293Z - silly controller:Grbl < $5=1
2020-07-04T16:34:22.296Z - silly controller:Grbl < $6=0
2020-07-04T16:34:22.299Z - silly controller:Grbl < $10=1
2020-07-04T16:34:22.302Z - silly controller:Grbl < $11=0.010
2020-07-04T16:34:22.304Z - silly controller:Grbl < $12=0.002
2020-07-04T16:34:22.307Z - silly controller:Grbl < $13=0
2020-07-04T16:34:22.310Z - silly controller:Grbl < $20=0
2020-07-04T16:34:22.312Z - silly controller:Grbl < $21=0
2020-07-04T16:34:22.333Z - silly controller:Grbl < $22=0
2020-07-04T16:34:22.336Z - silly controller:Grbl < $23=3
2020-07-04T16:34:22.339Z - silly controller:Grbl < $24=200.000
2020-07-04T16:34:22.341Z - silly controller:Grbl < $25=2000.000
2020-07-04T16:34:22.344Z - silly controller:Grbl < $26=250.000
2020-07-04T16:34:22.347Z - silly controller:Grbl < $27=1.000
2020-07-04T16:34:22.349Z - silly controller:Grbl < $30=1.000
2020-07-04T16:34:22.352Z - silly controller:Grbl < $31=0.000
2020-07-04T16:34:22.355Z - silly controller:Grbl < $32=0
2020-07-04T16:34:22.358Z - silly controller:Grbl < $N1=
2020-07-04T16:34:22.361Z - silly controller:Grbl < $N0=
2020-07-04T16:34:22.363Z - silly controller:Grbl < $100=800.000
2020-07-04T16:34:22.366Z - silly controller:Grbl < $101=800.000
2020-07-04T16:34:22.369Z - silly controller:Grbl < $102=800.000
2020-07-04T16:34:22.372Z - silly controller:Grbl < $110=1000.000
2020-07-04T16:34:22.375Z - silly controller:Grbl < $111=1000.000
2020-07-04T16:34:22.378Z - silly controller:Grbl < $112=500.000
2020-07-04T16:34:22.380Z - silly controller:Grbl < $120=50.000
2020-07-04T16:34:22.381Z - silly controller:Grbl < $121=50.000
2020-07-04T16:34:22.383Z - silly controller:Grbl < $122=50.000
2020-07-04T16:34:22.385Z - silly controller:Grbl < $130=300.000
2020-07-04T16:34:22.386Z - silly controller:Grbl < $131=300.000
2020-07-04T16:34:22.388Z - silly controller:Grbl < $132=300.000
2020-07-04T16:34:22.390Z - silly controller:Grbl < ok
2020-07-04T16:34:23.781Z - debug service:cncengine socket.close("/dev/ttyUSB0"): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18339:25)

几次,作品:

2020-07-04T16:34:23.795Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:23.855Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:25.072Z - debug service:cncengine socket.open("/dev/ttyUSB0", {"controllerType":"Grbl","baudrate":115200,"rtscts":false}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18269:25)
2020-07-04T16:34:25.076Z - debug controller:Grbl Add socket connection: id=uJ-p7hg2nL1vE3ikAAAC     at GrblController.addConnection (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9277:26)
2020-07-04T16:34:25.092Z - debug controller:Grbl Connected to serial port "/dev/ttyUSB0"     at SerialPort.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9211:28)
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:26.463Z - silly controller:Grbl > $$
2020-07-04T16:34:26.471Z - silly controller:Grbl < $0=3
2020-07-04T16:34:26.475Z - silly controller:Grbl < $1=250
2020-07-04T16:34:26.480Z - silly controller:Grbl < $2=0
2020-07-04T16:34:26.483Z - silly controller:Grbl < $3=0
2020-07-04T16:34:26.486Z - silly controller:Grbl < $4=0
2020-07-04T16:34:26.488Z - silly controller:Grbl < $5=1
2020-07-04T16:34:26.491Z - silly controller:Grbl < $6=0
2020-07-04T16:34:26.493Z - silly controller:Grbl < $10=1
2020-07-04T16:34:26.496Z - silly controller:Grbl < $11=0.010
2020-07-04T16:34:26.499Z - silly controller:Grbl < $12=0.002
2020-07-04T16:34:26.509Z - silly controller:Grbl < $13=0
2020-07-04T16:34:26.511Z - silly controller:Grbl < $20=0
2020-07-04T16:34:26.514Z - silly controller:Grbl < $21=0
2020-07-04T16:34:26.522Z - silly controller:Grbl < $22=0
2020-07-04T16:34:26.525Z - silly controller:Grbl < $23=3
2020-07-04T16:34:26.527Z - silly controller:Grbl < $24=200.000
2020-07-04T16:34:26.530Z - silly controller:Grbl < $25=2000.000
2020-07-04T16:34:26.532Z - silly controller:Grbl < $26=250.000
2020-07-04T16:34:26.535Z - silly controller:Grbl < $27=1.000
2020-07-04T16:34:26.537Z - silly controller:Grbl < $30=1.000
2020-07-04T16:34:26.540Z - silly controller:Grbl < $31=0.000
2020-07-04T16:34:26.542Z - silly controller:Grbl < $32=0
2020-07-04T16:34:26.545Z - silly controller:Grbl < $N1=
2020-07-04T16:34:26.547Z - silly controller:Grbl < $N0=
2020-07-04T16:34:26.550Z - silly controller:Grbl < $100=800.000
2020-07-04T16:34:26.552Z - silly controller:Grbl < $101=800.000
2020-07-04T16:34:26.554Z - silly controller:Grbl < $102=800.000
2020-07-04T16:34:26.557Z - silly controller:Grbl < $110=1000.000
2020-07-04T16:34:26.559Z - silly controller:Grbl < $111=1000.000
2020-07-04T16:34:26.561Z - silly controller:Grbl < $112=500.000
2020-07-04T16:34:26.564Z - silly controller:Grbl < $120=50.000
2020-07-04T16:34:26.566Z - silly controller:Grbl < $121=50.000
2020-07-04T16:34:26.568Z - silly controller:Grbl < $122=50.000
2020-07-04T16:34:26.571Z - silly controller:Grbl < $130=300.000
2020-07-04T16:34:26.573Z - silly controller:Grbl < $131=300.000
2020-07-04T16:34:26.575Z - silly controller:Grbl < $132=300.000
2020-07-04T16:34:26.578Z - silly controller:Grbl < ok
2020-07-04T16:34:27.740Z - debug service:cncengine socket.close("/dev/ttyUSB0"): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18339:25)
2020-07-04T16:34:27.751Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:27.813Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:28.732Z - debug service:cncengine socket.open("/dev/ttyUSB0", {"controllerType":"Grbl","baudrate":115200,"rtscts":false}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18269:25)
2020-07-04T16:34:28.738Z - debug controller:Grbl Add socket connection: id=uJ-p7hg2nL1vE3ikAAAC     at GrblController.addConnection (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9277:26)
2020-07-04T16:34:28.758Z - debug controller:Grbl Connected to serial port "/dev/ttyUSB0"     at SerialPort.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9211:28)
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:29.860Z - silly controller:Grbl > $$
2020-07-04T16:34:29.865Z - silly controller:Grbl < $0=3
2020-07-04T16:34:29.868Z - silly controller:Grbl < $1=250
2020-07-04T16:34:29.872Z - silly controller:Grbl < $2=0
2020-07-04T16:34:29.876Z - silly controller:Grbl < $3=0
2020-07-04T16:34:29.878Z - silly controller:Grbl < $4=0
2020-07-04T16:34:29.880Z - silly controller:Grbl < $5=1
2020-07-04T16:34:29.882Z - silly controller:Grbl < $6=0
2020-07-04T16:34:29.884Z - silly controller:Grbl < $10=1
2020-07-04T16:34:29.886Z - silly controller:Grbl < $11=0.010
2020-07-04T16:34:29.889Z - silly controller:Grbl < $12=0.002
2020-07-04T16:34:29.891Z - silly controller:Grbl < $13=0
2020-07-04T16:34:29.897Z - silly controller:Grbl < $20=0
2020-07-04T16:34:29.899Z - silly controller:Grbl < $21=0
2020-07-04T16:34:29.901Z - silly controller:Grbl < $22=0
2020-07-04T16:34:29.903Z - silly controller:Grbl < $23=3
2020-07-04T16:34:29.906Z - silly controller:Grbl < $24=200.000
2020-07-04T16:34:29.908Z - silly controller:Grbl < $25=2000.000
2020-07-04T16:34:29.910Z - silly controller:Grbl < $26=250.000
2020-07-04T16:34:29.912Z - silly controller:Grbl < $27=1.000
2020-07-04T16:34:29.914Z - silly controller:Grbl < $30=1.000
2020-07-04T16:34:29.916Z - silly controller:Grbl < $31=0.000
2020-07-04T16:34:29.919Z - silly controller:Grbl < $32=0
2020-07-04T16:34:29.921Z - silly controller:Grbl < $N1=
2020-07-04T16:34:29.923Z - silly controller:Grbl < $N0=
2020-07-04T16:34:29.926Z - silly controller:Grbl < $100=800.000
2020-07-04T16:34:29.928Z - silly controller:Grbl < $101=800.000
2020-07-04T16:34:29.931Z - silly controller:Grbl < $102=800.000
2020-07-04T16:34:29.933Z - silly controller:Grbl < $110=1000.000
2020-07-04T16:34:29.936Z - silly controller:Grbl < $111=1000.000
2020-07-04T16:34:29.938Z - silly controller:Grbl < $112=500.000
2020-07-04T16:34:29.941Z - silly controller:Grbl < $120=50.000
2020-07-04T16:34:29.943Z - silly controller:Grbl < $121=50.000
2020-07-04T16:34:29.946Z - silly controller:Grbl < $122=50.000
2020-07-04T16:34:29.949Z - silly controller:Grbl < $130=300.000
2020-07-04T16:34:29.957Z - silly controller:Grbl < $131=300.000
2020-07-04T16:34:29.959Z - silly controller:Grbl < $132=300.000
2020-07-04T16:34:29.960Z - silly controller:Grbl < ok
2020-07-04T16:34:30.520Z - debug service:cncengine socket.close("/dev/ttyUSB0"): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18339:25)
2020-07-04T16:34:30.850Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:30.883Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:32.097Z - debug service:cncengine socket.open("/dev/ttyUSB0", {"controllerType":"Grbl","baudrate":115200,"rtscts":false}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18269:25)
2020-07-04T16:34:32.099Z - debug controller:Grbl Add socket connection: id=uJ-p7hg2nL1vE3ikAAAC     at GrblController.addConnection (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9277:26)
2020-07-04T16:34:32.115Z - debug controller:Grbl Connected to serial port "/dev/ttyUSB0"     at SerialPort.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9211:28)
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:33.052Z - silly controller:Grbl > $$
2020-07-04T16:34:33.058Z - silly controller:Grbl < $0=3
2020-07-04T16:34:33.061Z - silly controller:Grbl < $1=250
2020-07-04T16:34:33.065Z - silly controller:Grbl < $2=0
2020-07-04T16:34:33.068Z - silly controller:Grbl < $3=0
2020-07-04T16:34:33.070Z - silly controller:Grbl < $4=0
2020-07-04T16:34:33.072Z - silly controller:Grbl < $5=1
2020-07-04T16:34:33.075Z - silly controller:Grbl < $6=0
2020-07-04T16:34:33.077Z - silly controller:Grbl < $10=1
2020-07-04T16:34:33.079Z - silly controller:Grbl < $11=0.010
2020-07-04T16:34:33.082Z - silly controller:Grbl < $12=0.002
2020-07-04T16:34:33.084Z - silly controller:Grbl < $13=0
2020-07-04T16:34:33.090Z - silly controller:Grbl < $20=0
2020-07-04T16:34:33.093Z - silly controller:Grbl < $21=0
2020-07-04T16:34:33.095Z - silly controller:Grbl < $22=0
2020-07-04T16:34:33.098Z - silly controller:Grbl < $23=3
2020-07-04T16:34:33.100Z - silly controller:Grbl < $24=200.000
2020-07-04T16:34:33.103Z - silly controller:Grbl < $25=2000.000
2020-07-04T16:34:33.105Z - silly controller:Grbl < $26=250.000
2020-07-04T16:34:33.107Z - silly controller:Grbl < $27=1.000
2020-07-04T16:34:33.109Z - silly controller:Grbl < $30=1.000
2020-07-04T16:34:33.112Z - silly controller:Grbl < $31=0.000
2020-07-04T16:34:33.114Z - silly controller:Grbl < $32=0
2020-07-04T16:34:33.117Z - silly controller:Grbl < $N1=
2020-07-04T16:34:33.119Z - silly controller:Grbl < $N0=
2020-07-04T16:34:33.121Z - silly controller:Grbl < $100=800.000
2020-07-04T16:34:33.124Z - silly controller:Grbl < $101=800.000
2020-07-04T16:34:33.126Z - silly controller:Grbl < $102=800.000
2020-07-04T16:34:33.128Z - silly controller:Grbl < $110=1000.000
2020-07-04T16:34:33.131Z - silly controller:Grbl < $111=1000.000
2020-07-04T16:34:33.133Z - silly controller:Grbl < $112=500.000
2020-07-04T16:34:33.136Z - silly controller:Grbl < $120=50.000
2020-07-04T16:34:33.138Z - silly controller:Grbl < $121=50.000
2020-07-04T16:34:33.141Z - silly controller:Grbl < $122=50.000
2020-07-04T16:34:33.143Z - silly controller:Grbl < $130=300.000
2020-07-04T16:34:33.167Z - silly controller:Grbl < $131=300.000
2020-07-04T16:34:33.169Z - silly controller:Grbl < $132=300.000
2020-07-04T16:34:33.170Z - silly controller:Grbl < ok
2020-07-04T16:34:33.938Z - debug service:cncengine socket.close("/dev/ttyUSB0"): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18339:25)

现在它死了:

2020-07-04T16:34:33.949Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:34.006Z - debug service:cncengine socket.list(): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18241:25)
2020-07-04T16:34:34.715Z - debug service:cncengine socket.open("/dev/ttyUSB0", {"controllerType":"Grbl","baudrate":115200,"rtscts":false}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18269:25)
2020-07-04T16:34:34.720Z - debug controller:Grbl Add socket connection: id=uJ-p7hg2nL1vE3ikAAAC     at GrblController.addConnection (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9277:26)
2020-07-04T16:34:34.740Z - debug controller:Grbl Connected to serial port "/dev/ttyUSB0"     at SerialPort.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:9211:28)
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:35.997Z - silly controller:Grbl > $$
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:38.137Z - silly controller:Grbl > $$
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:39.361Z - silly controller:Grbl > $$
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:40.193Z - silly controller:Grbl > $$
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:41.500Z - silly controller:Grbl > $?
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:42.764Z - silly controller:Grbl > $+
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:44.804Z - silly controller:Grbl > $L
", {"__sender__":"bb3c6791-7509-4c0d-aabb-e08bb3d15a75"}): id=uJ-p7hg2nL1vE3ikAAAC     at Socket.<anonymous> (/usr/lib/node_modules/cncjs/dist/cncjs/server/index.js:18379:25)
2020-07-04T16:34:47.609Z - silly controller:Grbl > $r

我在没有多个浏览器魔法的情况下获得了重现,只需从一个浏览器窗口连接-断开连接。

我在 cncjs 进程上做了 strace,它显然是写(“$$”)到 /dev/ttyUSB0 FD。

频繁连接断开场景下的奇怪 tty 行为 #467

我很快就要离开去参加 7 月 4 日的庆祝活动,所以我将无法在几个小时内与您详细合作。既然你似乎有很多调试技巧,我会给你一些探索的途径。

  1. 其他人报告了 CH34x 串行芯片的问题;配备 CP2102 的 ESP32 解决了这些问题。我自己在使用 CH340 时遇到过问题——在某些情况下它会使 Mac 计算机崩溃。我认为 Mac 问题是驱动程序中的错误。我只是提到这一点来支持我对 CH34x 的普遍不信任。

进一步调查此问题的一种方法是对 CH341 驱动程序进行一些内核级调试。我看到您可以使用 esptool 与驱动程序对话,但驱动程序仍然有可能以某种方式挂起,这只会影响 CNCjs 使用它的方式。

  1. CNCjs 领域的另一个问题来源是 nodejs 串口模块。通过在该模块中添加调试信息,您可能会获得更多线索。您可以在 node_modules/@serialport/bindings/lib/*.js 中模块的 Javascript 部分或从 node_modules/@serialport/bindings/src/serialport_unix.cpp 编译的系统相关二进制代码中进行调试。我现在没有时间给出完整的说明,但也许您已经知道如何重建节点模块或者可以从互联网上找到它。

  2. 另一种方法是创建一个 nodejs 测试程序,该程序以与 cncjs 类似的方式使用 serialport 模块,打开、发送 $$、关闭、重复。

  3. 最后,您可以尝试使用不同的 GRBL 控制器(如果有的话)。如果失败,它会指向 CNCjs 及其串口基础设施作为问题的原因。如果它成功了,它并没有告诉我们太多,因为 CH34x 芯片在 GRBL 系统中是不常见的,所以问题仍然可能在任何地方。

对不起,现在得走了。

频繁连接断开场景下的奇怪 tty 行为 #467
作者
齐帕 评论了 2020 年 7 月 5 日  

呃,我真的很抱歉,我有另一个设备与 CH34x uart 连接,并将其与 esp32 混淆了。问题发生在 CP210x 上。我用正确的描述更新了原始帖子。

频繁连接断开场景下的奇怪 tty 行为 #467

最后一个想法——来自 CH340 ESP32 的另一个问题报告与打开和关闭串行端口可能导致 ESP32 启用线上出现故障的假设一致,从而部分重置 ESP32 并使其进入奇怪的状态。该假设与您的结果一致。特别是,esptool 可以恢复它的事实可以解释为 esptool 显式地进行了完整的硬件重置,以便将 ESP32 置于引导加载程序模式。该重置涉及通过调制解调器控制信号控制某些线路,这些信号通过 ESP32 开发板上的交叉耦合锁存器。

频繁连接断开场景下的奇怪 tty 行为 #467

围绕 nodejs serialport 的调试思想仍然适用,即使使用 CP2102。调试愉快。现在真的必须离开了。,

免费注册 在 GitHub 上加入此对话。已有帐户? 登录评论
标签
漏洞有些东西不工作
项目

还没有

发展

没有分支机构或拉取请求

2名参加者
频繁连接断开场景下的奇怪 tty 行为 #467频繁连接断开场景下的奇怪 tty 行为 #467

喜欢 (0)