Skip to content

Commit 1d6f65a

Browse files
committed
Modify README
1 parent 7bd553d commit 1d6f65a

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,43 @@ If it cannot be displayed, please open:
140140

141141
- deploy.sh: This script is used to generate new release version numbers and tag.
142142
Used only by the program publisher.
143+
144+
#### Test
145+
146+
- Ubuntu
147+
- Install socat
148+
149+
$ sudo apt update
150+
$ sudo apt install socat
151+
152+
- Create a pair of virtual serial ports
153+
154+
$ sudo socat -d -d pty,raw,echo=0 pty,raw,echo=0
155+
156+
- After running, it will display:
157+
158+
2025/12/03 14:09:27 socat[31902] N PTY is /dev/pts/5
159+
2025/12/03 14:09:27 socat[31902] N PTY is /dev/pts/6
160+
2025/12/03 14:09:27 socat[31902] N starting data transfer loop with FDs [5,5] and [7,7]
161+
162+
- Create symbolic links (optional, for better naming).
163+
164+
$ sudo ln -sf /dev/pts/2 /dev/ttyVCOM0
165+
$ sudo ln -sf /dev/pts/3 /dev/ttyVCOM1
166+
167+
- The above two steps can be combined into the following command.
168+
169+
$ sudo socat -d -d pty,link=/dev/ttyVCOM0,raw,echo=0 pty,link=/dev/ttyVCOM1,raw,echo=0
170+
171+
- You can now use this program to open the serial port. `/dev/pts/5`(/dev/ttyVCOM0) and `/dev/pts/6`(/dev/ttyVCOM1).
172+
Because these serial port names are non-standard, this program cannot find them.
173+
You can enter the following in the "Serial Port" field: `/dev/pts/5`
174+
Because the virtual serial port was created with root privileges, this program also needs to be run with root privileges.
175+
176+
$ sudo serialportassistant
177+
178+
  Alternatively, authorize the serial port to the current user:
179+
180+
$ sudo chown $USER:tty /dev/pts/5
181+
$ sudo chown $USER:tty /dev/pts/6
182+
$ serialportassistant

README_zh_CN.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,42 @@
133133
此脚本生成 AppImage 可执行文件。 详见:https://github.com/linuxdeploy/linuxdeploy/
134134

135135
- deploy.sh: 此脚本用于产生新的发行版本号和标签。仅程序发布者使用。
136+
137+
#### 测试
138+
139+
- 在 linux 上
140+
- 安装 socat
141+
142+
$ sudo apt update
143+
$ sudo apt install socat
144+
145+
- 创建一对虚拟串口
146+
147+
$ sudo socat -d -d pty,raw,echo=0 pty,raw,echo=0
148+
149+
- 运行后会显示:
150+
151+
2025/12/03 14:09:27 socat[31902] N PTY is /dev/pts/5
152+
2025/12/03 14:09:27 socat[31902] N PTY is /dev/pts/6
153+
2025/12/03 14:09:27 socat[31902] N starting data transfer loop with FDs [5,5] and [7,7]
154+
155+
- 创建符号链接(可选,为了更好的命名)
156+
157+
$ sudo ln -sf /dev/pts/2 /dev/ttyVCOM0
158+
$ sudo ln -sf /dev/pts/3 /dev/ttyVCOM1
159+
160+
- 可以把上面两步合成以下一条命令
161+
162+
$ sudo socat -d -d pty,link=/dev/ttyVCOM0,raw,echo=0 pty,link=/dev/ttyVCOM1,raw,echo=0
163+
164+
- 现在可以用本程序打开串口 `/dev/pts/5`(/dev/ttyVCOM0) 和 `/dev/pts/6`(/dev/ttyVCOM1)。
165+
  因为这些串口命名为非标准串口命名,本程序可以找不到它。你可以在"串口"输入: /dev/pts/5
166+
  因为虚拟串口建立时,是以 root 权限建立的,所以也需要使用 root 权限运行本程序。
167+
168+
$ sudo serialportassistant
169+
170+
或者把串口授权为当前用户。
171+
172+
$ sudo chown $USER:tty /dev/pts/5
173+
$ sudo chown $USER:tty /dev/pts/6
174+
$ serialportassistant

0 commit comments

Comments
 (0)