Skip to content

Commit

Permalink
Merge pull request #1 from chriskacerguis/alpine
Browse files Browse the repository at this point in the history
Switching to Alpine Linux
  • Loading branch information
chriskacerguis authored Aug 23, 2017
2 parents 1290f0b + 7b2cea0 commit 04c2dd1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
48 changes: 25 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,35 @@

# IMPORTANT: The container needs priviliged access to /dev/bus/usb on the host.

FROM ubuntu:16.04
FROM alpine:3.6
MAINTAINER Chris Kacerguis

LABEL Description="This image is used to start a script that will monitor for Honeywell Sensors events on 345.00 Mhz and send the data to an MQTT server"

#
# First install software packages needed to compile rtl_433 and to publish MQTT events
#
RUN apt-get update && apt-get install -y \
rtl-sdr \
librtlsdr-dev \
librtlsdr0 \
git \
automake \
libtool \
cmake \
mosquitto-clients

#
# Pull RTL_433 source code from GIT, compile it and install it
#
RUN git clone https://github.com/merbanan/rtl_433.git \
&& cd rtl_433/ \
&& mkdir build \
&& cd build \
&& cmake ../ \
&& make \
&& make install
RUN apk add --no-cache --virtual build-deps alpine-sdk cmake git libusb-dev && \
mkdir /tmp/src && \
cd /tmp/src && \
git clone git://git.osmocom.org/rtl-sdr.git && \
mkdir /tmp/src/rtl-sdr/build && \
cd /tmp/src/rtl-sdr/build && \
cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr/local && \
make && \
make install && \
chmod +s /usr/local/bin/rtl_* && \
cd /tmp/src/ && \
git clone https://github.com/merbanan/rtl_433.git && \
cd rtl_433/ && \
mkdir build && \
cd build && \
cmake ../ && \
make && \
make install && \
apk del build-deps && \
rm -r /tmp/src && \
apk add --no-cache libusb mosquitto-clients

#
# Define an environment variable
Expand All @@ -42,5 +43,6 @@ ENV MQTT_USER="guest"
ENV MQTT_PASS="guest"
ENV MQTT_TOPIC="homeassistant/sensor/honeywell"

COPY rtl2mqtt.sh /
CMD ["/rtl2mqtt.sh"]
COPY ./rtl2mqtt.sh /
RUN chmod +x /rtl2mqtt.sh
ENTRYPOINT ["/rtl2mqtt.sh"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This has been tested and used with the following hardware (you can get it on Ama
- 5800MINI Wireless Door/Window Contact by Honeywell
- NooElec NESDR Nano 2+ Tiny Black RTL-SDR USB

It should work just fine with any Honeywell RF sensors.
However, it should work just fine with any Honeywell RF sensors transmitting on 345Mhz.


## Troubleshooting
Expand Down
3 changes: 2 additions & 1 deletion rtl2mqtt.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

# A simple script that will receive events from a RTL433 SDR
# It is tuned to listen to 345.00 MHz with the Honeywell driver
Expand All @@ -11,6 +11,7 @@ export LANG=C
PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"

# Start the listener and enter an endless loop
echo "Starting RTL..."
/usr/local/bin/rtl_433 -f 345000000 -F json -R 70 | while read line
do
# Create file with touch /tmp/rtl_433.log if logging is needed
Expand Down

0 comments on commit 04c2dd1

Please sign in to comment.