1. Prepare a RaspiOS SD card. I used the official RaspPi imager tool.
  2. (optional) Install waveshare touchscreen drivers/ config

Add the following lines to the config.txt file

hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1
dtoverlay=waveshare-ads7846,penirq=25,xmin=200,xmax=3900,ymin=200,ymax=3900,speed=50000

Download the waveshare-ads7846.dtbo file . Copy the .dtbo file to the overlays directory (/boot/overlays/).

  1. Install bluetooth drivers.

    sudo apt install bluez bluetooth
    sudo systemctl enable bluetooth
    sudo systemctl start bluetooth
  2. Set Bluetooth controller transport mode to BLE only.

Open the bluetooth config file.

sudo nano /etc/bluetooth/main.conf

Find the line with :

#ControllerMode = dual

Replace with:

ControllerMode = le
  1. Check for soft/hard blocks.
    rfkill list bluetooth

    If any are blocked, run :

    sudo rfkill unblock bluetooth

    Restart Bluetooth.

    sudo systemctl restart bluetooth
  2. Create a virtual Python environment. Install python libraries.
    python3 -m venv ble_env
    source ble_env/bin/activate
    pip install "qrcode[pil]"
    pip install bleak