无法通过串口读取数据
我正在尝试读取串行端口上的数据。
我的设置
- 操作系统:Ubuntu linux
- 设备 1:BeagleBoard
- 设备 2:我的笔记本电脑
我正在使用串口转 USB 转换器。在 BeagleBoard 上,串行设备是 ttyS2。在笔记本电脑上,它是 ttyUSB0
。
我做了一个简单的事情来测试连接,我在两台机器上运行 Minicom。当我在 BeagleBoard 上输入内容时,我会在笔记本电脑上收到数据,但反之则不然。可能是什么原因?
两台设备的串口设置均为
- 波特率:115200
- 数据大小:8
- 奇偶校验:N
- 停止位:1
- 硬件流控制:无
I am trying to read data on a serial port.
My setup
- OS: Ubuntu linux
- Device 1: BeagleBoard
- Device 2: My laptop
I am using a serial to usb converter. On the BeagleBoard, the serial device is ttyS2
. On the laptop, it is ttyUSB0
.
I did a simple thing to test the connection, I ran Minicom on both the machines. When I type something on BeagleBoard I receive data on laptop but it doesn't work the opposite way. What can be the reason?
The setting for serial port on both the devices are
- Baud rate: 115200
- Data size: 8
- Parity:N
- stop bit:1
- Hardware flow control : no
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是否是您的笔记本电脑上的文件权限限制过多?我在ubuntu上也遇到了类似的问题,通过更改文件权限解决了它。您可以通过执行以下操作来测试这一点:
注意,重置连接时这些权限将被恢复。对于长期解决方案,您必须通过编辑
/etc/group
将自己添加到dialout
组。Could it be that your file permissions are too restrictive on your laptop? I had a similar problem on ubuntu, and solved it by changing the file permissions. You could test this by doing:
Note, these permissions will be reverted when you reset the connection. For a long tem solution you'll have to add yourself to the
dialout
group by editing/etc/group
.