ThomDietrich / miflora-mqtt-daemon

Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼πŸ₯€πŸ‘🌳
MIT License
607 stars 139 forks source link

Docker container #41

Open AnderssonPeter opened 6 years ago

AnderssonPeter commented 6 years ago

Any chance you could create a docker container for raspberry pi 3?

ThomDietrich commented 6 years ago

Hey, I am not using docker on the RPi but please provide a Dockerfile if you build one. Shouldn't be too hard. I imagine a base image plus a set of RUN instructions for what is already documented here: https://github.com/ThomDietrich/miflora-mqtt-daemon#installation

LarsAC commented 6 years ago

For Docker it is somehow disturbing that the app file (.py) and config.ini reside in the same directory. I made a change to allow for an additional config directory command line argument. Then, this could be stored in a permanent volume, whereas the code and its dependencies would be inside the container.

One I find out how to create a PR, I will do so.

Lars

ThomDietrich commented 6 years ago

Sounds reasonable. Let's make it a configurable config file argument though. Please send a PR our way ;)

LarsAC commented 6 years ago

Did so along with a fix for #39. This is my first PR ever and I am very excited ;-)

Please advice if this stuff works for you.

Lars

iicky commented 5 years ago

The Dockerfile works great on a RPi 3 (ARMv8), but not for a RPi 0 (ARMv6). Here's the error

Step 3/10 : RUN mkdir -p /usr/src/app
 ---> Running in bc5f5ed8eedf
ERROR: Service 'miflora-mqtt-daemon' failed to build: The command '/bin/sh -c mkdir -p /usr/src/app' returned a non-zero code: 139

I switched the image to FROM resin/raspberry-pi-python:3.6.1 and the Python call to CMD [ "python", "./miflora-mqtt-daemon.py", "--config_dir", "/config" ] and it spins up.

ThomDietrich commented 5 years ago

@LarsAC would you like to create a tested PR for this change by @iicky

@iicky thanks!

LarsAC commented 5 years ago

Can do, will add a second Dockerfile for rpi.

Lars

RaymondMouthaan commented 5 years ago

Please consider PR #59, for arm32v6 (RPI 1, 2, 3 and Zero), arm32v7 (RPI 1, 2, 3) and arm64v8 (pine64) support.

Ray

bigkraig commented 5 years ago

:+1: can we also get this into the hassio addons repository? its possible to scrape miflora sensors from hass directly, but the units & names in the miflora component do not align with the units/names created with this daemon. I'd prefer to just use this tool everywhere and turn off the miflora component completely.