Hi there,
our Application does need access to /dev/ttyAMA0 to use Bluetooth in our Stack. On our pre-balena raspbian with docker installed the container can easily access the interface with the --devices flag:
docker run --device=/dev/ttyAMA0 tower -h 172.16.10.13
Using this as our base to deploy our application to balena we figured out following procedure, which is still not working:
FROM balenalib/armv7hf-debian-openjdk:11-jre-stretch
WORKDIR /app
COPY wiringpi_2.50_armhf.deb wiringpi_2.50_armhf.deb
RUN dpkg -i wiringpi_2.50_armhf.deb
RUN apt-get install bluez
ADD tower.jar tower.jar
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["java","-jar","/app/tower.jar"]
version: '2.1'
networks: {}
volumes:
resin-data: {}
services:
tower:
build:
context: .
privileged: true
tty: true
restart: always
network_mode: host
volumes:
- 'resin-data:/data'
command: -h 172.16.10.13 --debug
devices:
- '/dev/ttyAMA0:/dev/ttyAMA0'
labels:
io.resin.features.kernel-modules: '1'
io.resin.features.firmware: '1'
io.resin.features.dbus: '1'
io.resin.features.supervisor-api: '1'
io.resin.features.resin-api: '1'
cap_add:
- SYS_RAWIO
- NET_ADMIN
hostname:
build: ./hostname/
restart: no # Required to avoid container restarting indefinitely
labels:
io.balena.features.supervisor-api: 1 # Required to interact with the supervisor
I already run out of ideas, maybe we are missing just a small part of it.
Feel free to ask questions, ill give my best to answer all of them.