我正在尝试将连接到Arduino Uno的HC-05蓝牙模块与我的Raspberry Pi 3连接起来,以实现两者之间的蓝牙通信,从Uno向Pi发送数据。然而,尝试使用Bluetoothctl配对、连接和信任HC-05设备似乎失败了。请帮我看看问题出在哪里。
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# agent on
Agent registered
[bluetooth]# scan on
[CHG] Device 98:D3:31:FB:6F:F1 LegacyPairing: yes
[CHG] Device 98:D3:31:FB:6F:F1 RSSI: -43
[bluetooth]# pair 98:D3:31:FB:6F:F1
Attempting to pair with 98:D3:31:FB:6F:F1
[CHG] Device 98:D3:31:FB:6F:F1 Connected: yes
Request PIN code
[agent] Enter PIN code: 1234
[CHG] Device 98:D3:31:FB:6F:F1 Paired: yes
Pairing successful
[CHG] Device 98:D3:31:FB:6F:F1 Connected: no
[bluetooth]# connect 98:D3:31:FB:6F:F1
Attempting to connect to 98:D3:31:FB:6F:F1
[CHG] Device 98:D3:31:FB:6F:F1 Connected: yes
Failed to connect: org.bluez.Error.NotAvailable
[CHG] Device 98:D3:31:FB:6F:F1 Connected: no
[bluetooth]# trust 98:D3:31:FB:6F:F1
[CHG] Device 98:D3:31:FB:6F:F1 Trusted: yes
Changing 98:D3:31:FB:6F:F1 trust succeeded
这里是信息提示。
[bluetooth]# info 98:D3:31:FB:6F:F1
Device 98:D3:31:FB:6F:F1
Name: HC-05
Alias: HC-05
Class: 0x001f00
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: yes
UUID: Serial Port (00001101-0000-1000-8000-00805f9b34fb)
我遇到的问题是"无法连接:org.bluez.Error.NotAvailable"
我不确定如何解决这个错误,如果不能确认两个微处理器之间的蓝牙信号是否链接,我将无法完成我的项目。
谢谢, Aditya