我有Bluno纳米,我想连接我的pc(Ubuntu 16.06)并通过蓝牙接收信息。一些在线问答,但无法让它发挥作用。
$ bluetoothctl,#配对设备)配对。$ sudo rfcomm bind 0 F4:5E:AB:AA:BB:CC 1但我看不到/dev/rfcomm0。我需要创建任何配置文件吗?
到蓝牙的连接由以下命令完成
$ rfkill list all
$ sudo rfkill unblock bluetooth
$ sudo hciconfig hci0 up
$ sudo bluetoothctl
[bluetooth]# power on
[bluetooth]# discoverable on
[bluetooth]# agent on
[bluetooth]# pairable on
[bluetooth]# scan on
[bluetooth]# scan off
[bluetooth]# connect F4:5E:AB:AA:BB:CC
[bluno]# pair F4:5E:AB:AA:BB:CC
[bluno]# trust F4:5E:AB:AA:BB:CC发布于 2018-04-15 02:26:24
这种方法对我有效。
在与设备配对并成功连接之后,发现在远程设备上使用rfcomm的服务:
sdptool browse
sdptool browse 12:34:56:78:11:22注意所有可能的rfcomm及其信道(remote_channel)
现在在我们的机器上创建一个虚拟的rfcomm设备:
rfcomm listen /dev/rfcomm0 2您可以用任何值替换2。这是我们的频道
然后将远程rfcomm绑定到我们的虚拟rfcomm设备:
sudo rfcomm bind
sudo rfcomm bind /dev/rfcomm0 12:34:56:78:11:22 2如果你喜欢一个班轮
rfcomm bind 0 12:34:56:78:11:22 1您可以通过发送测试AT命令来检查它是否正常工作。
首先安装picocom:
sudo apt install picocom然后检查设备是否存在:
ls /dev/rfcomm*然后在rfcomm上启动picocom:
sudo picocom -c /dev/rfcomm0-c使命令在键入时可见
你有时会像这样
picocom v2.2
port is : /dev/rfcomm0
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
terminal is ready现在键入AT并按enter键。如果你没事,那它就起作用了。
https://askubuntu.com/questions/1025080
复制相似问题