Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zachstence/zero-weather
DIY a simple weather station using a Raspberry Pi Zero W and a DHT22 temperature/humidity sensor.
https://github.com/zachstence/zero-weather
dht11 dht22 grafana influxdb raspberry-pi typescript
Last synced: about 2 months ago
JSON representation
DIY a simple weather station using a Raspberry Pi Zero W and a DHT22 temperature/humidity sensor.
- Host: GitHub
- URL: https://github.com/zachstence/zero-weather
- Owner: zachstence
- License: mit
- Created: 2022-03-31T20:16:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-12T02:44:41.000Z (almost 2 years ago)
- Last Synced: 2023-03-04T13:52:10.590Z (almost 2 years ago)
- Topics: dht11, dht22, grafana, influxdb, raspberry-pi, typescript
- Language: TypeScript
- Homepage: https://hub.docker.com/r/zachstence/zero-weather
- Size: 212 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zero-weather
DIY a simple weather station using a Raspberry Pi Zero W and a DHT22 temperature/humidity sensor.## Table of Contents
- [Usage](#usage)
- [Run using `npm`](#run-using-npm)
- [Run using Docker](#run-using-docker)
- [Run using `docker-compose`](#run-using-docker-compose)
- [Config](#config)
- [Grafana Dashboard](#grafana-dashboard)
- [Future Features](#future-features)## Usage
All methods require a [configuration file](#config).
### Run using `npm`
```sh
# Clone the repository
git clone https://github.com/zachstence/zero-weather.git && cd zero-weather# Add your config
nano config/production.json# Start the app
npm start
```### Run using Docker
```sh
docker run \
--device /dev/gpiomem:/dev/gpiomem \
-v /path/to/config.json:/app/config/production.json:ro \
zachstence/zero-weather
```### Run using `docker-compose`
```yaml
version: "3.8"services:
zero-weather:
image: zachstence/zero-weather
devices:
- /dev/gpiomem:/dev/gpiomem
volumes:
- /path/to/config.json:/app/config/production.json:ro
restart: unless-stopped
```## Config
Create a config file following the format in [`config/default.json`](config/default.json)```json
{
"sensor": {
"type": 22,
"pin": 14,
"interval": 30
},
"influxdb": {
"url": "",
"org": "",
"bucket": "",
"token": ""
}
}
```| Config | Description | Example |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `sensor.type` | Whether your connected sensor is a DHT11 or DHT22 sensor | `11` or `22` |
| `sensor.pin` | The [GPIO pin](https://pinout.xyz/) that your DHT sensor is connected to | `14` |
| `sensor.interval` | The interval in seconds that the sensor should be polled.1 | `30` |
| `influxdb.url` | The base URL of your InfluxDB instance | `http://localhost` |
| `influxdb.org` | The name of your [InfluxDB organization](https://docs.influxdata.com/influxdb/v2.1/organizations/create-org/) | `org-name` |
| `influxdb.bucket` | The name of the [InfluxDB bucket](https://docs.influxdata.com/influxdb/v2.1/organizations/buckets/create-bucket/) to store the data in | `zero-weather` |
| `influxdb.token` | An [InfluxDB token](https://docs.influxdata.com/influxdb/v2.1/security/tokens/create-token) with write permissions to the specified bucket | `9jPxAm8tEZSnRlw8nAsEDWZbvHCYeUetIAUrT_vj6RdHfG43RF5UKfazyZ1Z9dYu1o7prU7-kC4X8oUP-PSxTg==` |1 The DHT11 can be polled at most once every second (1Hz, `sensor.interval=1`). The DHT22 can be polled at most once every half-second (0.5Hz, `sensor.interval=0.5`).
## Grafana Dashboard
https://grafana.com/grafana/dashboards/16035## Future Features
- Accept file for Influx token to enable better security (Docker secrets)