60 lines
1.0 KiB
Markdown
60 lines
1.0 KiB
Markdown
# FAN LED Control
|
|
|
|
## Board
|
|
ESP8266 D1
|
|
|
|
Used Pins:
|
|
|
|
## Software
|
|
|
|
Interface: USB-UART
|
|
|
|
## Source
|
|
|
|
Inspired by the following Project:
|
|
https://github.com/stefanthoss/esp8266-fan-control
|
|
|
|
## MQTT Control
|
|
|
|
### Linux based Controller
|
|
* Docker
|
|
* Python3
|
|
* paho
|
|
|
|
### Installation
|
|
|
|
Open Terminal in **mqttclient**.
|
|
|
|
Docker must be installed
|
|
```docker build .```
|
|
|
|
#### Execution
|
|
|
|
Set the following parameter:
|
|
* USB Device
|
|
* MQTT
|
|
* Server Name / IP Address
|
|
* Base Topic
|
|
|
|
|
|
```docker run -t -i --device=/dev/ttyUSB0 -e SERIAL_DEVICE="/dev/ttyUSB0" -e MQTT_SERVER="192.168.x.y" -e MQTT_TOPIC="testtopic/" sha256:```
|
|
|
|
#### Execution via Docker Compose
|
|
```
|
|
# template docker-compose.yml
|
|
services:
|
|
python_app:
|
|
attach: false
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
environment:
|
|
- SERIAL_DEVICE=/dev/ttyUSB0
|
|
- MQTT_SERVER=192.168.x.y
|
|
- MQTT_TOPIC=testtopic/
|
|
devices:
|
|
- "/dev/ttyUSB0:/dev/ttyUSB0"
|
|
```
|
|
build image: **docker-compose up --build**
|
|
start with **docker-compose up --detach**
|