From ee114d4e89baba458e24bfb4e0d8468a632b4391 Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Mon, 28 Jul 2025 12:34:53 +0200 Subject: [PATCH 1/6] Add admin commands for SCDXX CO2 sensors --- meshtastic/admin.proto | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index 0259c2a3..ef2e25d0 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -471,6 +471,11 @@ message AdminMessage { * Tell the node to reset the nodedb. */ int32 nodedb_reset = 100; + + /* + * SCDXX CO2 sensor configuration + */ + SCDXX_config scdxx_config = 102; } } @@ -575,3 +580,30 @@ message KeyVerificationAdmin { */ optional uint32 security_number = 4; } + +message SCDXX_config { + /* + * Set Automatic self-calibration enabled + */ + optional bool set_asc = 1; + + /* + * Recalibration target CO2 concentration in ppm (FRC or ASC) + */ + optional uint32 target_co2_conc = 2; + + /* + * Reference temperature in degC + */ + optional float temperature = 4; + + /* + * Altitude of sensor in meters above sea level. 0 - 3000m (overrides ambient pressure) + */ + optional uint32 altitude = 5; + + /* + * Sensor ambient pressure in Pa. 70000 - 120000 Pa (overrides altitude) + */ + optional uint32 ambient_pressure = 6; +} From e6906159512a5152d398b9765ae0b6f5593846d2 Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Mon, 28 Jul 2025 21:52:49 +0200 Subject: [PATCH 2/6] Admin message for different sensor configs --- meshtastic/admin.proto | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index ef2e25d0..b3291740 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -473,9 +473,9 @@ message AdminMessage { int32 nodedb_reset = 100; /* - * SCDXX CO2 sensor configuration + * Parameters and sensor configuration */ - SCDXX_config scdxx_config = 102; + SensorConfig sensor_config = 102; } } @@ -581,6 +581,13 @@ message KeyVerificationAdmin { optional uint32 security_number = 4; } +message SensorConfig { + /* + * SCDXX CO2 Sensor configuration + */ + SCDXX_config scdxx_config = 1; +} + message SCDXX_config { /* * Set Automatic self-calibration enabled From 27d40f03d2750e4bbc4d167d091b19edd27f0edf Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Tue, 29 Jul 2025 14:27:08 +0200 Subject: [PATCH 3/6] Add factory reset for scdxx --- meshtastic/admin.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index b3291740..65e3eac9 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -613,4 +613,9 @@ message SCDXX_config { * Sensor ambient pressure in Pa. 70000 - 120000 Pa (overrides altitude) */ optional uint32 ambient_pressure = 6; + + /* + * Perform a factory reset of the sensor + */ + optional bool factory_reset = 7; } From 6a26b23faf7cb4bb221db702ab7b2ab19096dc72 Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Fri, 1 Aug 2025 13:38:29 +0200 Subject: [PATCH 4/6] Add low power and change to SCD4X --- meshtastic/admin.proto | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index 65e3eac9..a9810809 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -583,12 +583,12 @@ message KeyVerificationAdmin { message SensorConfig { /* - * SCDXX CO2 Sensor configuration + * SCD4X CO2 Sensor configuration */ - SCDXX_config scdxx_config = 1; + SCD4X_config scd4x_config = 1; } -message SCDXX_config { +message SCD4X_config { /* * Set Automatic self-calibration enabled */ @@ -618,4 +618,9 @@ message SCDXX_config { * Perform a factory reset of the sensor */ optional bool factory_reset = 7; + + /* + * Low Power mode for sensor + */ + optional bool low_power = 8; } From 05eee86c47304f0de859e5a79f9bfda9b0bd4a55 Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Mon, 4 Aug 2025 13:23:05 +0200 Subject: [PATCH 5/6] Minor fixes on scd4x_config protobuf --- meshtastic/admin.proto | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index a9810809..3d68eea2 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -597,22 +597,22 @@ message SCD4X_config { /* * Recalibration target CO2 concentration in ppm (FRC or ASC) */ - optional uint32 target_co2_conc = 2; + optional uint32 set_target_co2_conc = 2; /* * Reference temperature in degC */ - optional float temperature = 4; + optional float set_temperature = 4; /* * Altitude of sensor in meters above sea level. 0 - 3000m (overrides ambient pressure) */ - optional uint32 altitude = 5; + optional uint32 set_altitude = 5; /* * Sensor ambient pressure in Pa. 70000 - 120000 Pa (overrides altitude) */ - optional uint32 ambient_pressure = 6; + optional uint32 set_ambient_pressure = 6; /* * Perform a factory reset of the sensor @@ -620,7 +620,7 @@ message SCD4X_config { optional bool factory_reset = 7; /* - * Low Power mode for sensor + * Power mode for sensor (true for low power, false for normal) */ - optional bool low_power = 8; + optional bool set_power_mode = 8; } From e8544c529fc5a83593e206620ca795f8dadd9b96 Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Mon, 4 Aug 2025 14:56:54 +0200 Subject: [PATCH 6/6] Fix protobuf definition for SCD4X --- meshtastic/admin.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index 3d68eea2..f35b689c 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -602,25 +602,25 @@ message SCD4X_config { /* * Reference temperature in degC */ - optional float set_temperature = 4; + optional float set_temperature = 3; /* * Altitude of sensor in meters above sea level. 0 - 3000m (overrides ambient pressure) */ - optional uint32 set_altitude = 5; + optional uint32 set_altitude = 4; /* * Sensor ambient pressure in Pa. 70000 - 120000 Pa (overrides altitude) */ - optional uint32 set_ambient_pressure = 6; + optional uint32 set_ambient_pressure = 5; /* * Perform a factory reset of the sensor */ - optional bool factory_reset = 7; + optional bool factory_reset = 6; /* * Power mode for sensor (true for low power, false for normal) */ - optional bool set_power_mode = 8; + optional bool set_power_mode = 7; }