Hello Joe,
thanks for getting back to me. Yes, I can see that the bleacon module has been compiled for a different version, but issueing “npm rebuild bluetoothctl” or “npm rebuild bleacon” does not remedy the situation, I
seem to miss something.
You asked for the Dockerfile used, find it below. Also, I am using the electronjs-boilerplate project, which in return relies on the node 6.9 image from resin as you can see (https://github.com/resin-io/resin-electronjs).
I had to use bluez 5.23-2+rpi2 taken from the bluetooth rpi3 sample, which in return, however, uses the python base image, see https://github.com/resin-io-projects/rpi3-bluetooth/blob/master/Dockerfile.template) in order to get bluetooth to work on in the electronjs image. Additionally, I must issue an
/usr/bin/hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
in the start.sh script in order to get bluetooth enabled, but it works. My functionality test is a scan by issueing
hcitool lescan
which then in return finds beacons lying around.
I am foremost interested in finding a solution to get bluetooth and the bleacon module to work with electronjs on a raspberry pi3. I want to build a digital signage solution using bluetooth BLE beacons.
If this doesn’t work for any reason, I’d alternatively be interested in transplanting the electronjs project to the bluetooth sample image you are providing at resin.io, but I am unaware of all the necessary components one needs to add to make it work, especially the X server component, although I could eventually cannibalize it from the electronjs-boilerplate project.
The buetooth sample you are providing works well for me, but lacks the X server needed to display electronjs…
Thanks for your help which is much appreciated!
FROM resin/%%RESIN_MACHINE_NAME%%-node:6.9
# debian httpredir mirror proxy often ends up with 404s - editing source file to avoid it
RUN sed -i "s!httpredir.debian.org!`curl -s -D - http://httpredir.debian.org/demo/debian/ | awk '/^Link:/ { print $2 }' | sed -e 's@<http://\(.*\)/debian/>;@\1@g'`!" /etc/apt/sources.list
COPY debian-pinning /etc/apt/preferences.d/
# Install other apt deps
RUN apt-get update && apt-get install -y \
bluez=5.23-2+rpi2 \
samba \
apt-utils \
clang \
xserver-xorg-core \
xserver-xorg-input-all \
xserver-xorg-video-fbdev \
xorg \
libdbus-1-dev \
libgtk2.0-dev \
libnotify-dev \
libgnome-keyring-dev \
libgconf2-dev \
libasound2-dev \
libcap-dev \
libcups2-dev \
libxtst-dev \
libxss1 \
libnss3-dev \
fluxbox \
libsmbclient \
libssh-4 \
fbset \
libexpat-dev && rm -rf /var/lib/apt/lists/*
# Set Xorg and FLUXBOX preferences
RUN mkdir ~/.fluxbox
RUN echo "xset s off" > ~/.fluxbox/startup && echo "xserver-command=X -s 0 dpms" >> ~/.fluxbox/startup
RUN echo "#!/bin/bash" > /etc/X11/xinit/xserverrc \
&& echo "" >> /etc/X11/xinit/xserverrc \
&& echo 'exec /usr/bin/X -s 0 dpms -nocursor -nolisten tcp "$@"' >> /etc/X11/xinit/xserverrc
# Move to app dir
WORKDIR /usr/src/app
# Move package.json to filesystem
COPY ./app/package.json ./
# Install npm modules for the application
RUN JOBS=MAX npm install --unsafe-perm --production \
&& npm cache clean && node_modules/.bin/electron-rebuild
# Move app to filesystem
COPY ./app ./
## uncomment if you want systemd
ENV INITSYSTEM on
# Start app
CMD ["bash", "npm install bleacon -g"]
CMD ["bash", "/usr/src/app/start.sh"]