在Debian Jesse8.2上:我尝试创建以下设备: /dev/rfcomm0,以便通过蓝牙模块HC-05连接我的arduino,但没有成功。下面是我正在遵循的步骤:
1)我猜我的名为FOO的HC-05是被识别并正确配置的,因为
hcitool scan报告
98:D3:31:xx:xx:xx FOOxx只是我在这里用来保护隐私的一个面具。
2)我添加了/etc/bluetooth/rfcomm.conf文件
rfcomm0 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
device 98:D3:31:xx:xx:xx;
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "FOO";
}3)我重启了蓝牙服务
sudo /etc/init.d/bluetooth restart响应为:
[ ok ] Restarting bluetooth (via systemctl): bluetooth.service.但是,不会创建device rfcomm0。我按照这里的说明操作:
Bluetooth serial communication with HC-05
几个月前,我在另一个Linux系统(它是ubuntu)上做了这个操作,我记得一切都很顺利:端口已经创建好了。也许我遗漏了一些重要的步骤!
非常感谢,瓦莱里奥
更新:
此命令
sdptool records 98:D3:31:xx:xx:xx报告
Service Name: Dev B
Service RecHandle: 0x10000
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100我认为这证实了rfcomm.conf中的通道是1
发布于 2015-11-25 23:38:12
好了,多亏了Kaylum,这个问题解决了!
手动绑定将创建设备rfcomm0
sudo rfcomm bind 0 98:D3:31:xx:xx:xx 1然后,为了让处理在创建的端口上写/读,我需要以sudoer身份运行处理,否则处理会说端口存在但很忙。作为sudoer,我可以确认端口正确地在Arduino和Processing之间来回发送数据!
https://stackoverflow.com/questions/33892280
复制相似问题