現在、Bluetooth経由で2つのボード間にPAN接続を実装したいと思います。
最初のボードはRaspberry Pi Zeroで、2番目のボードはAtmel Sama5d2に基づいたカスタムボードです。
マザーボードはそれぞれLinux 4.9.75+とLinux 4.9.30を実行し、BlueZ v5.43とBlueZ v5.46を使用します。
両方のボードを使用して、携帯電話のテザリングされたBluetooth接続に接続できます。BT-ファンスクリプト。
私の携帯電話の有線接続の接続追跡です。
# bt-pan --debug client 60:45:CB:2F:C6:4C --wait
DEBUG:root:Using local device (addr: B8:27:EB:20:54:45): /org/bluez/hci0
DEBUG:root:Using remote device (addr: 60:45:CB:2F:C6:4C): /org/bluez/hci0/dev_60_45_CB_2F_C6_4C
DEBUG:root:Connected to network (dev_remote: /org/bluez/hci0/dev_60_45_CB_2F_C6_4C, addr: 60:45:CB:2F:C6:4C) uuid 'nap' with iface: bnep0
これまでに行ったことは次のとおりです(rpiをクライアントとして使用し、カスタムボードをサーバーとして使用)。
ボードがペアリングされました。
サービス端末
[bluetooth]# paired-devices
Device B8:27:EB:20:54:45 raspberrypi[/code]
顧客
[bluetooth]# paired-devices
Device 00:16:A4:0A:15:13 BlueZ 5.46
サーバー側でブリッジインターフェイスを設定する
#brctl addbr bnep0
#brctl setfd bnep0 0
#brctl stp bnep0 off
#ip addr add 10.5.0.5/255.255.0.0 dev bnep0
#ip link set bnep0 up
サーバー側でbt-panスクリプトをサーバーとして起動します。
#bt-pan --debug server bnep0
DEBUG:root:Using local device (addr: 00:16:A4:0A:15:13): /org/bluez/hci0
DEBUG:root:Registered uuid 'nap' with bridge/dev: bnep0 / 00:16:A4:0A:15:13
クライアントからクライアントへ bt-pan スクリプトを起動します。
# bt-pan --debug client 00:16:A4:0A:15:13 --wait
DEBUG:root:Using local device (addr: B8:27:EB:20:54:45): /org/bluez/hci0
DEBUG:root:Using remote device (addr: 00:16:A4:0A:15:13): /org/bluez/hci0/dev_00_16_A4_0A_15_13
Traceback (most recent call last):
File "/usr/bin/bt-pan", line 238, in <module>
if __name__ == '__main__': sys.exit(main())
File "/usr/bin/bt-pan", line 210, in main
try: iface = net.Connect(opts.uuid)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "Connect" with signature "s" on interface "org.bluez.Network1" doesn't exist
私が理解したところによると、私のBluetoothデバイスにはConnect
インターフェイスをエクスポートする方法がないようです。org.bluez.Network1
ネットワークプロファイルがサポートされていない理由を知っている人はいますか?
このエラーを解決するための回避策はありますか?
ベストアンサー1
ついに問題が何であるかを見つけました。
私がやっていることには2つの問題があります。
1. サーバー側でPANを有効にしてペアリングします。
PANプロファイルはbt-panスクリプトによって生成されるため、ペアリングが完了したときにPANプロファイルが存在しない場合、クライアントはリモートデバイスにPANプロファイルがあることを知らず、接続方法がないというエラーが発生します。リモートインターフェース
2. サーバーはクライアントを信頼する必要があります。
サーバーは信頼できるデバイスの接続のみを許可します。サーバーがペアリングを開始するとクライアントは自動的に信頼されますが、クライアントがペアリングを開始するとクライアントはサーバー側の信頼できるデバイスのリストにないため、接続時に受け入れられません。入力/出力エラー。
サーバーは、ペアリングを開始した後にクライアントを信頼したり、自分でペアリングを開始したりできます。