Obexpushd无法通过蓝牙进行初始化

时间:2015-10-26 23:55:03

标签: bluetooth raspberry-pi

我对Raspberry Pi相对较新,并试图通过我的Raspberry Pi上的蓝牙接收数据。我选择使用obexpushd并安装了所需的所有蓝牙套件。但是,当我运行命令

obexpushd -B -n 

初始化obexpushd并让它听取任何传入的蓝牙消息,它给我这个错误信息:

Listening on bluetooth/[00:00:00:00:00:00]:9   
SDP session setup failed, disabling bluetooth  
net_init() failed

我非常确定我已正确配对并正确连接了Raspberry Pi和设备,因此我不知道为什么它无法正常工作。

3 个答案:

答案 0 :(得分:3)

您的蓝牙sdp存在问题。试着阻止它

$ sudo service bluetooth stop

然后重启

$ sudo bluetoothd --compat

我有同样的问题,对我有用。

答案 1 :(得分:0)

Subert的答案为我工作,我想知道hci是不可发现的。 除了Subert的答案:

service bluetooth stop
bluetoothd --compat &
obexpushd -B -n &

对我来说,hciconfig已关闭,所以我开始了:

hciconfig hci0 up

现在一切都很好, 感谢subert的回答。

答案 2 :(得分:0)

虽然@Subert是正确的,但在compat模式下运行守护程序的更好方法是扩展systemd脚本。此解决方案允许您使用启动/停止脚本,并且可以在任何更新后继续使用。

使用以下内容创建文件 /etc/systemd/system/bluetooth.service.d/compat.conf

[Service]
ExecStart=/usr/lib/bluetooth/bluetoothd —compat

我决定将文件命名为 compat.conf ,但您可以随意命名。

重新加载&重启守护进程,你就完成了!

$ sudo systemctl daemon-reload
$ sudo service bluetooth restart

我不必运行hciconfig命令,但必须以root身份运行obexpushd(使用sudo),直到找到更好的方法。