跳转到主要内容

从pimoroni BME680读取数据并在pimoroni SPI屏幕上显示

项目描述

Build Status PyPI version

pi_weatherstation

从pimoroni BME680读取数据并在pimoroni SPI屏幕上显示

Sensors assembled

Grafana dashboard

依赖项

在RaspberryPI上安装

  • 启用SPI和I2C
  • 安装依赖项
sudo apt-get install python3-venv python3-dev libatlas-base-dev wkhtmltopdf libopenjp2-7
  • 创建存储virtualenv的文件夹
mkdir pi_weatherstation

cd pi_weatherstation
  • 创建virtualenv并激活它
python3 -m venv .env

source .env/bin/activate
  • 使用pip和传感器依赖项安装
pip install pi_weatherstation\[st7789,bme680\]
  • 运行
pi_weatherstation -l debug

配置文件

您可以复制https://github.com/guilhermef/pi_weatherstation/blob/main/examples/config.ini中的示例配置文件

metrics_location_label字段添加为prometheus上的位置标签。

然后您可以运行pi_weatherstation -c <config.ini的路径>

长期数据存储

这还将启动一个您可以用于抓取的prometheus指标服务器。如果您有多个实例,您可以配置标签名称位置。

在RaspberryPI上安装Prometheus

在Grafana Cloud上创建一个免费账户

将现有的prometheus.yml文件复制到抓取本地的pi_weatherstation,并添加您的远程写入认证。https://github.com/guilhermef/pi_weatherstation/blob/main/examples/prometheus.yml

在您的Grafana中导入示例仪表板:https://github.com/guilhermef/pi_weatherstation/blob/main/examples/grafana_dashboard.json

作为服务运行

如果您愿意,可以使用https://github.com/guilhermef/pi_weatherstation/blob/main/examples/pi_weatherstation.service作为示例系统服务单元文件并将其放置在/etc/systemd/system/pi_weatherstation.service

然后,运行

sudo systemctl daemon-reload
sudo systemctl enable pi_weatherstation.service
sudo systemctl start pi_weatherstation.service

项目详情


下载文件

下载您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码发行版

pi_weatherstation-0.0.5.tar.gz (1.9 MB 查看哈希值)

上传时间 源代码

构建发行版

pi_weatherstation-0.0.5-py2.py3-none-any.whl (4.3 kB 查看哈希值)

上传时间 Python 2 Python 3

由以下支持