-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
The Qingping Air Monitor Lite MQTT to InfluxDB Collector is designed to run within a Docker container, ensuring consistency, portability, and simplified deployment. Below are the steps to deploy the collector using Docker Compose.
-
Docker and Docker Compose Installed
Ensure Docker and Docker Compose are installed on the host system. -
InfluxDB Setup
Confirm that an InfluxDB instance is running and accessible. -
MQTT Broker Configuration
Set up a compatible MQTT broker (e.g., Mosquitto, EMQX) and configure your Qingping devices to publish to this broker.
name: qingping-collector
services:
qingping-collector:
command:
- python
- main.py
container_name: qingping-collector
environment:
# InfluxDB Configuration
INFLUXDB_BUCKET: qingping
INFLUXDB_ORG: YourOrg
INFLUXDB_TOKEN: your-influxdb-token
INFLUXDB_URL: http://your-influxdb-server:8086/
INFLUXDB_BATCH_SIZE: "100"
INFLUXDB_FLUSH_INTERVAL: "5000"
INFLUXDB_ENABLE_GZIP: "true"
# MQTT Broker Configuration
MQTT_BROKER_ADDRESS: your-mqtt-broker
MQTT_BROKER_PORT: "1883"
MQTT_KEEPALIVE: "60"
MQTT_USERNAME: your-mqtt-username
MQTT_PASSWORD: your-mqtt-password
MQTT_TOPIC: qingping/#
# Logging Configuration
LOG_LEVEL: INFO
# Reconnection Strategy
MAX_RECONNECT_DELAY: "60"
MAX_RECONNECT_ATTEMPTS: "5"
# Other Configurations
TZ: America/Chicago
USE_CURRENT_TIME: "1"
SET_DEVICE_INTERVALS: "0"
DEFAULT_REPORT_INTERVAL: "10"
DEFAULT_COLLECT_INTERVAL: "10"
image: lux4rd0/qingping-collector:latest
restart: always
networks:
default: null
networks:
default:
name: qingping-collector_default
docker-compose up -d
This will start the collector in detached mode. Logs can be monitored using docker logs
:
docker logs -f qingping-collector
-
Docker Requirement
This collector is designed to run exclusively in Docker. Deploying it directly on a host system is not supported. -
Environment Variables
Customize the environment variables in thecompose.yaml
file to fit your specific MQTT broker and InfluxDB setup. -
Restart Policy
Therestart: always
policy ensures the service automatically restarts in case of a crash or system reboot. -
Network Configuration
By default, the collector operates on an isolated Docker network. Ensure that your MQTT broker and InfluxDB are accessible from this network. -
Time Zones
TheTZ
environment variable ensures the container operates in the desired time zone.
-
Check Container Status
docker ps
Confirm that the
qingping-collector
container is running. -
Monitor Logs
docker logs -f qingping-collector
-
Verify Data in InfluxDB
Use the InfluxDB UI or API to confirm data is being written to the configured bucket.
-
Connectivity Issues
Ensure the MQTT broker and InfluxDB URLs are correct and accessible from within the container. -
Data Not Flowing
Check MQTT logs to confirm devices are publishing data to the broker. -
Timestamps Off
Set theUSE_CURRENT_TIME
flag to1
to use the collector's local time instead of payload timestamps.