From e0f912ab2a9bf165061f5d1c5807735a93f6b7c1 Mon Sep 17 00:00:00 2001 From: mc-hamster Date: Wed, 22 Jun 2022 02:06:51 +0000 Subject: [PATCH 1/3] [create-pull-request] automated change --- protobufs | 2 +- src/mesh/generated/config.pb.h | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/protobufs b/protobufs index 274aa01a..3df257bb 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 274aa01a3862ee83b1ae791c36205e661c4af7ca +Subproject commit 3df257bb880b0e8aff15b8022afa0848dcb85c69 diff --git a/src/mesh/generated/config.pb.h b/src/mesh/generated/config.pb.h index 13c89544..32eecbbe 100644 --- a/src/mesh/generated/config.pb.h +++ b/src/mesh/generated/config.pb.h @@ -26,7 +26,9 @@ typedef enum _Config_PositionConfig_PositionFlags { Config_PositionConfig_PositionFlags_POS_HVDOP = 16, Config_PositionConfig_PositionFlags_POS_SATINVIEW = 32, Config_PositionConfig_PositionFlags_POS_SEQ_NOS = 64, - Config_PositionConfig_PositionFlags_POS_TIMESTAMP = 128 + Config_PositionConfig_PositionFlags_POS_TIMESTAMP = 128, + Config_PositionConfig_PositionFlags_POS_HEADING = 256, + Config_PositionConfig_PositionFlags_POS_SPEED = 512 } Config_PositionConfig_PositionFlags; typedef enum _Config_PowerConfig_ChargeCurrent { @@ -78,8 +80,8 @@ typedef enum _Config_LoRaConfig_ModemPreset { Config_LoRaConfig_ModemPreset_LongFast = 0, Config_LoRaConfig_ModemPreset_LongSlow = 1, Config_LoRaConfig_ModemPreset_VLongSlow = 2, - Config_LoRaConfig_ModemPreset_MidSlow = 3, - Config_LoRaConfig_ModemPreset_MidFast = 4, + Config_LoRaConfig_ModemPreset_MedSlow = 3, + Config_LoRaConfig_ModemPreset_MedFast = 4, Config_LoRaConfig_ModemPreset_ShortSlow = 5, Config_LoRaConfig_ModemPreset_ShortFast = 6 } Config_LoRaConfig_ModemPreset; @@ -145,17 +147,11 @@ typedef struct _Config_WiFiConfig { typedef struct _Config { pb_size_t which_payloadVariant; union { - /* TODO: REPLACE */ Config_DeviceConfig device; - /* TODO: REPLACE */ Config_PositionConfig position; - /* TODO: REPLACE */ Config_PowerConfig power; - /* TODO: REPLACE */ Config_WiFiConfig wifi; - /* TODO: REPLACE */ Config_DisplayConfig display; - /* TODO: REPLACE */ Config_LoRaConfig lora; } payloadVariant; } Config; @@ -167,8 +163,8 @@ typedef struct _Config { #define _Config_DeviceConfig_Role_ARRAYSIZE ((Config_DeviceConfig_Role)(Config_DeviceConfig_Role_RouterClient+1)) #define _Config_PositionConfig_PositionFlags_MIN Config_PositionConfig_PositionFlags_POS_UNDEFINED -#define _Config_PositionConfig_PositionFlags_MAX Config_PositionConfig_PositionFlags_POS_TIMESTAMP -#define _Config_PositionConfig_PositionFlags_ARRAYSIZE ((Config_PositionConfig_PositionFlags)(Config_PositionConfig_PositionFlags_POS_TIMESTAMP+1)) +#define _Config_PositionConfig_PositionFlags_MAX Config_PositionConfig_PositionFlags_POS_SPEED +#define _Config_PositionConfig_PositionFlags_ARRAYSIZE ((Config_PositionConfig_PositionFlags)(Config_PositionConfig_PositionFlags_POS_SPEED+1)) #define _Config_PowerConfig_ChargeCurrent_MIN Config_PowerConfig_ChargeCurrent_MAUnset #define _Config_PowerConfig_ChargeCurrent_MAX Config_PowerConfig_ChargeCurrent_MA1320 From 90baf9d8a025f18869acdbbf4e1f091a1998628e Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 21 Jun 2022 19:23:07 -0700 Subject: [PATCH 2/3] Fix typo in the modem presets --- src/graphics/Screen.cpp | 18 +++++++++--------- src/mesh/Channels.cpp | 18 +++++++++--------- src/mesh/RadioInterface.cpp | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index dc1b0108..c5e06c85 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1520,25 +1520,25 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat switch (config.lora.modem_preset) { case Config_LoRaConfig_ModemPreset_ShortSlow: - mode = "ShortSlow"; + mode = "ShortS"; break; case Config_LoRaConfig_ModemPreset_ShortFast: - mode = "ShortFast"; + mode = "ShortF"; break; - case Config_LoRaConfig_ModemPreset_MidSlow: - mode = "MediumSlow"; + case Config_LoRaConfig_ModemPreset_MedSlow: + mode = "MedS"; break; - case Config_LoRaConfig_ModemPreset_MidFast: - mode = "MediumFast"; + case Config_LoRaConfig_ModemPreset_MedFast: + mode = "MedF"; break; case Config_LoRaConfig_ModemPreset_LongFast: - mode = "LongFast"; + mode = "LongS"; break; case Config_LoRaConfig_ModemPreset_LongSlow: - mode = "LongSlow"; + mode = "LongF"; break; case Config_LoRaConfig_ModemPreset_VLongSlow: - mode = "VLongSlow"; + mode = "VeryL"; break; default: mode = "Custom"; diff --git a/src/mesh/Channels.cpp b/src/mesh/Channels.cpp index c48dbd07..01e7e0f4 100644 --- a/src/mesh/Channels.cpp +++ b/src/mesh/Channels.cpp @@ -215,25 +215,25 @@ const char *Channels::getName(size_t chIndex) else switch (config.lora.modem_preset) { case Config_LoRaConfig_ModemPreset_ShortSlow: - channelName = "ShortSlow"; + channelName = "ShortS"; break; case Config_LoRaConfig_ModemPreset_ShortFast: - channelName = "ShortFast"; + channelName = "ShortF"; break; - case Config_LoRaConfig_ModemPreset_MidSlow: - channelName = "MediumSlow"; + case Config_LoRaConfig_ModemPreset_MedSlow: + channelName = "MedS"; break; - case Config_LoRaConfig_ModemPreset_MidFast: - channelName = "MediumFast"; + case Config_LoRaConfig_ModemPreset_MedFast: + channelName = "MedF"; break; case Config_LoRaConfig_ModemPreset_LongFast: - channelName = "LongFast"; + channelName = "LongS"; break; case Config_LoRaConfig_ModemPreset_LongSlow: - channelName = "LongSlow"; + channelName = "LongF"; break; case Config_LoRaConfig_ModemPreset_VLongSlow: - channelName = "VLongSlow"; + channelName = "VeryL"; break; default: channelName = "Invalid"; diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 12de7508..09a0e3a9 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -360,12 +360,12 @@ void RadioInterface::applyModemConfig() cr = 8; sf = 8; break; - case Config_LoRaConfig_ModemPreset_MidFast: + case Config_LoRaConfig_ModemPreset_MedFast: bw = 250; cr = 8; sf = 9; break; - case Config_LoRaConfig_ModemPreset_MidSlow: + case Config_LoRaConfig_ModemPreset_MedSlow: bw = 250; cr = 8; sf = 10; From 46e13d23d96576e8ea7f9a15c7fa791bddbbdbc6 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 21 Jun 2022 21:51:45 -0700 Subject: [PATCH 3/3] Add debug to monitor radio reconfiguration for #1014 - --- src/mesh/RF95Interface.cpp | 4 ++++ src/mesh/SX126xInterface.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/mesh/RF95Interface.cpp b/src/mesh/RF95Interface.cpp index 2a0789df..bab24b73 100644 --- a/src/mesh/RF95Interface.cpp +++ b/src/mesh/RF95Interface.cpp @@ -70,6 +70,10 @@ bool RF95Interface::init() int res = lora->begin(getFreq(), bw, sf, cr, syncWord, power, currentLimit, preambleLength); DEBUG_MSG("RF95 init result %d\n", res); + DEBUG_MSG("Frequency set to %f\n", getFreq()); + DEBUG_MSG("Bandwidth set to %f\n", bw); + DEBUG_MSG("Power output set to %d\n", power); + // current limit was removed from module' ctor // override default value (60 mA) res = lora->setCurrentLimit(currentLimit); diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index 61f93931..df00ba51 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -56,6 +56,10 @@ bool SX126xInterface::init() // \todo Display actual typename of the adapter, not just `SX126x` DEBUG_MSG("SX126x init result %d\n", res); + DEBUG_MSG("Frequency set to %f\n", getFreq()); + DEBUG_MSG("Bandwidth set to %f\n", bw); + DEBUG_MSG("Power output set to %d\n", power); + // current limit was removed from module' ctor // override default value (60 mA) res = lora.setCurrentLimit(currentLimit);