added docker and wrote some readme stuff. nobody will ever read this... anyway

This commit is contained in:
DasMoorhuhn 2024-05-30 15:52:13 +02:00
parent 9cbffdd519
commit a57cfe27d8
11 changed files with 47 additions and 1 deletions

BIN
.media/demo_001.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -7,7 +7,7 @@ Python gateway for the [custom firmware](https://github.com/atc1441/ATC_MiThermo
**Features:**
- [WIP] Can run on Raspberry Pi (3, 4, zero w, pico) or any other Linux driven hardware which has BLE and WiFi support
- [WIP] Storing temperature, humidity and battery state as json in a text file
- [TODO] Make in runnable in a docker container (because only cool people are using docker)
- [WIP] Make in runnable in a docker container (because only cool people are using docker)
- [TODO] Collect data from multiple devices/gateways
- [TODO] Command line tool for managing the devices
- [TODO] Analyzing tool for making statistics
@ -16,8 +16,28 @@ Python gateway for the [custom firmware](https://github.com/atc1441/ATC_MiThermo
- [TODO] Maybe... a webinterface. But I suck at web stuff, so I don't know.
- [TODO] Implement other BLE Sensors
**Current State**
![](.media/demo_001.gif)
## Getting started
First of all, you need to flash the [custom firmware](https://github.com/atc1441/ATC_MiThermometer) on your LYWSD03MMC device. A step-by-step guid is in his youtube channel, the video is linked on his GitHub repo. It's straight forward and does not require any special hardware.
## Run Gateway
The libraries are needed to be installed as root, because the gateway itself needs to be executed as root, else it is not able to use the bluetooth adapter. In the future, I try to do it better. Also in the future it will be much easier to start and install.
Install `bluez`. It's needed for bluepy to communicate with the bluetooth adapter.
```bash
sudo apt-get install -y bluez
```
Install PIP Libraries
```bash
sudo pip3 install -r python/requirements.txt
```
Run Gateway
```bash
cd python/src
sudo python3 main.py
```

2
docker/Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM python:3.12-alpine3.20

View File

@ -0,0 +1,6 @@
version: '3.3'
services:
atc_mithermometer_gateway:
image: atc-mithermometer-gateway:develop
container_name: ATC_MiThermometer_Gateway

17
python/install_gateway.sh Normal file
View File

@ -0,0 +1,17 @@
# Update the system
sudo apt-get update
sudo apt-get uprade -y
sudo apt-get autoremove -y
# Install the dependencies
sudo apt-get install python3 python3-pip bluez
sudo pip3 install -r requirements.txt
# Install the Gateway
# Install the service
# Start the Gateway
sudo systemctl enable atc_mithermometer_gateway.service
sudo systemctl start atc_mithermometer_gateway.service
sudo systemctl status atc_mithermometer_gateway.service

1
python/requierements.txt Normal file
View File

@ -0,0 +1 @@
bluepy

0
python/src/__init__.py Normal file
View File