Jetson NanoでGATTサーバーを起動しようとするとアクセス拒否エラーが発生する

Jetson NanoでGATTサーバーを起動しようとするとアクセス拒否エラーが発生する

次のコマンドを使用してGATTサーバーアプリケーションを作成しています。この記事基本的に。私の初期コードはLinuxラップトップでうまく動作しますが、Jetson Nano(nVIDIAチューニングバージョンのUbuntu 18.04を実行)では、インターフェイスを介してデーモンにアクセスしようとするとorg.freedesktop.DBus.Error.AccessDeniedエラーが発生し、失敗します。bluetoothdorg.freedesktop.DBus.Introspectable

これは明らかにある種の権限エラーです。 Nanoで実行するとコードは正常に実行されますが、rootユーザーrootではなくユーザーで実行すると失敗するためです。 Bluetooth APIにアクセスするには、非rootユーザーがこのグループのメンバーである必要があることを知っていますが、bluetoothこれはすでに私のユーザーのためであり、問​​題ではありません。

ベストアンサー1

不明な理由から、Jetson NanoのD-Bus経由でBluetoothインターフェイスにプログラムでアクセスするには、設定ファイルorg.freedesktop.DBus.Introspectableのインターフェイスへの明示的なアクセスを追加する必要があるようです。/etc/dbus-1/system.d/bluetooth.confこれは、Ubuntu環境をカスタマイズするnVIDIAの副作用である可能性が高いです。参照するには、以下のコードスニペットを参照してください。

<policy user="root">
  <allow own="org.bluez"/>
  <allow send_destination="org.bluez"/>
  <allow send_interface="org.bluez.Agent1"/>
  <allow send_interface="org.bluez.MediaEndpoint1"/>
  <allow send_interface="org.bluez.MediaPlayer1"/>
  <allow send_interface="org.bluez.Profile1"/>
  <allow send_interface="org.bluez.GattCharacteristic1"/>
  <allow send_interface="org.bluez.GattDescriptor1"/>
  <allow send_interface="org.bluez.LEAdvertisement1"/>
  <allow send_interface="org.freedesktop.DBus.Introspectable"/> <!-- Added this -->
  <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
  ...

おすすめ記事