NUC-34: Improve documentation.
This commit is contained in:
parent
b9a925d87f
commit
235663d2a7
6 changed files with 70 additions and 19 deletions
BIN
Docs/images/nucucar_android.png
Normal file
BIN
Docs/images/nucucar_android.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 85 KiB |
|
@ -1,4 +1,4 @@
|
||||||
## Protos
|
# Protos
|
||||||
|
|
||||||
The files from Protos are compiled by the gRPC compiler and provide data
|
The files from Protos are compiled by the gRPC compiler and provide data
|
||||||
structures that are shared across the project.
|
structures that are shared across the project.
|
|
@ -11,8 +11,7 @@ _You may download the Fritzing diagrams from `Docs/fritzing/` in order to play w
|
||||||
|
|
||||||
Wire your sensor according to the following diagram:
|
Wire your sensor according to the following diagram:
|
||||||
|
|
||||||
![alt text](../Docs/images/nucucar.sensors_bb.jpg)
|
![raspberry pi wiring diagram](../Docs/images/nucucar.sensors_bb.jpg)
|
||||||
|
|
||||||
|
|
||||||
#### BME680
|
#### BME680
|
||||||
|
|
||||||
|
@ -21,6 +20,39 @@ The address ` 0x76` will be used to communicate with the sensor.
|
||||||
|
|
||||||
Make sure I2C is enabled. Use `raspi-config`.
|
Make sure I2C is enabled. Use `raspi-config`.
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
|
||||||
|
Each Sensor is configured via the `appsettings.json` file. The following configuration options are
|
||||||
|
available to all sensors:
|
||||||
|
|
||||||
|
- Enabled: (bool) Enables or disables the sensor.
|
||||||
|
- Telemetry: (bool) Enables or disables telemetry reporting for the sensor.
|
||||||
|
- Grpc: (bool): Enables or disables the gRPC endpoint for the sensor.
|
||||||
|
- MeasurementInterval: (int) The interval in milliseconds in which the sensor will read data. Default: 3000
|
||||||
|
|
||||||
|
---
|
||||||
|
Besides sensor configuration, you may also configure the telemetry service. The telemetry service collects telemetry data from all sensors
|
||||||
|
and uses a telemetry publisher to publish the data.
|
||||||
|
|
||||||
|
Example config:
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"Telemetry": {
|
||||||
|
"Publisher": "Disk",
|
||||||
|
"ServiceEnabled": true,
|
||||||
|
"PublishInterval": 3000,
|
||||||
|
"ConnectionString": "FileName=nucucar.telemetry;FileExtension=txt;Separator=\n"
|
||||||
|
},
|
||||||
|
"EnvironmentSensor": {
|
||||||
|
"Enabled": true,
|
||||||
|
"Telemetry": true,
|
||||||
|
"Grpc": true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# Sensors
|
# Sensors
|
||||||
|
|
||||||
#### Environment Sensor
|
#### Environment Sensor
|
||||||
|
|
|
@ -1,12 +1,26 @@
|
||||||
## Telemetry
|
# Telemetry
|
||||||
|
|
||||||
It provides useful classes and abstractions for implementing telemetry
|
This package provides useful classes and abstractions for implementing telemetry
|
||||||
in individual components. All telemetry publishers use the MQTT protocol unless specified
|
in individual components.
|
||||||
otherwise.
|
|
||||||
|
|
||||||
### Azure Telemetry
|
The telemetry service is used by other packages in order to implement telemetry reporting. It may be configured via the `appsettings.json` file or environment variables.
|
||||||
|
|
||||||
#### Publisher
|
# Configuration
|
||||||
|
|
||||||
|
The following configurations is available for the Telemetry service:
|
||||||
|
|
||||||
|
- Publisher: (string) The telemetry publisher. i.e: `Azure`, `Disk`, `Firestore`, `Console`.
|
||||||
|
- ServiceEnabled: (bool) Enables or disables the telemetry collection service.
|
||||||
|
- PublishInterval: (int) The interval in which to publish the telemetry data.
|
||||||
|
- ConnectionString: (string) Connection string for the telemetry publisher.
|
||||||
|
|
||||||
|
# Telemetry Publishers
|
||||||
|
|
||||||
|
Telemetry publishers are used by the telemetry service in order to publish data.
|
||||||
|
|
||||||
|
## Azure Telemetry
|
||||||
|
|
||||||
|
### Publisher
|
||||||
|
|
||||||
You can use cloud telemetry for free via Azure-IoT-Hub.
|
You can use cloud telemetry for free via Azure-IoT-Hub.
|
||||||
You still need a backend application that will process the messages.
|
You still need a backend application that will process the messages.
|
||||||
|
@ -26,7 +40,7 @@ dotnet run --Telemetry:ConnectionString=CONNECTION_STRING
|
||||||
export Telemetry:ConnectionString=CONNECTION_STRING
|
export Telemetry:ConnectionString=CONNECTION_STRING
|
||||||
```
|
```
|
||||||
|
|
||||||
The Telemetry:Publisher must be set to: Azure
|
The `Telemetry:Publisher` must be set to: Azure
|
||||||
|
|
||||||
You may also use the format from above to override any settings in appsettings.json.
|
You may also use the format from above to override any settings in appsettings.json.
|
||||||
|
|
||||||
|
@ -37,16 +51,16 @@ Azure's IoT Hub Build-In Endpoints setting.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Disk Telemetry
|
## Disk Telemetry
|
||||||
|
|
||||||
#### Publisher
|
### Publisher
|
||||||
|
|
||||||
Publishes telemetry on the disk.
|
Publishes telemetry on the disk.
|
||||||
|
|
||||||
Example connection string:
|
Example connection string:
|
||||||
`Filename=telemetry;FileExtension=csv;Separator=,;BufferSize=4096`
|
`Filename=telemetry;FileExtension=csv;Separator=,;BufferSize=4096`
|
||||||
|
|
||||||
The Telemetry:Publisher must be set to: Disk
|
The `Telemetry:Publisher` must be set to: Disk
|
||||||
|
|
||||||
See the source code for comments on the ConnectionString.
|
See the source code for comments on the ConnectionString.
|
||||||
|
|
||||||
|
@ -56,13 +70,13 @@ You will need to parse the file by yourself.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Firebase Firestore Database
|
## Firebase Firestore Database
|
||||||
|
|
||||||
#### Publisher
|
### Publisher
|
||||||
|
|
||||||
Publishes telemetry on the firestore.
|
Publishes telemetry on the firestore.
|
||||||
|
|
||||||
The Telemetry:Publisher must be set to: Firestore
|
The `Telemetry:Publisher` must be set to: Firestore
|
||||||
|
|
||||||
Example connection string:
|
Example connection string:
|
||||||
`ProjectId=nucuhub;CollectionName=sensors-telemetry-test;Timeout=1000`
|
`ProjectId=nucuhub;CollectionName=sensors-telemetry-test;Timeout=1000`
|
||||||
|
|
7
NucuHub.Android/Readme.md
Normal file
7
NucuHub.Android/Readme.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Introduction
|
||||||
|
|
||||||
|
This package holds the code for the NucuCar.Android companion application.
|
||||||
|
|
||||||
|
The purpose of the application is to allow the user to interact with the NucuCar system via the mobile phone.
|
||||||
|
|
||||||
|
![android application image](../Docs/images/nucucar_android.png)
|
|
@ -25,8 +25,6 @@ To build this project you will need to install .Net Core 3.1 and Android Studio.
|
||||||
|
|
||||||
To run this project on the Raspberry Pi you will need dotnet core 3.1. installed.
|
To run this project on the Raspberry Pi you will need dotnet core 3.1. installed.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
The following script provides instructions on how to build the whole project and deploy the NucuCar.Sensors module on the Raspberry Pi.
|
The following script provides instructions on how to build the whole project and deploy the NucuCar.Sensors module on the Raspberry Pi.
|
||||||
|
|
Loading…
Reference in a new issue