From f037ae2d99feb91128a1727c411befd23ceb42d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 3 Nov 2024 23:06:16 +0100 Subject: [PATCH 1/4] add hw_env to packet needs https://github.com/meshtastic/protobufs/pull/616 --- bin/platformio-custom.py | 3 ++- src/main.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/platformio-custom.py b/bin/platformio-custom.py index 0f099c09ad..701f6b5d80 100644 --- a/bin/platformio-custom.py +++ b/bin/platformio-custom.py @@ -88,12 +88,13 @@ def esp32_create_combined_bin(source, target, env): prefsLoc = projenv["PROJECT_DIR"] + "/version.properties" verObj = readProps(prefsLoc) -print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"]) +print("Using meshtastic platformio-custom.py, firmware version " + verObj["long"] + " on " + env.get("PIOENV")) # General options that are passed to the C and C++ compilers projenv.Append( CCFLAGS=[ "-DAPP_VERSION=" + verObj["long"], "-DAPP_VERSION_SHORT=" + verObj["short"], + "-DAPP_ENV=" + env.get("PIOENV"), ] ) diff --git a/src/main.cpp b/src/main.cpp index 0ce6b3bae6..590656c001 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1163,6 +1163,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() #if !(MESHTASTIC_EXCLUDE_PKI) deviceMetadata.hasPKC = true; #endif + strncpy(deviceMetadata.hw_env, optstr(APP_ENV), sizeof(deviceMetadata.hw_env)); return deviceMetadata; } #ifndef PIO_UNIT_TESTING From 03049f25f4111e8a89c6a6e1ef48352e7e5cf3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 3 Nov 2024 23:08:10 +0100 Subject: [PATCH 2/4] rename to pio_env --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 590656c001..92f006df68 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1163,7 +1163,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() #if !(MESHTASTIC_EXCLUDE_PKI) deviceMetadata.hasPKC = true; #endif - strncpy(deviceMetadata.hw_env, optstr(APP_ENV), sizeof(deviceMetadata.hw_env)); + strncpy(deviceMetadata.pio_env, optstr(APP_ENV), sizeof(deviceMetadata.pio_env)); return deviceMetadata; } #ifndef PIO_UNIT_TESTING From bf4540129ac7d8ba7dea815bbe60cdc23e91b611 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 3 Nov 2024 19:56:56 -0600 Subject: [PATCH 3/4] Move to mynodeinfo --- src/main.cpp | 1 - src/mesh/PhoneAPI.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 92f006df68..0ce6b3bae6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1163,7 +1163,6 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() #if !(MESHTASTIC_EXCLUDE_PKI) deviceMetadata.hasPKC = true; #endif - strncpy(deviceMetadata.pio_env, optstr(APP_ENV), sizeof(deviceMetadata.pio_env)); return deviceMetadata; } #ifndef PIO_UNIT_TESTING diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index c94899bb85..c3a669ce5d 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -196,6 +196,7 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) // If the user has specified they don't want our node to share its location, make sure to tell the phone // app not to send locations on our behalf. fromRadioScratch.which_payload_variant = meshtastic_FromRadio_my_info_tag; + strncpy(myNodeInfo.pio_env, optstr(APP_ENV), sizeof(myNodeInfo.pio_env)); fromRadioScratch.my_info = myNodeInfo; state = STATE_SEND_OWN_NODEINFO; From 38f4755812d69d0bebc69357c9d9c3d018975f24 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 3 Nov 2024 20:01:48 -0600 Subject: [PATCH 4/4] Includy doody --- src/mesh/MeshService.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index d224c05dca..dfa130d485 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -12,6 +12,7 @@ #include "RTC.h" #include "TypeConversions.h" #include "main.h" +#include "meshUtils.h" #include "mesh-pb-constants.h" #include "modules/NodeInfoModule.h" #include "modules/PositionModule.h"