User avatar
Douglas6
Posts: 4759
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.

damncat
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 "rfcomm-server.py", line 20, in <module>
profiles = [ SERIAL_PORT_PROFILE ],
File "/usr/lib/python2.7/dist-packages/bluetooth/bluez.py", 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
uk_baz
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?

http://www.stuffaboutcode.com/2017/07/p ... erver.html


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

damncat
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: http://blog.davidvassallo.me/2014/05/11 ... unication/

我找到了一个解决方案。不知道能不能解决问题,我还没有往下进行测试。现在不会出现这样的错误。
解决方法是将以下内容添加到/ etc / bluetooth / main.conf中:
DisablePlugins = pnat
参考:http://blog.davidvassallo.me/2014/05/11 ... unication/

I'm not sure if this method is available
我不确定这个方法是否可以

yashnnit
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”