1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-21 01:27:01 +02:00

add mqtt-io-arm

This commit is contained in:
kevin 2021-11-21 16:32:00 +08:00
parent 63543ea5af
commit c20ccd5a85
5 changed files with 68 additions and 2 deletions

View File

@ -55,9 +55,10 @@ A collection of delicious docker recipes.
## IoT
- [x] hass :+1:
- [x] hbdg :+1:
- [x] hass
- [x] hbdg
- [x] node-red :+1:
- [x] mqtt-io-arm
- [x] mosquitto :+1:
- [x] tile38-arm :+1:

15
mqtt-io-arm/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
#
# Dockerfile for mqtt-io-arm
#
FROM debian:bullseye
RUN set -xe \
&& apt update -y \
&& apt install -y python3 python3-pip python3-rpi.gpio \
&& pip3 install --no-cache mqtt-io \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
CMD ["python3", "-m", "mqtt_io", "config.yml"]

22
mqtt-io-arm/README.md Normal file
View File

@ -0,0 +1,22 @@
mqtt-io
=======
[mqtt-io][1] exposes general purpose inputs and outputs (GPIO), hardware sensors and
serial devices to an MQTT server. Ideal for single-board computers such as the
Raspberry Pi.
## up and running
```
docker-compose up -d
docker-compose logs -f
```
## mqtt sub/pub
```
mosquitto_sub -v -h test.mosquitto.org -t easypi/#
mosquitto_pub -h test.mosquitto.org -t easypi/output/light/set -m ON
```
[1]: https://mqtt-io.app/

View File

@ -0,0 +1,20 @@
# Doc: https://mqtt-io.app/
mqtt:
host: test.mosquitto.org
port: 1883
topic_prefix: easypi
gpio_modules:
- name: rpi
module: raspberrypi
digital_inputs:
- name: doorbell
module: rpi
pin: 21
digital_outputs:
- name: light
module: rpi
pin: 22

View File

@ -0,0 +1,8 @@
version: "3.8"
services:
mqtt-io:
image: easypi/mqtt-io-arm
volumes:
- ./data:/app
privileged: true
restart: unless-stopped