树莓派:PyBluez服务(UUID)未找到(sdptool+安卓应用)

2024-04-26 23:27:44 发布

您现在位置:Python中文网/ 问答频道 /正文

根据pybluez:https://github.com/karulis/pybluez/blob/master/examples/simple/rfcomm-server.py的例子,我试图在raspberry pi上编写一个简单的蓝牙服务器套接字

我试着从Android应用程序中连接。在

当我运行Android应用程序时,我无法连接到服务器套接字。当我显示Android看到的uuid时,我得到了以下列表,其中不包含PI上的实际服务:

08-05 22:11:33.806  13510-13510/ch.erni.btlintilla D/DevName﹕ RichPi
08-05 22:11:33.806  13510-13510/ch.erni.btlintilla D/UUID﹕ 0000112d-0000-1000-8000-00805f9b34fb
08-05 22:11:33.806  13510-13510/ch.erni.btlintilla D/UUID﹕ 0000110e-0000-1000-8000-00805f9b34fb
08-05 22:11:33.806  13510-13510/ch.erni.btlintilla D/UUID﹕ 00001112-0000-1000-8000-00805f9b34fb
08-05 22:11:33.806  13510-13510/ch.erni.btlintilla D/UUID﹕ 0000111f-0000-1000-8000-00805f9b34fb
08-05 22:11:33.806  13510-13510/ch.erni.btlintilla D/UUID﹕ 00000000-0000-1000-8000-00805f9b34fb
08-05 22:11:33.806  13510-13510/ch.erni.btlintilla D/UUID﹕ 00000000-0000-1000-8000-00805f9b34fb

然后我在PI上运行sdptool browse,没有发现任何设备。在

我已经尝试过类似线程中提到的不同解决方案(DisablePlugins=pnat,在启动服务之前配对)。感谢任何帮助。在

下面是用于在py上创建服务器套接字的示例代码。在

^{pr2}$

Tags: pyhttpsgithub服务器com应用程序uuidpi