From 94951689286278f56a2d092a1217cc95706c394b Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 4 Mar 2022 04:46:12 -0800 Subject: [PATCH 01/11] Move battery leve --- mesh.proto | 5 ----- telemetry.proto | 39 +++++++++++++++++++++++++++++++-------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/mesh.proto b/mesh.proto index a103760..312991c 100644 --- a/mesh.proto +++ b/mesh.proto @@ -58,11 +58,6 @@ message Position { */ int32 altitude = 3; - /* - * 1-100 (0 means not provided) - */ - int32 battery_level = 4; - /* * This is usually not sent over the mesh (to save space), but it is sent * from the phone so that the local device can set its RTC If it is sent over diff --git a/telemetry.proto b/telemetry.proto index 0a14325..a7ee8a3 100644 --- a/telemetry.proto +++ b/telemetry.proto @@ -6,33 +6,56 @@ option go_package = "github.com/meshtastic/gomeshproto"; */ message Telemetry { - /* - * TODO: REPLACE + /* + * This is usually not sent over the mesh (to save space), but it is sent + * from the phone so that the local device can set its RTC If it is sent over + * the mesh (because there are devices on the mesh without GPS), it will only + * be sent by devices which has a hardware GPS clock. + * seconds since 1970 */ - float temperature = 1; + fixed32 time = 1; + + /* + * 1-100 (0 means not provided) + */ + int32 battery_level = 2; + + /* + * This is sent by node only if it a router and if hop_limit is set to 0 + * and is not being sent as a reliable message. + * + * Note to Ben & Garth : When position is refactored, please move this to the same message + * "time" is moving to. + */ + bool router_heartbeat = 3; /* * TODO: REPLACE */ - float relative_humidity = 2; + float temperature = 4; /* * TODO: REPLACE */ - float barometric_pressure = 3; + float relative_humidity = 5; /* * TODO: REPLACE */ - float gas_resistance = 4; + float barometric_pressure = 6; /* * TODO: REPLACE */ - float voltage = 5; + float gas_resistance = 7; /* * TODO: REPLACE */ - float current = 6; + float voltage = 8; + + /* + * TODO: REPLACE + */ + float current = 9; } From d947de35e55c64f0147bb096a059f1f167675182 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 4 Mar 2022 04:50:29 -0800 Subject: [PATCH 02/11] Add Files --- mesh.proto | 15 +++++++++++++++ telemetry.proto | 24 +++++++++++++++++------- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/mesh.proto b/mesh.proto index 312991c..c47aa5c 100644 --- a/mesh.proto +++ b/mesh.proto @@ -1196,6 +1196,21 @@ message MyNodeInfo { * Percent of airtime for transmission used within the last hour. */ float air_util_tx = 20; + /* + * How many routers are we in range of? + */ + repeated uint32 router = 21; + + /* + * What is the snr of the last router message? + */ + repeated float router_snr = 22; + + /* + * How long has it been since we last heard from the router? + */ + repeated uint32 router_sec = 23; + } /* diff --git a/telemetry.proto b/telemetry.proto index a7ee8a3..fc027eb 100644 --- a/telemetry.proto +++ b/telemetry.proto @@ -20,6 +20,16 @@ message Telemetry { */ int32 battery_level = 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; + /* * This is sent by node only if it a router and if hop_limit is set to 0 * and is not being sent as a reliable message. @@ -27,35 +37,35 @@ message Telemetry { * Note to Ben & Garth : When position is refactored, please move this to the same message * "time" is moving to. */ - bool router_heartbeat = 3; + bool router_heartbeat = 5; /* * TODO: REPLACE */ - float temperature = 4; + float temperature = 6; /* * TODO: REPLACE */ - float relative_humidity = 5; + float relative_humidity = 7; /* * TODO: REPLACE */ - float barometric_pressure = 6; + float barometric_pressure = 8; /* * TODO: REPLACE */ - float gas_resistance = 7; + float gas_resistance = 9; /* * TODO: REPLACE */ - float voltage = 8; + float voltage = 10; /* * TODO: REPLACE */ - float current = 9; + float current = 11; } From 33f08f8188df8073506847a4e984c43d442b4b69 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 4 Mar 2022 05:26:16 -0800 Subject: [PATCH 03/11] update snr --- mesh.proto | 2 +- telemetry.proto | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mesh.proto b/mesh.proto index c47aa5c..efc0ee8 100644 --- a/mesh.proto +++ b/mesh.proto @@ -980,7 +980,7 @@ message NodeInfo { * Returns the Signal-to-noise ratio (SNR) of the last received message, * as measured by the receiver. Return SNR of the last received message in dB */ - float snr = 7; + float snr = 4; /* * TODO: REMOVE/INTEGRATE diff --git a/telemetry.proto b/telemetry.proto index fc027eb..e11393e 100644 --- a/telemetry.proto +++ b/telemetry.proto @@ -10,13 +10,13 @@ message Telemetry { * This is usually not sent over the mesh (to save space), but it is sent * from the phone so that the local device can set its RTC If it is sent over * the mesh (because there are devices on the mesh without GPS), it will only - * be sent by devices which has a hardware GPS clock. + * be sent by devices which has a hardware GPS clock (IE Mobile Phone). * seconds since 1970 */ fixed32 time = 1; /* - * 1-100 (0 means not provided) + * 1-100 (0 means powered) */ int32 battery_level = 2; @@ -32,10 +32,7 @@ message Telemetry { /* * This is sent by node only if it a router and if hop_limit is set to 0 - * and is not being sent as a reliable message. - * - * Note to Ben & Garth : When position is refactored, please move this to the same message - * "time" is moving to. + * and is not being sent as a reliable message. */ bool router_heartbeat = 5; From 41b3dd6c07a59a4debf19a912a7becd26895181f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 15 Mar 2022 07:24:53 -0500 Subject: [PATCH 04/11] Move snr --- mesh.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesh.proto b/mesh.proto index efc0ee8..7545bc2 100644 --- a/mesh.proto +++ b/mesh.proto @@ -1012,7 +1012,7 @@ message NodeInfo { /* * Set to indicate the last time we received a packet from this node */ - fixed32 last_heard = 4; + fixed32 last_heard = 5; } /* From 1821c1b378587dd337c804fce7fd256f37a3ca0a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 18 Mar 2022 17:24:20 -0500 Subject: [PATCH 05/11] Spacing --- telemetry.proto | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/telemetry.proto b/telemetry.proto index e11393e..c806c38 100644 --- a/telemetry.proto +++ b/telemetry.proto @@ -6,21 +6,21 @@ option go_package = "github.com/meshtastic/gomeshproto"; */ message Telemetry { - /* + /* * This is usually not sent over the mesh (to save space), but it is sent * from the phone so that the local device can set its RTC If it is sent over * the mesh (because there are devices on the mesh without GPS), it will only * be sent by devices which has a hardware GPS clock (IE Mobile Phone). * seconds since 1970 */ - fixed32 time = 1; + fixed32 time = 1; - /* + /* * 1-100 (0 means powered) */ - int32 battery_level = 2; + int32 battery_level = 2; - /* + /* * Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). */ float channel_utilization = 3; @@ -30,7 +30,7 @@ message Telemetry { */ float air_util_tx = 4; - /* + /* * This is sent by node only if it a router and if hop_limit is set to 0 * and is not being sent as a reliable message. */ From 5bccf5106e5a6fa02216e702d4691cb42fa1361f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 19 Mar 2022 08:46:40 -0500 Subject: [PATCH 06/11] Add telemetry to node info --- mesh.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mesh.proto b/mesh.proto index 7545bc2..551fb37 100644 --- a/mesh.proto +++ b/mesh.proto @@ -1013,6 +1013,10 @@ message NodeInfo { * Set to indicate the last time we received a packet from this node */ fixed32 last_heard = 5; + /* + * The latest telemetry data for the node. + */ + Telemetry telemetry = 6; } /* From f8f633b1d122eb0715cf9f03951bb36f0dbce788 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 19 Mar 2022 08:50:56 -0500 Subject: [PATCH 07/11] Added descriptions --- telemetry.proto | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/telemetry.proto b/telemetry.proto index c806c38..56e83c7 100644 --- a/telemetry.proto +++ b/telemetry.proto @@ -37,32 +37,32 @@ message Telemetry { bool router_heartbeat = 5; /* - * TODO: REPLACE + * Temperature measured */ float temperature = 6; /* - * TODO: REPLACE + * Relative humidity percent measured */ float relative_humidity = 7; /* - * TODO: REPLACE + * Barometric pressure in hPA measured */ float barometric_pressure = 8; /* - * TODO: REPLACE + * Gas resistance in mOhm measured */ float gas_resistance = 9; /* - * TODO: REPLACE + * Voltage measured */ float voltage = 10; /* - * TODO: REPLACE + * Current measured */ float current = 11; } From 6a753e1184b5c86f16308387b8aa8ad740964ca6 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 19 Mar 2022 08:54:05 -0500 Subject: [PATCH 08/11] Import telemetry --- mesh.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/mesh.proto b/mesh.proto index 551fb37..52f96ec 100644 --- a/mesh.proto +++ b/mesh.proto @@ -24,6 +24,7 @@ option optimize_for = LITE_RUNTIME; option go_package = "github.com/meshtastic/gomeshproto"; import "portnums.proto"; +import "telemetry.proto"; option java_outer_classname = "MeshProtos"; From 9bc1a9a49674bb2f4ed5a13b7f174d66bf5a39e3 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 19 Mar 2022 14:09:43 -0500 Subject: [PATCH 09/11] Not sure what these area but I'm removing for now --- mesh.proto | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/mesh.proto b/mesh.proto index 52f96ec..7c10199 100644 --- a/mesh.proto +++ b/mesh.proto @@ -1201,21 +1201,6 @@ message MyNodeInfo { * Percent of airtime for transmission used within the last hour. */ float air_util_tx = 20; - /* - * How many routers are we in range of? - */ - repeated uint32 router = 21; - - /* - * What is the snr of the last router message? - */ - repeated float router_snr = 22; - - /* - * How long has it been since we last heard from the router? - */ - repeated uint32 router_sec = 23; - } /* From 85c19729602445b9f0974553f2583f12bf24c13a Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 19 Mar 2022 18:53:31 -0500 Subject: [PATCH 10/11] DHT11 defaulting to zero is bad --- radioconfig.proto | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/radioconfig.proto b/radioconfig.proto index dd4020d..ee1d1f9 100644 --- a/radioconfig.proto +++ b/radioconfig.proto @@ -759,47 +759,47 @@ message RadioConfig { /* * TODO: REPLACE */ - DHT11 = 0; + DHT11 = 1; /* * TODO: REPLACE */ - DS18B20 = 1; + DS18B20 = 2; /* * TODO: REPLACE */ - DHT12 = 2; + DHT12 = 3; /* * TODO: REPLACE */ - DHT21 = 3; + DHT21 = 4; /* * TODO: REPLACE */ - DHT22 = 4; + DHT22 = 5; /* * TODO: REPLACE */ - BME280 = 5; + BME280 = 6; /* * TODO: REPLACE */ - BME680 = 6; + BME680 = 7; /* * TODO: REPLACE */ - MCP9808 = 7; + MCP9808 = 8; /* * TODO: REPLACE */ - SHTC3 = 8; + SHTC3 = 9; }; /* From 05c060cbca0714ec1b10181e7b04f2d6527399fe Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 19 Mar 2022 19:08:10 -0500 Subject: [PATCH 11/11] DHT11 defaulting to zero is bad --- radioconfig.proto | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radioconfig.proto b/radioconfig.proto index ee1d1f9..37a36b2 100644 --- a/radioconfig.proto +++ b/radioconfig.proto @@ -755,7 +755,10 @@ message RadioConfig { * TODO: REPLACE */ enum TelemetrySensorType { - + /* + * No external telemetry sensor + */ + None = 0; /* * TODO: REPLACE */