How to connect pybluez RFCOMM server socket on Debian?

吃可爱长大的小学妹 提交于 2019-12-06 03:36:44
user1840255

I offered a bounty, but found the solution myself. :) Posted on another answer but this may also apply to your problem. On certain versions of Debian (Raspbian etc) and maybe some others distros. The server_sock.accept() will by default just hang and never accept a connection - even from a paired device! I'm in some cases even convinced the socket isn't open at all. However, a solution to this is really simple.

Update your /etc/bluetooth/main.conf file, add a line or change the existing so it looks like this:

DisablePlugins = pnat

Then restart the Bluetooth service:

sudo invoke –rc.d bluetooth restart

It now MAY have been fixed.

Good luck!

Reference: RFCOMM without pairing using PyBluez on Debian?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!