Merge pull request #145 from meshtastic/radioconfig-refactor-telem

Moved telemetry out of old radio config prefs
This commit is contained in:
Sacha Weatherstone 2022-05-02 08:13:19 +10:00 committed by GitHub
commit 9323b1f5d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 106 additions and 109 deletions

View file

@ -96,7 +96,7 @@ message AdminMessage {
/*
* TODO: REPLACE
*/
MODULE_ENVIRONMENTAL_CONFIG = 14;
MODULE_TELEMETRY_CONFIG = 14;
/*
* TODO: REPLACE

View file

@ -1,4 +1,5 @@
syntax = "proto3";
import "telemetry.proto";
option java_package = "com.geeksville.mesh";
option java_outer_classname = "ConfigProtos";
@ -105,10 +106,59 @@ message Config {
}
/*
* TODO: REPLACE
* Configuration for both device and environment metrics
*/
message TelemetryConfig {
/*
* Interval in seconds of how often we should try to send our
* device measurements to the mesh
*/
uint32 device_update_interval = 1;
/*
* Interval in seconds of how often we should try to send our
* environment measurements to the mesh
*/
uint32 environment_update_interval = 2;
/*
* Preferences for the Telemetry Module (Environment)
* Enable/Disable the telemetry measurement module measurement collection
*/
bool environment_measurement_enabled = 3;
/*
* Enable/Disable the telemetry measurement module on-device display
*/
bool environment_screen_enabled = 4;
/*
* Sometimes sensor reads can fail.
* If this happens, we will retry a configurable number of attempts,
* each attempt will be delayed by the minimum required refresh rate for that sensor
*/
uint32 environment_read_error_count_threshold = 5;
/*
* Sometimes we can end up with more than read_error_count_threshold failures.
* In this case, we will stop trying to read from the sensor for a while.
* Wait this long until trying to read from the sensor again
*/
uint32 environment_recovery_interval = 6;
/*
* We'll always read the sensor in Celsius, but sometimes we might want to
* display the results in Fahrenheit as a "user preference".
*/
bool environment_display_fahrenheit = 7;
/*
* Specify the sensor type
*/
TelemetrySensorType environment_sensor_type = 8;
/*
* Specify the peferred GPIO Pin for sensor readings
*/
uint32 environment_sensor_pin = 9;
}
/*

View file

@ -727,107 +727,6 @@ message RadioConfig {
*/
reserved 136;
/*
* Preferences for the Telemetry Module (Environment)
* FIXME - Move this out of UserPreferences and into a section for module configuration.
* Enable/Disable the telemetry measurement module measurement collection
*/
bool telemetry_module_environment_measurement_enabled = 140;
/*
* Enable/Disable the telemetry measurement module on-device display
*/
bool telemetry_module_environment_screen_enabled = 141;
/*
* Sometimes sensor reads can fail.
* If this happens, we will retry a configurable number of attempts,
* each attempt will be delayed by the minimum required refresh rate for that sensor
*/
uint32 telemetry_module_environment_read_error_count_threshold = 142;
/*
* Interval in seconds of how often we should try to send our
* measurements to the mesh
*/
uint32 telemetry_module_device_update_interval = 143;
/*
* Sometimes we can end up with more than read_error_count_threshold failures.
* In this case, we will stop trying to read from the sensor for a while.
* Wait this long until trying to read from the sensor again
*/
uint32 telemetry_module_environment_recovery_interval = 144;
/*
* We'll always read the sensor in Celsius, but sometimes we might want to
* display the results in Fahrenheit as a "user preference".
*/
bool telemetry_module_environment_display_fahrenheit = 145;
/*
* TODO: REPLACE
*/
enum TelemetrySensorType {
/*
* No external telemetry sensor
*/
None = 0;
/*
* TODO: REPLACE
*/
DHT11 = 1;
/*
* TODO: REPLACE
*/
DS18B20 = 2;
/*
* TODO: REPLACE
*/
DHT12 = 3;
/*
* TODO: REPLACE
*/
DHT21 = 4;
/*
* TODO: REPLACE
*/
DHT22 = 5;
/*
* TODO: REPLACE
*/
BME280 = 6;
/*
* TODO: REPLACE
*/
BME680 = 7;
/*
* TODO: REPLACE
*/
MCP9808 = 8;
/*
* TODO: REPLACE
*/
SHTC3 = 9;
};
/*
* Specify the sensor type
*/
TelemetrySensorType telemetry_module_environment_sensor_type = 146;
/*
* Specify the peferred GPIO Pin for sensor readings
*/
uint32 telemetry_module_environment_sensor_pin = 147;
/*
* Bit field of boolean configuration options for POSITION messages
@ -952,12 +851,6 @@ message RadioConfig {
* Overrides the ADC_MULTIPLIER defined in variant for battery voltage calculation.
*/
float adc_multiplier_override = 175;
/*
* Interval in seconds of how often we should try to send our
* environent measurements to the mesh
*/
uint32 telemetry_module_environment_update_interval = 177;
}
/*

View file

@ -91,3 +91,57 @@ message Telemetry {
EnvironmentMetrics environment_metrics = 3;
}
}
/*
* TODO: REPLACE
*/
enum TelemetrySensorType {
/*
* No external telemetry sensor
*/
NotSet = 0;
/*
* TODO: REPLACE
*/
DHT11 = 1;
/*
* TODO: REPLACE
*/
DS18B20 = 2;
/*
* TODO: REPLACE
*/
DHT12 = 3;
/*
* TODO: REPLACE
*/
DHT21 = 4;
/*
* TODO: REPLACE
*/
DHT22 = 5;
/*
* TODO: REPLACE
*/
BME280 = 6;
/*
* TODO: REPLACE
*/
BME680 = 7;
/*
* TODO: REPLACE
*/
MCP9808 = 8;
/*
* TODO: REPLACE
*/
SHTC3 = 9;
};