-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b00500
commit 36b253e
Showing
14 changed files
with
174 additions
and
17 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
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
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 @@ | ||
solarthing.config.database=../config/couchdb/couchdb.json | ||
solarthing.config.default_source=default | ||
solarthing.config.default_fragment=1 |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
solarthing.config.database=../config/couchdb/couchdb.json | ||
solarthing.config.default_source=default | ||
solarthing.config.default_fragment=1 |
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
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,2 +1,27 @@ | ||
# GraphQL Quickstart | ||
Documentation to come | ||
If you haven't already, [click here](quickstart.md) to view how to clone this repo and install the service. | ||
|
||
Note that you must have set up either the `mate`, `rover`, or `request` program for this to be useful. | ||
This program is used to expose CouchDB as a GraphQL API, which is commonly used with Grafana and [the GraphQL Datasource](https://github.com/fifemon/graphql-datasource). | ||
|
||
Once everything is installed, you're ready to edit the configs. You will cd to the `program/mate` directory. | ||
``` | ||
cd /opt/solarthing/program/graphql | ||
``` | ||
|
||
Now copy the `application.properties` to the config directory: | ||
```shell script | ||
cp ../../config_templates/graphql/application.properties config/ | ||
``` | ||
|
||
Edit `application.properties`: | ||
``` | ||
solarthing.config.database=../config/couchdb/couchdb.json | ||
``` | ||
Make sure the path to your `couchdb.json` is correct. | ||
|
||
### Run for the first time | ||
Run `./run.sh`. | ||
|
||
### [Set up with Grafana](../../graphql/grafana_datasource_setup.md) | ||
|
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,2 +1,44 @@ | ||
# Quick start with Request program | ||
Documentation to come | ||
If you haven't already, [click here](quickstart.md) to view how to clone this repo and install the service. | ||
|
||
The request program can be used for uploading temperature sensor data and Raspberry Pi | ||
CPU Temperature. | ||
|
||
This supports DS18B20 temperature sensors. | ||
|
||
Once everything is installed, you're ready to edit the configs. You will cd to the `program/mate` directory. | ||
``` | ||
cd /opt/solarthing/program/request | ||
``` | ||
|
||
Copy the request template: | ||
```shell script | ||
cp ../../config_templates/base/request_template.json config/base.json | ||
``` | ||
|
||
Now edit `config/base.json`. | ||
```json | ||
{ | ||
"type": "request", | ||
"source": "default", | ||
"fragment": 3, | ||
"unique": 30, | ||
"databases": [ | ||
"../config/couchdb.json" | ||
], | ||
"request": [ | ||
{ | ||
"type": "rpi-cpu-temp" | ||
}, | ||
{ | ||
"type": "w1-temperature", | ||
"directory": "/sys/bus/w1/devices/28-000006470bec", | ||
"data_id": 1 | ||
} | ||
] | ||
} | ||
``` | ||
The objects in the `request` field represent what values are uploaded. | ||
|
||
If you are monitoring a DS18B20 temperature sensor, you can change the `directory` field to point to | ||
the correct device in `/sys/bus/w1/devices`. Also learn [how to set up a DS18B20 sensor](DS18B20_sensor_setup.md). |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Request Field | ||
The `request` field is an array of objects that *can* be present in configurations for the | ||
`mate`, `rover`, or `request` programs. | ||
|
||
This is a common way to define what to upload to the database. In the `mate` and `rover` program case, it supplements | ||
the data they already provide. | ||
|
||
|
||
Here's an example of requesting the Raspberry Pi CPU Temperature | ||
```json5 | ||
{ | ||
// ... | ||
"request": [ | ||
{ | ||
"type": "rpi-cpu-temp" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
You can also request data from a DS18B20 temperature sensor: | ||
```json5 | ||
{ | ||
// ... | ||
"request": [ | ||
{ | ||
"type": "rpi-cpu-temp" | ||
}, | ||
{ | ||
"type": "w1-temperature", | ||
"directory": "/sys/bus/w1/devices/28-000006470bec", | ||
"data_id": 1 | ||
} | ||
] | ||
} | ||
``` | ||
If you are interesting in learning more about the DS18B20 sensor, [click here](DS18B20_sensor_setup.md). |