From 4f10ab8d040f48bd602c2b799274e75d4fbc75f6 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Wed, 1 Dec 2021 17:24:01 -0800 Subject: [PATCH 1/3] Little update to #934 updated lastGpsSend --- src/plugins/PositionPlugin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/PositionPlugin.cpp b/src/plugins/PositionPlugin.cpp index 11d13aba..f0aabdf2 100644 --- a/src/plugins/PositionPlugin.cpp +++ b/src/plugins/PositionPlugin.cpp @@ -170,6 +170,11 @@ int32_t PositionPlugin::runOnce() DEBUG_MSG("Sending smart pos@%x:6 to mesh (wantReplies=%d)\n", node->position.pos_timestamp, requestReplies); sendOurPosition(NODENUM_BROADCAST, requestReplies); + + /* Update lastGpsSend to now. This means if the device is stationary, then + getPref_position_broadcast_secs will still apply. + */ + lastGpsSend = now; } } } From f4d348173c2fd83759d4dc9b4473944e4350d645 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Wed, 1 Dec 2021 17:56:47 -0800 Subject: [PATCH 2/3] Refresh node info to ensure our information is current for smart position. #934 --- src/plugins/PositionPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/PositionPlugin.cpp b/src/plugins/PositionPlugin.cpp index f0aabdf2..2a6ccbd9 100644 --- a/src/plugins/PositionPlugin.cpp +++ b/src/plugins/PositionPlugin.cpp @@ -145,7 +145,7 @@ int32_t PositionPlugin::runOnce() DEBUG_MSG("Sending pos@%x:6 to mesh (wantReplies=%d)\n", node->position.pos_timestamp, requestReplies); sendOurPosition(NODENUM_BROADCAST, requestReplies); } else if (radioConfig.preferences.position_broadcast_smart == true) { - // NodeInfo *node = service.refreshMyNodeInfo(); // should guarantee there is now a position + NodeInfo *node = service.refreshMyNodeInfo(); // should guarantee there is now a position if (node->has_position && (node->position.latitude_i != 0 || node->position.longitude_i != 0)) { float distance = GeoCoord::latLongToMeter(lastGpsLatitude * 1e-7, lastGpsLongitude * 1e-7, From 9d019c1a99bb539cef3db3774f2023fbc220daf3 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 2 Dec 2021 10:19:25 -0600 Subject: [PATCH 3/3] Adding batch script for generating uf2 files for NRF boards (#945) * Updated generated protos * Added uf2-converter batch for windows machines --- bin/uf2-convert.bat | 2 ++ src/mesh/generated/admin.pb.h | 2 +- src/mesh/generated/deviceonly.pb.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 bin/uf2-convert.bat diff --git a/bin/uf2-convert.bat b/bin/uf2-convert.bat new file mode 100644 index 00000000..242bec3a --- /dev/null +++ b/bin/uf2-convert.bat @@ -0,0 +1,2 @@ +@echo off +if [%1]==[] (echo "Please specify a platformio NRF target (i.e. rak4631) as the first argument.") else (python3 .\bin\uf2conv.py .\.pio\build\%1\firmware.hex -c -o .\.pio\build\%1\firmware.uf2 -f 0xADA52840) \ No newline at end of file diff --git a/src/mesh/generated/admin.pb.h b/src/mesh/generated/admin.pb.h index ab415243..e27ee193 100644 --- a/src/mesh/generated/admin.pb.h +++ b/src/mesh/generated/admin.pb.h @@ -4,9 +4,9 @@ #ifndef PB_ADMIN_PB_H_INCLUDED #define PB_ADMIN_PB_H_INCLUDED #include +#include "channel.pb.h" #include "mesh.pb.h" #include "radioconfig.pb.h" -#include "channel.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/src/mesh/generated/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h index 591c3cc2..129e0b81 100644 --- a/src/mesh/generated/deviceonly.pb.h +++ b/src/mesh/generated/deviceonly.pb.h @@ -4,8 +4,8 @@ #ifndef PB_DEVICEONLY_PB_H_INCLUDED #define PB_DEVICEONLY_PB_H_INCLUDED #include -#include "mesh.pb.h" #include "channel.pb.h" +#include "mesh.pb.h" #include "radioconfig.pb.h" #if PB_PROTO_HEADER_VERSION != 40