-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move stream name to command line arg
- Loading branch information
Showing
4 changed files
with
84 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,63 @@ | ||
# govee | ||
|
||
This application uses bluetooth to scan for [Govee H5075](https://www.amazon.com/Govee-Temperature-Humidity-Notification-Monitor/dp/B07Y36FWTT) devices and pushes the data to an AWS Kinesis stream. Works well on a raspberry pi. | ||
|
||
The format of the uploaded data is: | ||
```javascript | ||
{ | ||
"timestamp": 1594685154057511200, // time since unix epoch in nanoseconds | ||
"temp": 77.8111, // temperature in Fahrenheit | ||
"humidity": 50.6, // relative humidity % | ||
"battery": 100, // battery % | ||
"name": "GVH5075_XXXX" // the id associated with the device the measurement is from | ||
} | ||
``` | ||
|
||
# Building | ||
[Install AWS](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup.html) (For raspberry pi you need to build from source) | ||
|
||
Install bluez: | ||
```shell | ||
```bash | ||
sudo apt-get install libbluetooth-dev | ||
``` | ||
|
||
Run `make` from the govee directory and the executable should end up at `build/apps/govee` | ||
|
||
# Installing as a system service | ||
(These instructions are also in `install.sh`) | ||
|
||
Change the ExecStart line in `govee.service` to match your AWS kinesis stream name: | ||
``` | ||
ExecStart=/bin/govee --streamname=YOUR_STREAM_NAME | ||
``` | ||
|
||
Copy `govee.service` to `/etc/systemd/system/govee.service`: | ||
```shell | ||
```bash | ||
sudo cp govee.service /etc/systemd/system/govee.service | ||
``` | ||
|
||
Restart the systemd daemon to load the service file: | ||
```shell | ||
```bash | ||
sudo systemctl daemon-reload | ||
``` | ||
|
||
Copy the `govee` executable to `/bin/govee`: | ||
```shell | ||
```bash | ||
sudo cp build/apps/govee /bin/govee | ||
``` | ||
|
||
Enable the service to automatically start at boot: | ||
```shell | ||
```bash | ||
sudo systemctl enable govee.service | ||
``` | ||
|
||
Or just start/stop the service manually: | ||
```shell | ||
```bash | ||
sudo systemctl start govee.service | ||
sudo systemctl stop govee.service | ||
``` | ||
|
||
Then to view logs: | ||
```shell | ||
```bash | ||
sudo journalctl -u govee.service | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
# Install aws: https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup.html | ||
#!/bin/bash | ||
|
||
sudo apt-get install libbluetooth-dev | ||
make | ||
|
||
sudo cp govee.service /etc/systemd/system/govee.service | ||
|
||
sudo systemctl daemon-reload | ||
|
||
sudo cp build/apps/govee /bin/govee | ||
|
||
sudo systemctl enable govee.service | ||
|
||
sudo systemctl start govee.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters