From c25e0c4e0ba99a5e2e94a1ca7313f999bf794fbd Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 27 Jun 2024 09:35:11 -0700 Subject: [PATCH 1/5] Add PowerStress agent support to PowerMon --- meshtastic/portnums.proto | 5 ++++ meshtastic/powermon.proto | 52 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/meshtastic/portnums.proto b/meshtastic/portnums.proto index 5808eb7..a8517c7 100644 --- a/meshtastic/portnums.proto +++ b/meshtastic/portnums.proto @@ -196,6 +196,11 @@ enum PortNum { */ MAP_REPORT_APP = 73; + /* + * PowerStress based monitoring support (for automated power consumption testing) + */ + POWERSTRESS_APP = 74; + /* * Private applications should use portnums >= 256. * To simplify initial development and testing you can use "PRIVATE_APP" diff --git a/meshtastic/powermon.proto b/meshtastic/powermon.proto index 7e23bc4..5f65b51 100644 --- a/meshtastic/powermon.proto +++ b/meshtastic/powermon.proto @@ -49,4 +49,56 @@ message PowerMon { */ GPS_Active = 0x800; } +} + + +/* + * PowerStress testing support via the C++ PowerStress module + */ +message PowerStressMessage { + /* + * What operation would we like the UUT to perform. + note: senders should probably set want_response in their request packets, so that they can know when the state + machine has started processing their request + */ + enum Opcode { + /* + * Unset/unused + */ + UNSET = 0; + + PRINT_INFO = 1; // Print board version slog and send an ack that we are alive and ready to process commands + FORCE_QUIET = 2; // Try to turn off all automatic processing of packets, screen, sleeping, etc (to make it easier to measure in isolation) + END_QUIET = 3; // Stop powerstress processing - probably by just rebooting the board + + SCREEN_ON = 16; // Turn the screen on + SCREEN_OFF = 17; // Turn the screen off + + CPU_IDLE = 32; // Let the CPU run but we assume mostly idling for num_seconds + CPU_DEEPSLEEP = 33; // Force deep sleep for FIXME seconds + CPU_FULLON = 34; // Spin the CPU as fast as possible for num_seconds + + LED_ON = 48; // Turn the LED on for num_seconds (and leave it on - for baseline power measurement purposes) + LED_OFF = 49; // Force the LED off for num_seconds + + LORA_OFF = 64; // Completely turn off the LORA radio for num_seconds + LORA_TX = 65; // Send Lora packets for num_seconds + LORA_RX = 66; // Receive Lora packets for num_seconds (node will be mostly just listening, unless an external agent is helping stress this by sending packets on the current channel) + + BT_OFF = 80; // Turn off the BT radio for num_seconds + BT_ON = 81; // Turn on the BT radio for num_seconds + + WIFI_OFF = 96; // Turn off the WIFI radio for num_seconds + WIFI_ON = 97; // Turn on the WIFI radio for num_seconds + + GPS_OFF = 112; // Turn off the GPS radio for num_seconds + GPS_ON = 113; // Turn on the GPS radio for num_seconds + } + + /* + * What type of HardwareMessage is this? + */ + Opcode cmd = 1; + + float num_seconds = 2; } \ No newline at end of file From 9d747b6cf08e2762fdf9530173a7ff825b9daa90 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 27 Jun 2024 19:50:59 -0700 Subject: [PATCH 2/5] Now that we use LogRecord, increase the field sizes to reasonable values Note: this change is 'free' because LogRecord is only used in a union inside of FromRadio and FromRadio is already larger than this. --- meshtastic/mesh.options | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index 1ae14d6..7075e2d 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -40,8 +40,8 @@ *Routing.variant anonymous_oneof:true -*LogRecord.message max_size:64 -*LogRecord.source max_size:8 +*LogRecord.message max_size:384 +*LogRecord.source max_size:32 *FileInfo.file_name max_size:228 From 17a96375307c1d200c1b69f5a1a2fc731db03e75 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 28 Jun 2024 10:06:50 -0500 Subject: [PATCH 3/5] Deprecate router client --- meshtastic/config.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 391cb7d..7f4a5dc 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -37,7 +37,9 @@ message Config { /* * Description: Combination of both ROUTER and CLIENT. Not for mobile devices. + * Deprecated in v2.3.15 because improper usage is impacting public meshes: Use ROUTER or CLIENT instead. */ + [deprecated = true] ROUTER_CLIENT = 3; /* From fcf0fddab860a00d2ccb97323963e49fbf545af5 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 28 Jun 2024 10:24:51 -0500 Subject: [PATCH 4/5] Same line --- meshtastic/config.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 7f4a5dc..50c7539 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -39,8 +39,8 @@ message Config { * Description: Combination of both ROUTER and CLIENT. Not for mobile devices. * Deprecated in v2.3.15 because improper usage is impacting public meshes: Use ROUTER or CLIENT instead. */ - [deprecated = true] - ROUTER_CLIENT = 3; + + ROUTER_CLIENT = 3 [deprecated = true]; /* * Description: Infrastructure node for extending network coverage by relaying messages with minimal overhead. Not visible in Nodes list. From 827ed60577e0c33f53dd4ce1dacd7bb77dc53209 Mon Sep 17 00:00:00 2001 From: Blake McAnally Date: Fri, 28 Jun 2024 21:37:08 -0500 Subject: [PATCH 5/5] remove unnecessary import --- meshtastic/deviceonly.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index eef59a7..9c700db 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -5,7 +5,6 @@ package meshtastic; import "meshtastic/channel.proto"; import "meshtastic/localonly.proto"; import "meshtastic/mesh.proto"; -import "meshtastic/module_config.proto"; import "meshtastic/telemetry.proto"; import "nanopb.proto";