With minor fixes, the port should also work with older Raspberry Pi models that use the [RedBear pHAT](https://redbear.cc/product/rpi/iot-phat.html). See TODO at the end.
Alternatively, just plug-it in via Ethernet - unless you have a Raspberry Pi Zero W.
### Enable SSH
Create an empty file called 'ssh' in the root folder of the SD Card to enable SSH.
### Boot
If everything was setup correctly, it should now boot up and join your Wifi network. You can reach it via mDSN as 'raspberrypi.local'.
### Disable bluez
By default, bluez will start up using the the BCM4343. To make it available to BTstack, you can disable its system services:
$ sudo systemctl disable hciuart
$ sudo systemctl disable bthelper
$ sudo systemctl disable bluetooth
and if you don't want to restart, you can stop them right away. Otherwise, please reboot here.
$ sudo systemctl stop hciuart
$ sudo systemctl stop bthelper
$ sudo systemctl stop bluetooth
If needed, they can be re-enabled later as well.
## Compilation
The Makefile assumes cross-compilation using the regular GCC Cross Toolchain for gnueabihf: arm-linux-gnueabihf-gcc. This should be available in your package manager. Read on for a heavy, but easy-to-use approach.
### Compile using Docker
For non-Linux users, we recommend to use a [Raspberry Pi Cross-Compiler in a Docker Container](https://github.com/sdt/docker-raspberry-pi-cross-compiler).
Please follow the installation instructions in the README.
Then, setup a shared folder in Docker that contains the BTstack repository.
Now, go to the BTstack repository and 'switch' to the Raspberry Pi Cross-Compiler container:
$ rpxc bash
The default images doesn't have a Python installation, so we manually install it:
$ sudo apt-get install python
Change to the port/raspi folder inside the BTstack repo:
$ cd btstack/port/raspi
and compile as usual:
$ make
For regular use, it makes sense to add Python permanently to the Docker container. See documentation at GitHub.
## Running the examples
Copy one of the examples to the Rasperry Pi and just run them. BTstack will always power cycle the Bluetooth Controller.