User avatar
Posts: 4778
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth Python script.

Wed Jul 19, 2017 5:37 pm

The problem of the OP was resolved (see the second post in this thread.) If that solution doesn't work for you, please provide additional information. If you are experiencing a different issue, please start a new thread with details.

Posts: 2
Joined: Sun Aug 27, 2017 5:47 am

Re: Bluetooth Python script.

Sun Aug 27, 2017 5:57 am

Traceback (most recent call last):
File "", line 20, in <module>
profiles = [ SERIAL_PORT_PROFILE ],
File "/usr/lib/python2.7/dist-packages/bluetooth/", line 176, in advertise_service
raise BluetoothError (str (e))
bluetooth.btcommon.BluetoothError: (2, 'No such file or directory')

I encountered the same problem, but could not find a detailed solution. Is it possible to provide a concrete solution

User avatar
Posts: 6
Joined: Thu Oct 22, 2015 9:22 pm

Re: Bluetooth Python script.

Mon Aug 28, 2017 11:33 am

Have you looked at the Bluedot library from @LetHopeItsSnowing? ... erver.html

You might find that an easier way to do what you want.

Posts: 2
Joined: Sun Aug 27, 2017 5:47 am

Re: Bluetooth Python script.

Mon Aug 28, 2017 1:46 pm

I found a solution. Do not know can solve the problem, I have not down to test. There will not be such a mistake.
The workaround is to add the following to / etc / bluetooth / main.conf:
    DisablePlugins = pnat
Reference: ... unication/

解决方法是将以下内容添加到/ etc / bluetooth / main.conf中:
DisablePlugins = pnat
参考: ... unication/

I'm not sure if this method is available

Posts: 1
Joined: Fri Feb 08, 2019 9:56 am

Re: Bluetooth Python script.

Fri Feb 08, 2019 10:02 am

Currently, the most widely documented way to communicate with Python over Bluetooth is to use PyBluez. Previously, PyBluez only supported Python 2. In January 2014, they released a Python 3 version.
Python 3.3’s native Python sockets support Bluetooth communication. Unfortunately, there is very little documentation available describing how to use Python sockets to communicate over Bluetooth. While using Bluetooth with these sockets might be easy for someone who already knows how to use Python sockets, the lack of documentation leaves many people unaware that this method of using Bluetooth even exists. Since PyBluez was ported to Python 3, the use of native Python sockets has limited use.

Return to “General discussion”