I’ve spent the day trying to figure out how to talk with an arduino bluetooth module via python on a fin+cm3 and have hit quite a few walls. Most folks use PyBluez, and this was the initial route that I took, but I abandoned it after many dead ends. There’s evidence of others struggling with this here and here with varying success. Unfortunately it looks like the only options are editing an unsupported read-only system config file or settling for network_mode: host, but neither is a sure fire solution IMO.
Now I’m trying to use the new socket.AF_BLUETOOTH in Python 3.3. However, I quickly discovered that the python base images are not compiled with bluetooth support.
import sysconfig print(sysconfig.get_config_vars()['HAVE_BLUETOOTH_H'])
Outputs ‘0’ - in other words no bluetooth support.
bluetooth.h is provided by
libbluetooth-dev so I tried editing the fincm3-python base image and adding
libbluetooth-dev to the installed packages prior to python getting installed but it makes no difference. It’s my understanding that you must compile python from source to enable bluetooth support.
Probably something like:
# install bluetooth headers apt-get install libbluetooth-dev ... # configure python and make CFLAGS=-I/usr/include/bluetooth ./configure
will do the trick.
Is there a reason why this isn’t included in the current python images?
Can we get this feature?