【问题标题】:Obexpushd Can't Initialize Via BluetoothObexpushd 无法通过蓝牙初始化
【发布时间】:2015-10-26 23:55:03
【问题描述】:

我对 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 和设备,所以我不知道为什么它不工作。

【问题讨论】:

    标签: bluetooth raspberry-pi


    【解决方案1】:

    您的蓝牙 sdp 有问题。尝试停止它

    $ sudo service bluetooth stop
    

    然后重启

    $ sudo bluetoothd --compat
    

    我遇到了同样的问题,它对我有用。

    【讨论】:

    • 我也有同样的问题,我在 11:22:33:44:55:66 连接到 SDP 服务器失败:主机已关闭,因为我尝试了上述方法。
    【解决方案2】:

    Subert 的回答对我有用,我想知道 hci 无法被发现。 除了 Subert 的回答:

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

    对我来说,hciconfig 已关闭,因此我将其启动为:

    hciconfig hci0 up
    

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

    【讨论】:

      【解决方案3】:

      虽然@Subert 是正确的,但在兼容模式下运行守护程序的更好方法是扩展 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),直到我找到更好的方法。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-07-16
        • 2014-10-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-08-17
        • 2023-04-09
        • 1970-01-01
        相关资源
        最近更新 更多