From c81d090464ca9d69bda47f4ad4835650082bd93f Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 29 Jan 2021 10:14:36 +0800 Subject: [PATCH 1/4] someone added storerequest app? --- proto | 2 +- src/mesh/generated/deviceonly.pb.h | 2 +- src/mesh/generated/mesh.pb.h | 40 +++++++++++++++++++++++------- src/mesh/generated/portnums.pb.h | 1 + 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/proto b/proto index 855da870..c9ad10d7 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 855da8701edbb19818069ad8545d5b9f030bb33f +Subproject commit c9ad10d7e2f7f465dc477e98d6ec9d3b7059336c diff --git a/src/mesh/generated/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h index c3e55666..a6388af9 100644 --- a/src/mesh/generated/deviceonly.pb.h +++ b/src/mesh/generated/deviceonly.pb.h @@ -80,7 +80,7 @@ extern const pb_msgdesc_t DeviceState_msg; #define DeviceState_fields &DeviceState_msg /* Maximum encoded size of messages (where known) */ -#define DeviceState_size 6206 +#define DeviceState_size 6239 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 50ae14a6..a13d7de5 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -57,6 +57,7 @@ typedef enum _ChargeCurrent { typedef enum _GpsOperation { GpsOperation_GpsOpUnset = 0, + GpsOperation_GpsOpStationary = 1, GpsOperation_GpsOpMobile = 2, GpsOperation_GpsOpTimeOnly = 3, GpsOperation_GpsOpDisabled = 4 @@ -183,6 +184,13 @@ typedef struct _RadioConfig_UserPreferences { uint32_t serialplugin_rxd; uint32_t serialplugin_txd; uint32_t serialplugin_timeout; + uint32_t serialplugin_mode; + bool ext_notification_plugin_enabled; + uint32_t ext_notification_plugin_output_ms; + uint32_t ext_notification_plugin_output; + bool ext_notification_plugin_active; + bool ext_notification_plugin_alert_message; + bool ext_notification_plugin_alert_bell; } RadioConfig_UserPreferences; typedef struct _RouteDiscovery { @@ -305,8 +313,8 @@ typedef struct _ToRadio { #define _LocationSharing_ARRAYSIZE ((LocationSharing)(LocationSharing_LocDisabled+1)) #define _CriticalErrorCode_MIN CriticalErrorCode_None -#define _CriticalErrorCode_MAX CriticalErrorCode_InvalidRadioSetting -#define _CriticalErrorCode_ARRAYSIZE ((CriticalErrorCode)(CriticalErrorCode_InvalidRadioSetting+1)) +#define _CriticalErrorCode_MAX CriticalErrorCode_TransmitFailed +#define _CriticalErrorCode_ARRAYSIZE ((CriticalErrorCode)(CriticalErrorCode_TransmitFailed+1)) #define _ChannelSettings_ModemConfig_MIN ChannelSettings_ModemConfig_Bw125Cr45Sf128 #define _ChannelSettings_ModemConfig_MAX ChannelSettings_ModemConfig_Bw125Cr48Sf4096 @@ -330,7 +338,7 @@ extern "C" { #define MeshPacket_init_default {0, 0, 0, {SubPacket_init_default}, 0, 0, 0, 0, 0, 0} #define ChannelSettings_init_default {0, _ChannelSettings_ModemConfig_MIN, {0, {0}}, "", 0, 0, 0, 0, 0, 0, 0} #define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default, false, ChannelSettings_init_default} -#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0} +#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0} #define MyNodeInfo_init_default {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0} #define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} @@ -344,7 +352,7 @@ extern "C" { #define MeshPacket_init_zero {0, 0, 0, {SubPacket_init_zero}, 0, 0, 0, 0, 0, 0} #define ChannelSettings_init_zero {0, _ChannelSettings_ModemConfig_MIN, {0, {0}}, "", 0, 0, 0, 0, 0, 0, 0} #define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero, false, ChannelSettings_init_zero} -#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0} +#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0} #define MyNodeInfo_init_zero {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0} #define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} @@ -418,6 +426,13 @@ extern "C" { #define RadioConfig_UserPreferences_serialplugin_rxd_tag 122 #define RadioConfig_UserPreferences_serialplugin_txd_tag 123 #define RadioConfig_UserPreferences_serialplugin_timeout_tag 124 +#define RadioConfig_UserPreferences_serialplugin_mode_tag 125 +#define RadioConfig_UserPreferences_ext_notification_plugin_enabled_tag 126 +#define RadioConfig_UserPreferences_ext_notification_plugin_output_ms_tag 127 +#define RadioConfig_UserPreferences_ext_notification_plugin_output_tag 128 +#define RadioConfig_UserPreferences_ext_notification_plugin_active_tag 129 +#define RadioConfig_UserPreferences_ext_notification_plugin_alert_message_tag 130 +#define RadioConfig_UserPreferences_ext_notification_plugin_alert_bell_tag 131 #define RouteDiscovery_route_tag 2 #define User_id_tag 1 #define User_long_name_tag 2 @@ -585,7 +600,14 @@ X(a, STATIC, SINGULAR, BOOL, serialplugin_enabled, 120) \ X(a, STATIC, SINGULAR, BOOL, serialplugin_echo, 121) \ X(a, STATIC, SINGULAR, UINT32, serialplugin_rxd, 122) \ X(a, STATIC, SINGULAR, UINT32, serialplugin_txd, 123) \ -X(a, STATIC, SINGULAR, UINT32, serialplugin_timeout, 124) +X(a, STATIC, SINGULAR, UINT32, serialplugin_timeout, 124) \ +X(a, STATIC, SINGULAR, UINT32, serialplugin_mode, 125) \ +X(a, STATIC, SINGULAR, BOOL, ext_notification_plugin_enabled, 126) \ +X(a, STATIC, SINGULAR, UINT32, ext_notification_plugin_output_ms, 127) \ +X(a, STATIC, SINGULAR, UINT32, ext_notification_plugin_output, 128) \ +X(a, STATIC, SINGULAR, BOOL, ext_notification_plugin_active, 129) \ +X(a, STATIC, SINGULAR, BOOL, ext_notification_plugin_alert_message, 130) \ +X(a, STATIC, SINGULAR, BOOL, ext_notification_plugin_alert_bell, 131) #define RadioConfig_UserPreferences_CALLBACK NULL #define RadioConfig_UserPreferences_DEFAULT NULL @@ -697,13 +719,13 @@ extern const pb_msgdesc_t ToRadio_msg; #define SubPacket_size 275 #define MeshPacket_size 320 #define ChannelSettings_size 95 -#define RadioConfig_size 349 -#define RadioConfig_UserPreferences_size 249 +#define RadioConfig_size 382 +#define RadioConfig_UserPreferences_size 282 #define NodeInfo_size 132 #define MyNodeInfo_size 106 #define LogRecord_size 81 -#define FromRadio_size 358 -#define ToRadio_size 353 +#define FromRadio_size 391 +#define ToRadio_size 386 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/portnums.pb.h b/src/mesh/generated/portnums.pb.h index 91c988fd..99df1222 100644 --- a/src/mesh/generated/portnums.pb.h +++ b/src/mesh/generated/portnums.pb.h @@ -19,6 +19,7 @@ typedef enum _PortNum { PortNum_REPLY_APP = 32, PortNum_IP_TUNNEL_APP = 33, PortNum_SERIAL_APP = 64, + PortNum_STORE_REQUEST_APP = 65, PortNum_PRIVATE_APP = 256, PortNum_ATAK_FORWARDER = 257 } PortNum; From 7f077258400ce081c6eff6dd99c78e64ffee3927 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 29 Jan 2021 10:15:48 +0800 Subject: [PATCH 2/4] make improperly sized AES128/256 keys non fatal, instead pad with zeros Fixes rebooting the board if someone specifies an invalid key --- src/mesh/NodeDB.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 42ce71ea..ea79e6cc 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -180,10 +180,14 @@ bool NodeDB::resetRadioConfig() channelSettings.psk.size = 1; } - // Convert the short single byte variants of psk into variant that can be used more generally + memset(activePSK, 0, sizeof(activePSK)); // In case the user provided a short key, we want to pad the rest with zeros memcpy(activePSK, channelSettings.psk.bytes, channelSettings.psk.size); activePSKSize = channelSettings.psk.size; - if (activePSKSize == 1) { + if(activePSKSize == 0) + DEBUG_MSG("Warning: User disabled encryption\n"); + else if (activePSKSize == 1) { + // Convert the short single byte variants of psk into variant that can be used more generally + uint8_t pskIndex = activePSK[0]; DEBUG_MSG("Expanding short PSK #%d\n", pskIndex); if (pskIndex == 0) @@ -195,6 +199,16 @@ bool NodeDB::resetRadioConfig() uint8_t *last = activePSK + sizeof(defaultpsk) - 1; *last = *last + pskIndex - 1; // index of 1 means no change vs defaultPSK } + } else if(activePSKSize < 16) { + // Error! The user specified only the first few bits of an AES128 key. So by convention we just pad the rest of the key + // with zeros + DEBUG_MSG("Warning: User provided a too short AES128 key - padding\n"); + activePSKSize = 16; + } else if(activePSKSize < 32 && activePSKSize != 16) { + // Error! The user specified only the first few bits of an AES256 key. So by convention we just pad the rest of the key + // with zeros + DEBUG_MSG("Warning: User provided a too short AES256 key - padding\n"); + activePSKSize = 32; } // Tell our crypto engine about the psk From c6f34c59b4c91247a869d1c6a394218000fb5e86 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 29 Jan 2021 13:26:08 +0800 Subject: [PATCH 3/4] Update to logo by @thepoweroftwo --- .gitmodules | 3 ++ bin/gen-images.sh | 19 +++++++++++ {images => deprecated}/icon-18dp.png | Bin {images => deprecated}/icon-24px.svg | 0 {images => deprecated}/icon.png | Bin design | 1 + images/genfiles.sh | 11 ------ src/graphics/img/icon.xbm | 49 ++++++++++----------------- 8 files changed, 41 insertions(+), 42 deletions(-) create mode 100755 bin/gen-images.sh rename {images => deprecated}/icon-18dp.png (100%) rename {images => deprecated}/icon-24px.svg (100%) rename {images => deprecated}/icon.png (100%) create mode 160000 design delete mode 100755 images/genfiles.sh diff --git a/.gitmodules b/.gitmodules index 785c573a..4f9bb6b7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "sdk-nrfxlib"] path = sdk-nrfxlib url = https://github.com/nrfconnect/sdk-nrfxlib.git +[submodule "design"] + path = design + url = https://github.com/meshtastic/meshtastic-design.git diff --git a/bin/gen-images.sh b/bin/gen-images.sh new file mode 100755 index 00000000..c4335718 --- /dev/null +++ b/bin/gen-images.sh @@ -0,0 +1,19 @@ + + +set -e + +# regen the design bins first +cd design +bin/generate-pngs.sh +cd .. + +# assumes 50 wide, 28 high +convert design/logo/png/Mesh_Logo_Black_Small.png -background white -alpha Background src/graphics/img/icon.xbm + +inkscape --batch-process -o images/compass.png -w 48 -h 48 images/location_searching-24px.svg +convert compass.png -background white -alpha Background src/graphics/img/compass.xbm + +inkscape --batch-process -o images/face.png -w 13 -h 13 images/face-24px.svg + +inkscape --batch-process -o images/pin.png -w 13 -h 13 images/room-24px.svg +convert pin.png -background white -alpha Background src/graphics/img/pin.xbm diff --git a/images/icon-18dp.png b/deprecated/icon-18dp.png similarity index 100% rename from images/icon-18dp.png rename to deprecated/icon-18dp.png diff --git a/images/icon-24px.svg b/deprecated/icon-24px.svg similarity index 100% rename from images/icon-24px.svg rename to deprecated/icon-24px.svg diff --git a/images/icon.png b/deprecated/icon.png similarity index 100% rename from images/icon.png rename to deprecated/icon.png diff --git a/design b/design new file mode 160000 index 00000000..73ba05ce --- /dev/null +++ b/design @@ -0,0 +1 @@ +Subproject commit 73ba05ceef8beff81eb546a0b9e8ecad03a1216d diff --git a/images/genfiles.sh b/images/genfiles.sh deleted file mode 100755 index bc14f6e8..00000000 --- a/images/genfiles.sh +++ /dev/null @@ -1,11 +0,0 @@ -# using height of 50 to have 14 pixels beneath icon for text -inkscape -z -e icon.png -w 50 -h 50 icon-24px.svg -convert icon.png -background white -alpha Background ../src/icon.xbm - -inkscape -z -e compass.png -w 48 -h 48 location_searching-24px.svg -convert compass.png -background white -alpha Background ../src/compass.xbm - -inkscape -z -e face.png -w 13 -h 13 face-24px.svg - -inkscape -z -e pin.png -w 13 -h 13 room-24px.svg -convert pin.png -background white -alpha Background ../src/pin.xbm diff --git a/src/graphics/img/icon.xbm b/src/graphics/img/icon.xbm index d7394c8e..2b698e4c 100644 --- a/src/graphics/img/icon.xbm +++ b/src/graphics/img/icon.xbm @@ -1,33 +1,20 @@ #define icon_width 50 -#define icon_height 50 +#define icon_height 28 static char icon_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, - 0xFF, 0x07, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, - 0xF0, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0x00, - 0x00, 0x00, 0xFE, 0x0F, 0xC0, 0xFF, 0x01, 0x00, 0x00, 0xFF, 0x03,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 0xC0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x1F, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, - 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xFE, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFC, 0x03, 0x00, - 0x00, 0x00, 0x80, 0x7F, 0xF8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xF0, - 0x03, 0x00, 0x00, 0x00, 0x00, 0x1E, 0xE0, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x0C, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, }; + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x80, 0x07, 0xC0, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x1F, + 0xC0, 0x0F, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0xE0, 0x0F, 0x00, 0x00, 0x00, + 0xE0, 0x0F, 0xF0, 0x1F, 0x00, 0x00, 0x00, 0xF0, 0x07, 0xF0, 0x3F, 0x00, + 0x00, 0x00, 0xF8, 0x03, 0xF8, 0x7F, 0x00, 0x00, 0x00, 0xF8, 0x03, 0xFC, + 0x7F, 0x00, 0x00, 0x00, 0xFC, 0x01, 0xFC, 0xFE, 0x00, 0x00, 0x00, 0xFE, + 0x00, 0xFE, 0xFC, 0x01, 0x00, 0x00, 0xFE, 0x00, 0x7F, 0xFC, 0x01, 0x00, + 0x00, 0x7F, 0x00, 0x3F, 0xF8, 0x03, 0x00, 0x80, 0x3F, 0x80, 0x3F, 0xF0, + 0x07, 0x00, 0x80, 0x3F, 0xC0, 0x1F, 0xF0, 0x07, 0x00, 0xC0, 0x1F, 0xC0, + 0x0F, 0xE0, 0x0F, 0x00, 0xE0, 0x0F, 0xE0, 0x0F, 0xC0, 0x1F, 0x00, 0xE0, + 0x0F, 0xF0, 0x07, 0x80, 0x1F, 0x00, 0xF0, 0x07, 0xF8, 0x03, 0x80, 0x3F, + 0x00, 0xF8, 0x03, 0xF8, 0x03, 0x00, 0x7F, 0x00, 0xFC, 0x03, 0xFC, 0x01, + 0x00, 0x7E, 0x00, 0xFC, 0x01, 0xFE, 0x00, 0x00, 0xFE, 0x00, 0xFE, 0x00, + 0xFE, 0x00, 0x00, 0xFC, 0x01, 0x7E, 0x00, 0x7F, 0x00, 0x00, 0xF8, 0x01, + 0x7E, 0x00, 0x3E, 0x00, 0x00, 0xF8, 0x01, 0x38, 0x00, 0x3C, 0x00, 0x00, + 0x70, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, }; From c0e2ec8decf4df3d5d01d5a2b5e14cf293ff9442 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sat, 30 Jan 2021 21:23:03 +0800 Subject: [PATCH 4/4] 1.1.34 --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 556f3f84..dd592ccf 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 1 minor = 1 -build = 33 +build = 34