From deb05e9514cf1071cfc7fd3b6ab31ae83a661ea3 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 13 Aug 2024 18:04:12 -0500 Subject: [PATCH 01/23] Remove dos-style formatting from telemetry.proto --- meshtastic/telemetry.proto | 856 ++++++++++++++++++------------------- 1 file changed, 428 insertions(+), 428 deletions(-) diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index f3ab552..98404cf 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -1,428 +1,428 @@ -syntax = "proto3"; - -package meshtastic; - -option csharp_namespace = "Meshtastic.Protobufs"; -option go_package = "github.com/meshtastic/go/generated"; -option java_outer_classname = "TelemetryProtos"; -option java_package = "com.geeksville.mesh"; -option swift_prefix = ""; - -/* - * Key native device metrics such as battery level - */ -message DeviceMetrics { - /* - * 0-100 (>100 means powered) - */ - uint32 battery_level = 1; - - /* - * Voltage measured - */ - float voltage = 2; - - /* - * Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). - */ - float channel_utilization = 3; - - /* - * Percent of airtime for transmission used within the last hour. - */ - float air_util_tx = 4; - - /* - * How long the device has been running since the last reboot (in seconds) - */ - uint32 uptime_seconds = 5; -} - -/* - * Weather station or other environmental metrics - */ -message EnvironmentMetrics { - /* - * Temperature measured - */ - float temperature = 1; - - /* - * Relative humidity percent measured - */ - float relative_humidity = 2; - - /* - * Barometric pressure in hPA measured - */ - float barometric_pressure = 3; - - /* - * Gas resistance in MOhm measured - */ - float gas_resistance = 4; - - /* - * Voltage measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x) - */ - float voltage = 5; - - /* - * Current measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x) - */ - float current = 6; - - /* - * relative scale IAQ value as measured by Bosch BME680 . value 0-500. - * Belongs to Air Quality but is not particle but VOC measurement. Other VOC values can also be put in here. - */ - uint32 iaq = 7; - - /* - * RCWL9620 Doppler Radar Distance Sensor, used for water level detection. Float value in mm. - */ - float distance = 8; - - /* - * VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. - */ - float lux = 9; - - /* - * VEML7700 high accuracy white light(irradiance) not calibrated digital 16-bit resolution sensor. - */ - float white_lux = 10; - - /* - * Infrared lux - */ - float ir_lux = 11; - - /* - * Ultraviolet lux - */ - float uv_lux = 12; - - /* - * Wind direction in degrees - * 0 degrees = North, 90 = East, etc... - */ - uint32 wind_direction = 13; - - /* - * Wind speed in m/s - */ - float wind_speed = 14; - - /* - * Weight in KG - */ - float weight = 15; - - /* - * Wind gust in m/s - */ - float wind_gust = 16; - - /* - * Wind lull in m/s - */ - float wind_lull = 17; -} - -/* - * Power Metrics (voltage / current / etc) - */ -message PowerMetrics { - /* - * Voltage (Ch1) - */ - float ch1_voltage = 1; - - /* - * Current (Ch1) - */ - float ch1_current = 2; - - /* - * Voltage (Ch2) - */ - float ch2_voltage = 3; - - /* - * Current (Ch2) - */ - float ch2_current = 4; - - /* - * Voltage (Ch3) - */ - float ch3_voltage = 5; - - /* - * Current (Ch3) - */ - float ch3_current = 6; -} - -/* - * Air quality metrics - */ -message AirQualityMetrics { - /* - * Concentration Units Standard PM1.0 - */ - uint32 pm10_standard = 1; - - /* - * Concentration Units Standard PM2.5 - */ - uint32 pm25_standard = 2; - - /* - * Concentration Units Standard PM10.0 - */ - uint32 pm100_standard = 3; - - /* - * Concentration Units Environmental PM1.0 - */ - uint32 pm10_environmental = 4; - - /* - * Concentration Units Environmental PM2.5 - */ - uint32 pm25_environmental = 5; - - /* - * Concentration Units Environmental PM10.0 - */ - uint32 pm100_environmental = 6; - - /* - * 0.3um Particle Count - */ - uint32 particles_03um = 7; - - /* - * 0.5um Particle Count - */ - uint32 particles_05um = 8; - - /* - * 1.0um Particle Count - */ - uint32 particles_10um = 9; - - /* - * 2.5um Particle Count - */ - uint32 particles_25um = 10; - - /* - * 5.0um Particle Count - */ - uint32 particles_50um = 11; - - /* - * 10.0um Particle Count - */ - uint32 particles_100um = 12; -} - -/* - * Types of Measurements the telemetry module is equipped to handle - */ -message Telemetry { - /* - * Seconds since 1970 - or 0 for unknown/unset - */ - fixed32 time = 1; - - oneof variant { - /* - * Key native device metrics such as battery level - */ - DeviceMetrics device_metrics = 2; - - /* - * Weather station or other environmental metrics - */ - EnvironmentMetrics environment_metrics = 3; - - /* - * Air quality metrics - */ - AirQualityMetrics air_quality_metrics = 4; - - /* - * Power Metrics - */ - PowerMetrics power_metrics = 5; - } -} - -/* - * Supported I2C Sensors for telemetry in Meshtastic - */ -enum TelemetrySensorType { - /* - * No external telemetry sensor explicitly set - */ - SENSOR_UNSET = 0; - - /* - * High accuracy temperature, pressure, humidity - */ - BME280 = 1; - - /* - * High accuracy temperature, pressure, humidity, and air resistance - */ - BME680 = 2; - - /* - * Very high accuracy temperature - */ - MCP9808 = 3; - - /* - * Moderate accuracy current and voltage - */ - INA260 = 4; - - /* - * Moderate accuracy current and voltage - */ - INA219 = 5; - - /* - * High accuracy temperature and pressure - */ - BMP280 = 6; - - /* - * High accuracy temperature and humidity - */ - SHTC3 = 7; - - /* - * High accuracy pressure - */ - LPS22 = 8; - - /* - * 3-Axis magnetic sensor - */ - QMC6310 = 9; - - /* - * 6-Axis inertial measurement sensor - */ - QMI8658 = 10; - - /* - * 3-Axis magnetic sensor - */ - QMC5883L = 11; - - /* - * High accuracy temperature and humidity - */ - SHT31 = 12; - - /* - * PM2.5 air quality sensor - */ - PMSA003I = 13; - - /* - * INA3221 3 Channel Voltage / Current Sensor - */ - INA3221 = 14; - - /* - * BMP085/BMP180 High accuracy temperature and pressure (older Version of BMP280) - */ - BMP085 = 15; - - /* - * RCWL-9620 Doppler Radar Distance Sensor, used for water level detection - */ - RCWL9620 = 16; - - /* - * Sensirion High accuracy temperature and humidity - */ - SHT4X = 17; - - /* - * VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. - */ - VEML7700 = 18; - - /* - * MLX90632 non-contact IR temperature sensor. - */ - MLX90632 = 19; - - /* - * TI OPT3001 Ambient Light Sensor - */ - OPT3001 = 20; - - /* - * Lite On LTR-390UV-01 UV Light Sensor - */ - LTR390UV = 21; - - /* - * AMS TSL25911FN RGB Light Sensor - */ - TSL25911FN = 22; - - /* - * AHT10 Integrated temperature and humidity sensor - */ - AHT10 = 23; - - /* - * DFRobot Lark Weather station (temperature, humidity, pressure, wind speed and direction) - */ - DFROBOT_LARK = 24; - - /* - * NAU7802 Scale Chip or compatible - */ - NAU7802 = 25; - - /* - * BMP3XX High accuracy temperature and pressure - */ - BMP3XX = 26; - - /* - * ICM-20948 9-Axis digital motion processor - */ - ICM20948 = 27; - - /* - * MAX17048 1S lipo battery sensor (voltage, state of charge, time to go) - */ - MAX17048 = 28; -} - -/* - * NAU7802 Telemetry configuration, for saving to flash - */ -message Nau7802Config { - /* - * The offset setting for the NAU7802 - */ - int32 zeroOffset = 1; - - /* - * The calibration factor for the NAU7802 - */ - float calibrationFactor = 2; -} +syntax = "proto3"; + +package meshtastic; + +option csharp_namespace = "Meshtastic.Protobufs"; +option go_package = "github.com/meshtastic/go/generated"; +option java_outer_classname = "TelemetryProtos"; +option java_package = "com.geeksville.mesh"; +option swift_prefix = ""; + +/* + * Key native device metrics such as battery level + */ +message DeviceMetrics { + /* + * 0-100 (>100 means powered) + */ + uint32 battery_level = 1; + + /* + * Voltage measured + */ + float voltage = 2; + + /* + * Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). + */ + float channel_utilization = 3; + + /* + * Percent of airtime for transmission used within the last hour. + */ + float air_util_tx = 4; + + /* + * How long the device has been running since the last reboot (in seconds) + */ + uint32 uptime_seconds = 5; +} + +/* + * Weather station or other environmental metrics + */ +message EnvironmentMetrics { + /* + * Temperature measured + */ + float temperature = 1; + + /* + * Relative humidity percent measured + */ + float relative_humidity = 2; + + /* + * Barometric pressure in hPA measured + */ + float barometric_pressure = 3; + + /* + * Gas resistance in MOhm measured + */ + float gas_resistance = 4; + + /* + * Voltage measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x) + */ + float voltage = 5; + + /* + * Current measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x) + */ + float current = 6; + + /* + * relative scale IAQ value as measured by Bosch BME680 . value 0-500. + * Belongs to Air Quality but is not particle but VOC measurement. Other VOC values can also be put in here. + */ + uint32 iaq = 7; + + /* + * RCWL9620 Doppler Radar Distance Sensor, used for water level detection. Float value in mm. + */ + float distance = 8; + + /* + * VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. + */ + float lux = 9; + + /* + * VEML7700 high accuracy white light(irradiance) not calibrated digital 16-bit resolution sensor. + */ + float white_lux = 10; + + /* + * Infrared lux + */ + float ir_lux = 11; + + /* + * Ultraviolet lux + */ + float uv_lux = 12; + + /* + * Wind direction in degrees + * 0 degrees = North, 90 = East, etc... + */ + uint32 wind_direction = 13; + + /* + * Wind speed in m/s + */ + float wind_speed = 14; + + /* + * Weight in KG + */ + float weight = 15; + + /* + * Wind gust in m/s + */ + float wind_gust = 16; + + /* + * Wind lull in m/s + */ + float wind_lull = 17; +} + +/* + * Power Metrics (voltage / current / etc) + */ +message PowerMetrics { + /* + * Voltage (Ch1) + */ + float ch1_voltage = 1; + + /* + * Current (Ch1) + */ + float ch1_current = 2; + + /* + * Voltage (Ch2) + */ + float ch2_voltage = 3; + + /* + * Current (Ch2) + */ + float ch2_current = 4; + + /* + * Voltage (Ch3) + */ + float ch3_voltage = 5; + + /* + * Current (Ch3) + */ + float ch3_current = 6; +} + +/* + * Air quality metrics + */ +message AirQualityMetrics { + /* + * Concentration Units Standard PM1.0 + */ + uint32 pm10_standard = 1; + + /* + * Concentration Units Standard PM2.5 + */ + uint32 pm25_standard = 2; + + /* + * Concentration Units Standard PM10.0 + */ + uint32 pm100_standard = 3; + + /* + * Concentration Units Environmental PM1.0 + */ + uint32 pm10_environmental = 4; + + /* + * Concentration Units Environmental PM2.5 + */ + uint32 pm25_environmental = 5; + + /* + * Concentration Units Environmental PM10.0 + */ + uint32 pm100_environmental = 6; + + /* + * 0.3um Particle Count + */ + uint32 particles_03um = 7; + + /* + * 0.5um Particle Count + */ + uint32 particles_05um = 8; + + /* + * 1.0um Particle Count + */ + uint32 particles_10um = 9; + + /* + * 2.5um Particle Count + */ + uint32 particles_25um = 10; + + /* + * 5.0um Particle Count + */ + uint32 particles_50um = 11; + + /* + * 10.0um Particle Count + */ + uint32 particles_100um = 12; +} + +/* + * Types of Measurements the telemetry module is equipped to handle + */ +message Telemetry { + /* + * Seconds since 1970 - or 0 for unknown/unset + */ + fixed32 time = 1; + + oneof variant { + /* + * Key native device metrics such as battery level + */ + DeviceMetrics device_metrics = 2; + + /* + * Weather station or other environmental metrics + */ + EnvironmentMetrics environment_metrics = 3; + + /* + * Air quality metrics + */ + AirQualityMetrics air_quality_metrics = 4; + + /* + * Power Metrics + */ + PowerMetrics power_metrics = 5; + } +} + +/* + * Supported I2C Sensors for telemetry in Meshtastic + */ +enum TelemetrySensorType { + /* + * No external telemetry sensor explicitly set + */ + SENSOR_UNSET = 0; + + /* + * High accuracy temperature, pressure, humidity + */ + BME280 = 1; + + /* + * High accuracy temperature, pressure, humidity, and air resistance + */ + BME680 = 2; + + /* + * Very high accuracy temperature + */ + MCP9808 = 3; + + /* + * Moderate accuracy current and voltage + */ + INA260 = 4; + + /* + * Moderate accuracy current and voltage + */ + INA219 = 5; + + /* + * High accuracy temperature and pressure + */ + BMP280 = 6; + + /* + * High accuracy temperature and humidity + */ + SHTC3 = 7; + + /* + * High accuracy pressure + */ + LPS22 = 8; + + /* + * 3-Axis magnetic sensor + */ + QMC6310 = 9; + + /* + * 6-Axis inertial measurement sensor + */ + QMI8658 = 10; + + /* + * 3-Axis magnetic sensor + */ + QMC5883L = 11; + + /* + * High accuracy temperature and humidity + */ + SHT31 = 12; + + /* + * PM2.5 air quality sensor + */ + PMSA003I = 13; + + /* + * INA3221 3 Channel Voltage / Current Sensor + */ + INA3221 = 14; + + /* + * BMP085/BMP180 High accuracy temperature and pressure (older Version of BMP280) + */ + BMP085 = 15; + + /* + * RCWL-9620 Doppler Radar Distance Sensor, used for water level detection + */ + RCWL9620 = 16; + + /* + * Sensirion High accuracy temperature and humidity + */ + SHT4X = 17; + + /* + * VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. + */ + VEML7700 = 18; + + /* + * MLX90632 non-contact IR temperature sensor. + */ + MLX90632 = 19; + + /* + * TI OPT3001 Ambient Light Sensor + */ + OPT3001 = 20; + + /* + * Lite On LTR-390UV-01 UV Light Sensor + */ + LTR390UV = 21; + + /* + * AMS TSL25911FN RGB Light Sensor + */ + TSL25911FN = 22; + + /* + * AHT10 Integrated temperature and humidity sensor + */ + AHT10 = 23; + + /* + * DFRobot Lark Weather station (temperature, humidity, pressure, wind speed and direction) + */ + DFROBOT_LARK = 24; + + /* + * NAU7802 Scale Chip or compatible + */ + NAU7802 = 25; + + /* + * BMP3XX High accuracy temperature and pressure + */ + BMP3XX = 26; + + /* + * ICM-20948 9-Axis digital motion processor + */ + ICM20948 = 27; + + /* + * MAX17048 1S lipo battery sensor (voltage, state of charge, time to go) + */ + MAX17048 = 28; +} + +/* + * NAU7802 Telemetry configuration, for saving to flash + */ +message Nau7802Config { + /* + * The offset setting for the NAU7802 + */ + int32 zeroOffset = 1; + + /* + * The calibration factor for the NAU7802 + */ + float calibrationFactor = 2; +} From eed2033cc3ce1bb730111f05826c6c8219a33d97 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 6 Aug 2024 19:29:32 -0500 Subject: [PATCH 02/23] Short turbo preset --- meshtastic/config.proto | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meshtastic/config.proto b/meshtastic/config.proto index d3756b5..97aafcf 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -825,8 +825,9 @@ message Config { /* * Very Long Range - Slow + * Deprecated in 2.5: Works only with txco and is unusably slow */ - VERY_LONG_SLOW = 2; + VERY_LONG_SLOW = 2 [deprecated = true]; /* * Medium Range - Slow @@ -852,6 +853,13 @@ message Config { * Long Range - Moderately Fast */ LONG_MODERATE = 7; + + /* + * Short Range - Turbo + * This is the fastest preset and the only one with 500kHz bandwidth. + * It is not legal to use in all regions due to this wider bandwidth. + */ + SHORT_TURBO = 8; } /* From a3242bd0b4efef4d0e2ef477d781904944e01d55 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Tue, 6 Aug 2024 17:37:33 -0700 Subject: [PATCH 03/23] Add `optional` keywords to stuff that can be "truly zero" within mesh packet payloads --- meshtastic/mesh.proto | 18 ++++---- meshtastic/module_config.proto | 1 + meshtastic/telemetry.proto | 80 +++++++++++++++++----------------- 3 files changed, 50 insertions(+), 49 deletions(-) diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 7d07066..619ad92 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -23,17 +23,17 @@ message Position { * The new preferred location encoding, multiply by 1e-7 to get degrees * in floating point */ - sfixed32 latitude_i = 1; + optional sfixed32 latitude_i = 1; /* * TODO: REPLACE */ - sfixed32 longitude_i = 2; + optional sfixed32 longitude_i = 2; /* * In meters above MSL (but see issue #359) */ - int32 altitude = 3; + optional int32 altitude = 3; /* * This is usually not sent over the mesh (to save space), but it is sent @@ -122,12 +122,12 @@ message Position { /* * HAE altitude in meters - can be used instead of MSL altitude */ - sint32 altitude_hae = 9; + optional sint32 altitude_hae = 9; /* * Geoidal separation in meters */ - sint32 altitude_geoidal_separation = 10; + optional sint32 altitude_geoidal_separation = 10; /* * Horizontal, Vertical and Position Dilution of Precision, in 1/100 units @@ -163,12 +163,12 @@ message Position { * - "yaw" indicates a relative rotation about the vertical axis * TODO: REMOVE/INTEGRATE */ - uint32 ground_speed = 15; + optional uint32 ground_speed = 15; /* * TODO: REPLACE */ - uint32 ground_track = 16; + optional uint32 ground_track = 16; /* * GPS fix quality (from NMEA GxGGA statement or similar) @@ -853,12 +853,12 @@ message Waypoint { /* * latitude_i */ - sfixed32 latitude_i = 2; + optional sfixed32 latitude_i = 2; /* * longitude_i */ - sfixed32 longitude_i = 3; + optional sfixed32 longitude_i = 3; /* * Time the waypoint is to expire (epoch) diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index 3879373..0281415 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -153,6 +153,7 @@ message ModuleConfig { * Works as a sort of status heartbeat for peace of mind */ uint32 state_broadcast_secs = 3; + /* * Send ASCII bell with alert message * Useful for triggering ext. notification on bell diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index 98404cf..af0181f 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -15,27 +15,27 @@ message DeviceMetrics { /* * 0-100 (>100 means powered) */ - uint32 battery_level = 1; + optional uint32 battery_level = 1; /* * Voltage measured */ - float voltage = 2; + optional float voltage = 2; /* * Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). */ - float channel_utilization = 3; + optional float channel_utilization = 3; /* * Percent of airtime for transmission used within the last hour. */ - float air_util_tx = 4; + optional float air_util_tx = 4; /* * How long the device has been running since the last reboot (in seconds) */ - uint32 uptime_seconds = 5; + optional uint32 uptime_seconds = 5; } /* @@ -45,89 +45,89 @@ message EnvironmentMetrics { /* * Temperature measured */ - float temperature = 1; + optional float temperature = 1; /* * Relative humidity percent measured */ - float relative_humidity = 2; + optional float relative_humidity = 2; /* * Barometric pressure in hPA measured */ - float barometric_pressure = 3; + optional float barometric_pressure = 3; /* * Gas resistance in MOhm measured */ - float gas_resistance = 4; + optional float gas_resistance = 4; /* * Voltage measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x) */ - float voltage = 5; + optional float voltage = 5; /* * Current measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x) */ - float current = 6; + optional float current = 6; /* * relative scale IAQ value as measured by Bosch BME680 . value 0-500. * Belongs to Air Quality but is not particle but VOC measurement. Other VOC values can also be put in here. */ - uint32 iaq = 7; + optional uint32 iaq = 7; /* * RCWL9620 Doppler Radar Distance Sensor, used for water level detection. Float value in mm. */ - float distance = 8; + optional float distance = 8; /* * VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. */ - float lux = 9; + optional float lux = 9; /* * VEML7700 high accuracy white light(irradiance) not calibrated digital 16-bit resolution sensor. */ - float white_lux = 10; + optional float white_lux = 10; /* * Infrared lux */ - float ir_lux = 11; + optional float ir_lux = 11; /* * Ultraviolet lux */ - float uv_lux = 12; + optional float uv_lux = 12; /* * Wind direction in degrees * 0 degrees = North, 90 = East, etc... */ - uint32 wind_direction = 13; + optional uint32 wind_direction = 13; /* * Wind speed in m/s */ - float wind_speed = 14; + optional float wind_speed = 14; /* * Weight in KG */ - float weight = 15; + optional float weight = 15; /* * Wind gust in m/s */ - float wind_gust = 16; + optional float wind_gust = 16; /* * Wind lull in m/s */ - float wind_lull = 17; + optional float wind_lull = 17; } /* @@ -137,32 +137,32 @@ message PowerMetrics { /* * Voltage (Ch1) */ - float ch1_voltage = 1; + optional float ch1_voltage = 1; /* * Current (Ch1) */ - float ch1_current = 2; + optional float ch1_current = 2; /* * Voltage (Ch2) */ - float ch2_voltage = 3; + optional float ch2_voltage = 3; /* * Current (Ch2) */ - float ch2_current = 4; + optional float ch2_current = 4; /* * Voltage (Ch3) */ - float ch3_voltage = 5; + optional float ch3_voltage = 5; /* * Current (Ch3) */ - float ch3_current = 6; + optional float ch3_current = 6; } /* @@ -172,62 +172,62 @@ message AirQualityMetrics { /* * Concentration Units Standard PM1.0 */ - uint32 pm10_standard = 1; + optional uint32 pm10_standard = 1; /* * Concentration Units Standard PM2.5 */ - uint32 pm25_standard = 2; + optional uint32 pm25_standard = 2; /* * Concentration Units Standard PM10.0 */ - uint32 pm100_standard = 3; + optional uint32 pm100_standard = 3; /* * Concentration Units Environmental PM1.0 */ - uint32 pm10_environmental = 4; + optional uint32 pm10_environmental = 4; /* * Concentration Units Environmental PM2.5 */ - uint32 pm25_environmental = 5; + optional uint32 pm25_environmental = 5; /* * Concentration Units Environmental PM10.0 */ - uint32 pm100_environmental = 6; + optional uint32 pm100_environmental = 6; /* * 0.3um Particle Count */ - uint32 particles_03um = 7; + optional uint32 particles_03um = 7; /* * 0.5um Particle Count */ - uint32 particles_05um = 8; + optional uint32 particles_05um = 8; /* * 1.0um Particle Count */ - uint32 particles_10um = 9; + optional uint32 particles_10um = 9; /* * 2.5um Particle Count */ - uint32 particles_25um = 10; + optional uint32 particles_25um = 10; /* * 5.0um Particle Count */ - uint32 particles_50um = 11; + optional uint32 particles_50um = 11; /* * 10.0um Particle Count */ - uint32 particles_100um = 12; + optional uint32 particles_100um = 12; } /* From e9b83744e29d4037d7f2dc7989541016924bfb4a Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 4 Aug 2024 22:36:33 -0500 Subject: [PATCH 04/23] Adds public_key and private_key for PKI co-authored-by: edinnen --- meshtastic/mesh.options | 2 ++ meshtastic/mesh.proto | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index 7075e2d..32a3104 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -3,6 +3,8 @@ *macaddr max_size:6 fixed_length:true # macaddrs *id max_size:16 # node id strings +*public_key max_size:32 # public key +*private_key max_size:32 # private key *User.long_name max_size:40 *User.short_name max_size:5 diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 619ad92..19f93e2 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -681,6 +681,12 @@ message User { * Indicates that the user's role in the mesh */ Config.DeviceConfig.Role role = 7; + + /* + * The public key of the user's device. + * This is sent out to other nodes on the mesh to allow them to compute a shared secret key. + */ + bytes public_key = 8; } /* @@ -1345,6 +1351,12 @@ message MyNodeInfo { * Phone/PC apps should compare this to their build number and if too low tell the user they must update their app */ uint32 min_app_version = 11; + + /* + * The private key of the device. + * This is used to create a shared key with a remote device. + */ + bytes private_key = 12; } /* From bc465e6522d442b47064d015daf49051fd65ba6f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 5 Aug 2024 12:04:21 -0500 Subject: [PATCH 05/23] Add the key used to PKI decrypt to MeshPacket --- meshtastic/mesh.proto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 19f93e2..cbf73dc 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1127,6 +1127,16 @@ message MeshPacket { * When receiving a packet, the difference between hop_start and hop_limit gives how many hops it traveled. */ uint32 hop_start = 15; + + /* + * Records the public key the packet was encrypted with, if applicable. + */ + bytes public_key = 16; + + /* + * Indicates whether the packet was en/decrypted using PKI + */ + bool pki_encrypted = 17; } /* From adb2ff256b52f3c7a34fbc1fd828cf42e0062e12 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 6 Aug 2024 20:35:38 -0500 Subject: [PATCH 06/23] Re-org some settings into a new SecurityConfig proto --- meshtastic/config.options | 4 ++++ meshtastic/config.proto | 48 ++++++++++++++++++++++++++++++++++++--- meshtastic/mesh.options | 1 - meshtastic/mesh.proto | 6 ----- 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/meshtastic/config.options b/meshtastic/config.options index 22dcc88..704d141 100644 --- a/meshtastic/config.options +++ b/meshtastic/config.options @@ -15,3 +15,7 @@ *LoRaConfig.channel_num int_size:16 *PowerConfig.device_battery_ina_address int_size:8 + +*SecurityConfig.public_key max_size:32 +*SecurityConfig.private_key max_size:32 +*SecurityConfig.admin_key max_size:32 diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 97aafcf..cd3575a 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -135,14 +135,16 @@ message Config { /* * Disabling this will disable the SerialConsole by not initilizing the StreamAPI + * Moved to SecurityConfig */ - bool serial_enabled = 2; + bool serial_enabled = 2[deprecated = true]; /* * By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). * Set this to true to leave the debug log outputting even when API is active. + * Moved to SecurityConfig */ - bool debug_log_enabled = 3; + bool debug_log_enabled = 3[deprecated = true]; /* * For boards without a hard wired button, this is the pin number that will be used @@ -175,8 +177,9 @@ message Config { /* * If true, device is considered to be "managed" by a mesh administrator * Clients should then limit available configuration and administrative options inside the user interface + * Moved to SecurityConfig */ - bool is_managed = 9; + bool is_managed = 9[deprecated = true]; /* * Disables the triple-press of user button to enable or disable GPS @@ -1018,6 +1021,44 @@ message Config { bool device_logging_enabled = 4; } + message SecurityConfig { + + /* + * The public key of the user's device. + * This is sent out to other nodes on the mesh to allow them to compute a shared secret key. + */ + bytes public_key = 1; + + /* + * The private key of the device. + * This is used to create a shared key with a remote device. + */ + bytes private_key = 2; + + /* + * This is the public key authorized to send admin messages to this node + */ + bytes admin_key = 3; + + /* + * If true, device is considered to be "managed" by a mesh administrator + * Clients should then limit available configuration and administrative options inside the user interface + */ + bool is_managed = 4; + + /* + * Disabling this will disable the SerialConsole by not initilizing the StreamAPI + */ + bool serial_enabled = 5; + + /* + * By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). + * Set this to true to leave the debug log outputting even when API is active. + */ + bool debug_log_enabled = 6; + + } + /* * Payload Variant */ @@ -1029,5 +1070,6 @@ message Config { DisplayConfig display = 5; LoRaConfig lora = 6; BluetoothConfig bluetooth = 7; + SecurityConfig security = 8; } } diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index 32a3104..872e310 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -4,7 +4,6 @@ *macaddr max_size:6 fixed_length:true # macaddrs *id max_size:16 # node id strings *public_key max_size:32 # public key -*private_key max_size:32 # private key *User.long_name max_size:40 *User.short_name max_size:5 diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index cbf73dc..095caa8 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1361,12 +1361,6 @@ message MyNodeInfo { * Phone/PC apps should compare this to their build number and if too low tell the user they must update their app */ uint32 min_app_version = 11; - - /* - * The private key of the device. - * This is used to create a shared key with a remote device. - */ - bytes private_key = 12; } /* From ecc4d42053eccebec1676977c5e19444f61d72c2 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 6 Aug 2024 20:52:57 -0500 Subject: [PATCH 07/23] Also move device_logging_enabled from bluetooth to SecurityConfig --- meshtastic/config.proto | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meshtastic/config.proto b/meshtastic/config.proto index cd3575a..6c77f4e 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -1017,8 +1017,9 @@ message Config { /* * Enables device (serial style logs) over Bluetooth + * Moved to SecurityConfig */ - bool device_logging_enabled = 4; + bool device_logging_enabled = 4[deprecated = true]; } message SecurityConfig { @@ -1057,6 +1058,11 @@ message Config { */ bool debug_log_enabled = 6; + /* + * Enables device (serial style logs) over Bluetooth + * Moved to SecurityConfig + */ + bool bluetooth_logging_enabled = 7; } /* From 6cde2e267209a8ccac9a3dce7913d24632339e8f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 6 Aug 2024 21:01:46 -0500 Subject: [PATCH 08/23] Add SecurityConfig to Localonly --- meshtastic/localonly.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshtastic/localonly.proto b/meshtastic/localonly.proto index 9694d7b..bcb2796 100644 --- a/meshtastic/localonly.proto +++ b/meshtastic/localonly.proto @@ -58,6 +58,11 @@ message LocalConfig { * NodeDB.cpp in the device code. */ uint32 version = 8; + + /* + * The part of the config that is specific to Security settings + */ + Config.SecurityConfig security = 9; } message LocalModuleConfig { From 684d1faf8edff8a30d23e79b079876d6b5d48ec8 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 7 Aug 2024 09:28:57 -0500 Subject: [PATCH 09/23] Add admin_channel_enabled to the security config --- meshtastic/config.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 6c77f4e..32ae91b 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -1063,6 +1063,11 @@ message Config { * Moved to SecurityConfig */ bool bluetooth_logging_enabled = 7; + + /* + * Enables incoming admin control over the "admin" channel + */ + bool admin_channel_enabled = 8 [default = false]; } /* From 04a3b65a946d273870c5c0fe1b7729f1c37c6642 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 7 Aug 2024 09:38:52 -0500 Subject: [PATCH 10/23] No default for you, Proto3 --- meshtastic/config.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 32ae91b..8cb77f0 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -1067,7 +1067,7 @@ message Config { /* * Enables incoming admin control over the "admin" channel */ - bool admin_channel_enabled = 8 [default = false]; + bool admin_channel_enabled = 8; } /* From c979c1ac8f9bd65eb4d48272ccc687418245a0e9 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 8 Aug 2024 06:55:51 -0700 Subject: [PATCH 11/23] Update config.proto Update comments to match discord conversation --- meshtastic/config.proto | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 8cb77f0..83e9dd4 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -1026,46 +1026,45 @@ message Config { /* * The public key of the user's device. - * This is sent out to other nodes on the mesh to allow them to compute a shared secret key. + * Sent out to other nodes on the mesh to allow them to compute a shared secret key. */ bytes public_key = 1; /* * The private key of the device. - * This is used to create a shared key with a remote device. + * Used to create a shared key with a remote device. */ bytes private_key = 2; /* - * This is the public key authorized to send admin messages to this node + * The public key authorized to send admin messages to this node. */ bytes admin_key = 3; /* - * If true, device is considered to be "managed" by a mesh administrator - * Clients should then limit available configuration and administrative options inside the user interface + * If true, device is considered to be "managed" by a mesh administrator via admin messages + * Device is managed by a mesh administrator. */ bool is_managed = 4; /* - * Disabling this will disable the SerialConsole by not initilizing the StreamAPI + * Serial Console over the Stream API." */ bool serial_enabled = 5; /* * By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). - * Set this to true to leave the debug log outputting even when API is active. + * Output live debug logging over serial. */ bool debug_log_enabled = 6; /* * Enables device (serial style logs) over Bluetooth - * Moved to SecurityConfig */ bool bluetooth_logging_enabled = 7; /* - * Enables incoming admin control over the "admin" channel + * Allow incoming device control over the insecure legacy admin channel. */ bool admin_channel_enabled = 8; } From d7ce4f30faecd5873dc19d2c138057027446373b Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Thu, 8 Aug 2024 08:10:02 -0700 Subject: [PATCH 12/23] Update config.proto update api name --- meshtastic/config.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 83e9dd4..47900e6 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -1056,7 +1056,7 @@ message Config { * By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). * Output live debug logging over serial. */ - bool debug_log_enabled = 6; + bool debug_log_api_enabled = 6; /* * Enables device (serial style logs) over Bluetooth From 66a6d11f7fd035c063c55aa7ac5fde946152a1b1 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 8 Aug 2024 06:52:25 -0500 Subject: [PATCH 13/23] Add client notification fromradio message --- meshtastic/mesh.options | 2 ++ meshtastic/mesh.proto | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index 872e310..9730a6e 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -46,6 +46,8 @@ *FileInfo.file_name max_size:228 +*ClientNotification.message max_size:400 + # MyMessage.name max_size:40 # or fixed_length or fixed_count, or max_count diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 095caa8..de07aea 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1540,9 +1540,41 @@ message FromRadio { * File system manifest messages */ FileInfo fileInfo = 15; + + /* + * Notification message to the client + */ + ClientNotification clientNotification = 16; } } +/* + * A notification message from the device to the client + * To be used for important messages that should to be displayed to the user + * in the form of push notifications or validation messages when saving + * invalid configuration. + */ +message ClientNotification { + /* + * The id of the packet we're notifying in response to + */ + optional uint32 reply_id = 1; + + /* + * Seconds since 1970 - or 0 for unknown/unset + */ + fixed32 time = 2; + + /* + * The level type of notification + */ + LogRecord.Level level = 3; + /* + * The message body of the notification + */ + string message = 4; +} + /* * Individual File info for the device */ From 000e9dcd38456592de762667c16b9007fbf07958 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 10 Aug 2024 22:58:01 -0500 Subject: [PATCH 14/23] Add SECURITY_CONFIG to admin.proto (#547) --- meshtastic/admin.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index 12fe0c7..1c637c9 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -58,6 +58,11 @@ message AdminMessage { * TODO: REPLACE */ BLUETOOTH_CONFIG = 6; + + /* + * TODO: REPLACE + */ + SECURITY_CONFIG = 7; } /* From 1ff2e736ca9e0e25cb9d565acb195b36630a95bc Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 11 Aug 2024 09:22:27 -0500 Subject: [PATCH 15/23] UserLite --- meshtastic/deviceonly.options | 5 ++++ meshtastic/deviceonly.proto | 47 ++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/meshtastic/deviceonly.options b/meshtastic/deviceonly.options index e9477a0..6f53317 100644 --- a/meshtastic/deviceonly.options +++ b/meshtastic/deviceonly.options @@ -14,3 +14,8 @@ *NodeInfoLite.channel int_size:8 *NodeInfoLite.hops_away int_size:8 + +*UserLite.long_name max_size:40 +*UserLite.short_name max_size:5 +*UserLite.public_key max_size:32 # public key +*UserLite.macaddr max_size:6 fixed_length:true diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index 9c700db..b3fb440 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -6,6 +6,7 @@ import "meshtastic/channel.proto"; import "meshtastic/localonly.proto"; import "meshtastic/mesh.proto"; import "meshtastic/telemetry.proto"; +import "meshtastic/config.proto"; import "nanopb.proto"; option csharp_namespace = "Meshtastic.Protobufs"; @@ -51,6 +52,50 @@ message PositionLite { Position.LocSource location_source = 5; } +message UserLite { + /* + * This is the addr of the radio. + */ + bytes macaddr = 1 [deprecated = true]; + + /* + * A full name for this user, i.e. "Kevin Hester" + */ + string long_name = 2; + + /* + * A VERY short name, ideally two characters. + * Suitable for a tiny OLED screen + */ + string short_name = 3; + + /* + * TBEAM, HELTEC, etc... + * Starting in 1.2.11 moved to hw_model enum in the NodeInfo object. + * Apps will still need the string here for older builds + * (so OTA update can find the right image), but if the enum is available it will be used instead. + */ + HardwareModel hw_model = 4; + + /* + * In some regions Ham radio operators have different bandwidth limitations than others. + * If this user is a licensed operator, set this flag. + * Also, "long_name" should be their licence number. + */ + bool is_licensed = 5; + + /* + * Indicates that the user's role in the mesh + */ + Config.DeviceConfig.Role role = 6; + + /* + * The public key of the user's device. + * This is sent out to other nodes on the mesh to allow them to compute a shared secret key. + */ + bytes public_key = 7; +} + message NodeInfoLite { /* * The node number @@ -60,7 +105,7 @@ message NodeInfoLite { /* * The user info for this node */ - User user = 2; + UserLite user = 2; /* * This position data. Note: before 1.2.14 we would also store the last time we've heard from this node in position.time, that is no longer true. From f03121f440ea38aa9fbdde5923eebbd97206032d Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 12 Aug 2024 18:11:07 -0500 Subject: [PATCH 16/23] Add NONE_PKI error message --- meshtastic/mesh.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index de07aea..bb4fab3 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -769,6 +769,11 @@ message Routing { * (i.e you did not send the request on the required bound channel) */ NOT_AUTHORIZED = 33; + + /* + * This message is not a failure, and indicates that the message was sent via PKI + */ + NONE_PKI = 34; } oneof variant { From f007d1d71932c66f445a531e4b4de13b4c33687e Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 13 Aug 2024 11:44:48 -0500 Subject: [PATCH 17/23] Rename NONE_PKI to PKI_FAILED --- meshtastic/mesh.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index bb4fab3..9de4c2c 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -771,9 +771,9 @@ message Routing { NOT_AUTHORIZED = 33; /* - * This message is not a failure, and indicates that the message was sent via PKI + * The client specified a PKI transport, but the node was unable to send the packet using PKI (and did not send the message at all) */ - NONE_PKI = 34; + PKI_FAILED = 34; } oneof variant { From 8b5b2faf662b364754809f923271022f4f1492ed Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 14 Aug 2024 15:31:46 -0500 Subject: [PATCH 18/23] Add PKI_UNKNOWN_PUBKEY (#557) --- meshtastic/mesh.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 9de4c2c..6679c73 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -774,6 +774,11 @@ message Routing { * The client specified a PKI transport, but the node was unable to send the packet using PKI (and did not send the message at all) */ PKI_FAILED = 34; + + /* + * The receiving node does not have a Public Key to decode with + */ + PKI_UNKNOWN_PUBKEY = 35; } oneof variant { From 06d7ca5821460b33f9d66b11323aa53965389699 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 15 Aug 2024 16:32:42 -0500 Subject: [PATCH 19/23] Adds Admin session_passkey to prevent replay of admin packets (#558) * Adds Admin session_passkey to prevent replay of admin packets * Update comment on admin_passkey --- meshtastic/admin.options | 2 ++ meshtastic/admin.proto | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/meshtastic/admin.options b/meshtastic/admin.options index 4804d89..022c4fd 100644 --- a/meshtastic/admin.options +++ b/meshtastic/admin.options @@ -1,5 +1,7 @@ *AdminMessage.payload_variant anonymous_oneof:true +*AdminMessage.session_passkey max_size:8 + *AdminMessage.set_canned_message_module_messages max_size:201 *AdminMessage.get_canned_message_module_messages_response max_size:201 *AdminMessage.delete_file_request max_size:201 diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index 1c637c9..c461ffe 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -20,6 +20,14 @@ option swift_prefix = ""; * (Prior to 1.2 these operations were done via special ToRadio operations) */ message AdminMessage { + + /* + * The node generates this key and sends it with any get_x_response packets. + * The client MUST include the same key with any set_x commands. Key expires after 300 seconds. + * Prevents replay attacks for admin messages. + */ + bytes session_passkey = 101; + /* * TODO: REPLACE */ From ceb1170e2c929fb7429208cb8adf50e198568a03 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 15 Aug 2024 20:41:11 -0500 Subject: [PATCH 20/23] Local device mesh stats --- meshtastic/telemetry.options | 5 +++- meshtastic/telemetry.proto | 48 ++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/meshtastic/telemetry.options b/meshtastic/telemetry.options index 72aba92..073412a 100644 --- a/meshtastic/telemetry.options +++ b/meshtastic/telemetry.options @@ -2,4 +2,7 @@ # https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options *EnvironmentMetrics.iaq int_size:16 -*EnvironmentMetrics.wind_direction int_size:16 \ No newline at end of file +*EnvironmentMetrics.wind_direction int_size:16 + +*LocalStats.num_online_nodes int_size:16 +*LocalStats.num_total_nodes int_size:16 diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index af0181f..6ca8db3 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -230,6 +230,49 @@ message AirQualityMetrics { optional uint32 particles_100um = 12; } +/* + * Local device mesh statistics + */ +message LocalStats { + /* + * How long the device has been running since the last reboot (in seconds) + */ + uint32 uptime_seconds = 1; + /* + * Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). + */ + float channel_utilization = 2; + /* + * Percent of airtime for transmission used within the last hour. + */ + float air_util_tx = 3; + + /* + * Number of packets sent + */ + uint32 num_packets_tx = 4; + + /* + * Number of packets received good + */ + uint32 num_packets_rx = 5; + + /* + * Number of packets received that are malformed or violate the protocol + */ + uint32 num_packets_rx_bad = 6; + + /* + * Number of nodes online (in the past 2 hours) + */ + uint32 num_online_nodes = 7; + + /* + * Number of nodes total + */ + uint32 num_total_nodes = 8; +} + /* * Types of Measurements the telemetry module is equipped to handle */ @@ -259,6 +302,11 @@ message Telemetry { * Power Metrics */ PowerMetrics power_metrics = 5; + + /* + * Local device mesh statistics + */ + LocalStats local_stats = 6; } } From 6a53f766bc7005615bc8ac202af0c122ac795ffc Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 16 Aug 2024 18:21:01 -0500 Subject: [PATCH 21/23] Set time only admin message --- meshtastic/admin.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index c461ffe..c2c09cd 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -318,6 +318,12 @@ message AdminMessage { */ bool remove_fixed_position = 42; + /* + * Set time only on the node + * Convenience method to set the time on the node (as NTP quality) without any other position data + */ + uint32 set_time_only = 43; + /* * Begins an edit transaction for config, module config, owner, and channel settings changes * This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings) From 8ac99eefe8d7b38b4ecdba9ef5858d6bcb3ba537 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 16 Aug 2024 18:31:16 -0500 Subject: [PATCH 22/23] Fixed --- meshtastic/admin.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index c2c09cd..821fac3 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -322,7 +322,7 @@ message AdminMessage { * Set time only on the node * Convenience method to set the time on the node (as NTP quality) without any other position data */ - uint32 set_time_only = 43; + fixed32 set_time_only = 43; /* * Begins an edit transaction for config, module config, owner, and channel settings changes From 59d035a37dbeadb28db97acce5f738ba52ee9d3a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 16 Aug 2024 18:49:23 -0500 Subject: [PATCH 23/23] net --- meshtastic/admin.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index 821fac3..37553d2 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -320,7 +320,7 @@ message AdminMessage { /* * Set time only on the node - * Convenience method to set the time on the node (as NTP quality) without any other position data + * Convenience method to set the time on the node (as Net quality) without any other position data */ fixed32 set_time_only = 43;