[SOLUTIONS] For your troubleshooting!!
Using "PyBlueZ" and not "Bgapi"
#This line: pip install -r ./requirements/bluez.txt
#Results in error:
bluez/btmodule.h:5:33: fatal error: bluetooth/bluetooth.h: No such file or directory
#Solution: sudo apt-get install libbluetooth-dev
#NOTE: You then hit error:
virtual memory exhausted: Cannot allocate memory
#NOTE: Raspberry Pi has 100mb swap. So, increase to 1024... (I saw the compile use up to #70% of the Raspberry Pi memory after this adjustment)
Solution:
Edit the swap configuration:
sudo nano /etc/dphys-swapfile #Change line: CONF_SWAPSIZE=100 to CONF_SWAPSIZE=1024 #Need to restart the swap service: sudo /etc/init.d/dphys-swapfile restart
Can verify swap by:
free -m
Ok, now you run the line:
./bin/serve.sh --ble_driver pybluez --ble_device hci0 web_ui
But it won't work as you will need to install Node, Angular JS and Bower like this:
#NOTE: Bower (https://bower.io/) is a dependency management tool. #Bower js is used for managing front end components like html, css, js.
Install Node:
sudo apt-get install nodejs npm node-semver
Install Bower:
sudo npm install -g bower
Install Angular:
bower install angular
#Still doesn't work after all this on Raspberry Pi 3. Due to this error:
pypush RuntimeError: Set scan parameters failed (are you root?)
Appears because HCI0 is the internal Bluetooth. To fix (from a previously closed issue):
sudo apt-get install libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libical-dev libreadline-dev libudev-dev libusb-dev glib2.0 bluetooth bluez libbluetooth-dev
#Then:
sudo hciconfig hci0 up