Raspi - DBUS - Bluez: 'org.freedesktop.DBus.Properties' インターフェイスに 's' 署名を持つ 'GetAll' メソッドは存在しません。

Raspi - DBUS - Bluez: 'org.freedesktop.DBus.Properties' インターフェイスに 's' 署名を持つ 'GetAll' メソッドは存在しません。

次の問題に直面しました。 Bluetooth APIを使用するGoで書かれたアプリケーションがあります。アプリケーションは、Windows用にコンパイルされ、実行されると機能します。私のRaspberry Pi用にコンパイルすると、アプリケーションは失敗します。問題が何であるかについてのヒントを得るためにインターネットを検索しました。アプリケーションで次のエラーが発生します。

Properties.GetAll org.bluez.Device1: Method "GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties" doesn't exist

明らかにdbus文書を読み取るとき、メソッドは指定された署名を持つインターフェイスに存在する必要があります。そのため、dbusのインストールに問題がある可能性があります。

このエラーが発生したいくつかのケースが見つかりましたが、解決策が記載されているケースはありません。

解決策を見つけるのを助けるために、linuxquestionsフォーラムで提供されているコマンドを実行しました。

$ dbus-send --system --dest=org.bluez --type=method_call --print-reply /org/bluez/hci0/dev_xx_xx_xx_xx_xx_xx org.freedesktop.DBus.Properties.GetAll string:org.bluez.Device1
Error org.freedesktop.DBus.Error.UnknownObject: Method "GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties" doesn't exist

これは、私が実行しているアプリケーションの問題ではなく、Raspberry Pi自体の問題であることを示しています。 Pythonで書かれた他のアプリケーションがBluetooth接続を正常に作成できたため、ハードウェアの問題は除外されました。

私のシステムに関する追加情報は次のとおりです。

$ rfkill
ID TYPE      DEVICE      SOFT      HARD
 0 wlan      phy0     blocked unblocked
 1 bluetooth hci0   unblocked unblocked

$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

$ apt -qq list bluez
bluez/oldstable,now 5.55-3.1+rpt2+deb11u1 armhf  [installed,automatically]

インストールに問題がありますか?どうすれば解決できますか?

ベストアンサー1

リクエストに誤ったオブジェクトパスが定義されているようです。 bluezサービスのすべてのオブジェクトを取得し、/org/bluez/hci0/dev_xx_xx_xx_xx_xx_xx実際に存在することを確認するには、次のコードスニペットを使用することをお勧めします。

dbus-send --system --dest=org.bluez  --print-reply /  org.freedesktop.DBus.ObjectManager.GetManagedObjects

おすすめ記事