One of our products uses a combined Wifi/BT card to communicate with other devices. Therefore we are using bluez5 and we already evaluated that bluetooth itself is working fine. Now i want to send HCI commands within a python script. Starting with pyhton 3.3 the socket module can be used to communicate with bluetooth. However i am getting the error shown below… After some time i was able to track down the problem. During the bitbake process of the python3 module, the configure script searches for “bluetooth.h” which cannot be found at this time. Because of that the bluetooth socket feature is not compiled into python3. In fact, the mentioned header file is provided by “bluez5-dev”. When i try to add bluez5 as DEPENDS in the python3.5.3.bb recipe i am getting the error that “nativesdk-bluez5” cannot be build. So, the question is, how can i enable the bluetooth socket for python? Thanks in advance.
Python 3.5.3 (default, May 13 2020, 16:41:24) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_RAW, socket.BTPROTO_HCI) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'