From 80691765cfb79bc1d08d1582121f9380b1819591 Mon Sep 17 00:00:00 2001 From: Egor Muratov Date: Sun, 27 Apr 2025 22:49:13 +0500 Subject: [PATCH] init --- README.md | 1 + compose.yaml | 38 ++++++++++++++++++++++++++++++++ mosquitto/config/mosquitto.conf | 8 +++++++ mosquitto/config/passwd | 1 + mosquitto/data/mosquitto.db | Bin 0 -> 47 bytes mosquitto/log/mosquitto.log | 20 +++++++++++++++++ 6 files changed, 68 insertions(+) create mode 100644 README.md create mode 100644 compose.yaml create mode 100755 mosquitto/config/mosquitto.conf create mode 100755 mosquitto/config/passwd create mode 100755 mosquitto/data/mosquitto.db create mode 100755 mosquitto/log/mosquitto.log diff --git a/README.md b/README.md new file mode 100644 index 0000000..cccec2e --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +### Настройка Zigbee2mqtt и Mosquitto в compose diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..24cf754 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,38 @@ +services: + # Mosquitto MQTT Broker + mosquitto: + image: eclipse-mosquitto:latest + container_name: mosquitto + restart: unless-stopped + volumes: + - ./mosquitto/config:/mosquitto/config + - ./mosquitto/data:/mosquitto/data + - ./mosquitto/log:/mosquitto/log + ports: + - "1883:1883" # MQTT + - "9001:9001" # WebSocket (optional for some clients) + networks: + - zigbee_net + stdin_open: true + tty: true + + # Zigbee2MQTT + zigbee2mqtt: + image: koenkk/zigbee2mqtt:latest + container_name: zigbee2mqtt + restart: unless-stopped + volumes: + - ./zigbee2mqtt/data:/app/data + - /run/udev:/run/udev:ro # Required for USB device access + devices: + - /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_XXXXXX:/dev/ttyACM0 # Replace XXXXXX with your adapter ID + environment: + - TZ=Europe/Berlin # Set your timezone + depends_on: + - mosquitto + networks: + - zigbee_net + +networks: + zigbee_net: + driver: bridge diff --git a/mosquitto/config/mosquitto.conf b/mosquitto/config/mosquitto.conf new file mode 100755 index 0000000..7d5728b --- /dev/null +++ b/mosquitto/config/mosquitto.conf @@ -0,0 +1,8 @@ +persistence true +persistence_location /mosquitto/data/ +log_dest file /mosquitto/log/mosquitto.log +log_dest stdout + +# Authentication (recommended) +allow_anonymous false +password_file /mosquitto/config/passwd diff --git a/mosquitto/config/passwd b/mosquitto/config/passwd new file mode 100755 index 0000000..fef83eb --- /dev/null +++ b/mosquitto/config/passwd @@ -0,0 +1 @@ +mqtt_user:$7$101$3OCcirPmV9xIk1oB$aJOZxmlgSqqZNWc4ditzK4goWswhFozmfzCaL1SGaiUfHhKr3bSXrqvdEQgxRmInmQMnhrIIrC1F2T1cFAMmog== diff --git a/mosquitto/data/mosquitto.db b/mosquitto/data/mosquitto.db new file mode 100755 index 0000000000000000000000000000000000000000..23708718b4dfcadc398f0da27b1bee750af78b32 GIT binary patch literal 47 lcmZSB%8;91Tv(b}Qj)KblEeT3Y(R<;hz0VY0*o9G1_0(E1|R?c literal 0 HcmV?d00001 diff --git a/mosquitto/log/mosquitto.log b/mosquitto/log/mosquitto.log new file mode 100755 index 0000000..2c9d2ac --- /dev/null +++ b/mosquitto/log/mosquitto.log @@ -0,0 +1,20 @@ +1745775739: mosquitto version 2.0.21 starting +1745775739: Config loaded from /mosquitto/config/mosquitto.conf. +1745775739: Starting in local only mode. Connections will only be possible from clients running on this machine. +1745775739: Create a configuration file which defines a listener to allow remote access. +1745775739: For more details see https://mosquitto.org/documentation/authentication-methods/ +1745775739: Opening ipv4 listen socket on port 1883. +1745775739: Opening ipv6 listen socket on port 1883. +1745775739: mosquitto version 2.0.21 running +1745775761: mosquitto version 2.0.21 terminating +1745775761: Saving in-memory database to /mosquitto/data//mosquitto.db. +1745775761: mosquitto version 2.0.21 starting +1745775761: Config loaded from /mosquitto/config/mosquitto.conf. +1745775761: Starting in local only mode. Connections will only be possible from clients running on this machine. +1745775761: Create a configuration file which defines a listener to allow remote access. +1745775761: For more details see https://mosquitto.org/documentation/authentication-methods/ +1745775761: Opening ipv4 listen socket on port 1883. +1745775761: Opening ipv6 listen socket on port 1883. +1745775761: mosquitto version 2.0.21 running +1745775793: mosquitto version 2.0.21 terminating +1745775793: Saving in-memory database to /mosquitto/data//mosquitto.db.