Hi @ all,
I working on a composed setup for running my rpi3 as a flic-host.
Flic is a little bluetooth-button which can connect to your smartphone or other linux based bluetooth devices.
The idea is to use the flic-library (here), which is basically a bluetooth connector to find an manage your buttons, and a mosquito instance to publish the button events via MQTT.
My docker-compose should create two containers one with the flic-host and one with the mosquito instance.
But i cannot get bluetooth working within the composed setup.
Within a single container configuration my flic-container just works fine with the following Dockerfile:
FROM resin/raspberrypi3-debian:jessie
# Configure
EXPOSE 5551
WORKDIR /usr/src/app
# Copy files
COPY bootstrap /bootstrap
COPY data /data
COPY app /usr/src/app
# Install requirements
RUN apt-get update -y && apt-get dist-upgrade -y && apt-get upgrade -y && \
apt-get install -y $(cat /bootstrap/deps/apt.list | tr '\n' ' ') && \
pip3 install -r /bootstrap/deps/pip.list && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy flicd executable
RUN git clone https://github.com/50ButtonsEach/fliclib-linux-hci /bootstrap/flic/src && \
cp /bootstrap/flic/src/bin/armv6l/flicd /usr/bin/flicd && \
chmod +x /usr/bin/flicd
# Tidy up
RUN rm -rf /bootstrap
# Start
ENTRYPOINT ["/usr/bin/flicd", "-f", "/data/flic.db", "-s", "0.0.0.0", "-p", "5551"]
Where ‘/bootstrap/deps/apt.list’ contains:
dbus
systemd-sysv
bluez
bluez-firmware
git
python3
python3-pip
and ‘/bootstrap/deps/pip.list’ contains:
asyncio
paho-mqtt
The resulting log is:
Available HCI devices found:
hci0
Trying hci0
Successfully bound HCI socket
Flic server is now up and running!
Warning: Bluetooth controller does not support pending connection and scanning at the same time. Will emulate this as good as possible.
Initialization of Bluetooth controller done!
Which is fine.
when I embed this into the following ‘docker-compose.yml’:
version: '2'
services:
flic:
build: ./flic
privileged: true
restart: always
ports:
- "5551:5551"
I get this log:
opening bluetooth socket failed: Address family not supported by protocol
Make sure you have a recent Linux kernel (3.13 or newer) with compiled support for Bluetooth
The RaspberryPi 3 runs resinOS 2.12.7+rev1
docker: version 18.03.1-ce, build 9ee9f40
docker-compose: version 1.21.1, build 5a3f1a3
Is there a way to get this working ?