From 7282b562fad0f7ca5e3bb8c04f07a3db4c9066ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 31 Mar 2022 14:59:42 +0200 Subject: [PATCH 1/9] Fix Crash if no texts defined but plugin enabled --- src/modules/CannedMessageModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 1db82e903..aa52cf6cd 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -307,6 +307,12 @@ void CannedMessageModule::drawFrame( display->setFont(FONT_MEDIUM); display->drawString(display->getWidth()/2 + x, 0 + y + 12, "Sending..."); } + else if (cannedMessageModule->runState == CANNED_MESSAGE_RUN_STATE_DISABLED) + { + display->setTextAlignment(TEXT_ALIGN_LEFT); + display->setFont(FONT_SMALL); + display->drawString(10 + x, 0 + y + 16, "Canned Message\nModule disabled."); + } else { display->setTextAlignment(TEXT_ALIGN_LEFT); From 57ba626e4ce55f26dfd0b83ff987eb73ef6a2000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 31 Mar 2022 18:52:13 +0200 Subject: [PATCH 2/9] Fixes #1294 Bluetooth-Wifi Deadlock --- src/esp32/main-esp32.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/esp32/main-esp32.cpp b/src/esp32/main-esp32.cpp index 2e012297b..07b0eb9ee 100644 --- a/src/esp32/main-esp32.cpp +++ b/src/esp32/main-esp32.cpp @@ -6,6 +6,7 @@ #ifdef USE_NEW_ESP32_BLUETOOTH #include "ESP32Bluetooth.h" +#include "mesh/http/WiFiAPClient.h" #else #include "nimble/BluetoothUtil.h" #endif @@ -41,13 +42,15 @@ static void printBLEinfo() { #ifdef USE_NEW_ESP32_BLUETOOTH void setBluetoothEnable(bool on) { - if (!esp32Bluetooth) { - esp32Bluetooth = new ESP32Bluetooth(); - } - if (on) { - esp32Bluetooth->setup(); - } else { - esp32Bluetooth->shutdown(); + if (!isWifiAvailable()) { + if (!esp32Bluetooth) { + esp32Bluetooth = new ESP32Bluetooth(); + } + if (on) { + esp32Bluetooth->setup(); + } else { + esp32Bluetooth->shutdown(); + } } } #endif From 4e29984549b1c314d13abb0c2534c7435b1d7507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 31 Mar 2022 18:52:40 +0200 Subject: [PATCH 3/9] Slightly more verbose GPS debug logging --- src/gps/GPS.cpp | 3 ++- src/gps/NMEAGPS.cpp | 6 +++--- src/mesh/MeshService.cpp | 4 ++-- src/mesh/NodeDB.cpp | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index 3f0c52242..8af6bd779 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -336,6 +336,7 @@ GPS *createGps() delete ublox; ublox = NULL; } else { + DEBUG_MSG("Using UBLOX Mode\n"); return ublox; } #endif @@ -343,7 +344,7 @@ GPS *createGps() if (GPS::_serial_gps) { // Some boards might have only the TX line from the GPS connected, in that case, we can't configure it at all. Just // assume NMEA at 9600 baud. - DEBUG_MSG("Hoping that NMEA might work\n"); + DEBUG_MSG("Using NMEA Mode\n"); GPS *new_gps = new NMEAGPS(); new_gps->setup(); return new_gps; diff --git a/src/gps/NMEAGPS.cpp b/src/gps/NMEAGPS.cpp index 359256a3d..5c1ebafa0 100644 --- a/src/gps/NMEAGPS.cpp +++ b/src/gps/NMEAGPS.cpp @@ -5,7 +5,7 @@ #include // GPS solutions older than this will be rejected - see TinyGPSDatum::age() -#define GPS_SOL_EXPIRY_MS 300 // in millis +#define GPS_SOL_EXPIRY_MS 5000 // in millis. give 1 second time to combine different sentences. NMEA Frequency isn't higher anyway #define NMEA_MSG_GXGSA "GNGSA" // GSA message (GPGSA, GNGSA etc) static int32_t toDegInt(RawDegrees d) @@ -64,7 +64,7 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s t.tm_mon = d.month() - 1; t.tm_year = d.year() - 1900; t.tm_isdst = false; - DEBUG_MSG("NMEA GPS time %d\n", t.tm_sec); + DEBUG_MSG("NMEA GPS time %d-%d-%d %d:%d:%d\n", d.year(), d.month(), t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec); perhapsSetRTC(RTCQualityGPS, t); @@ -116,7 +116,7 @@ bool NMEAGPS::lookForLocation() (reader.time.age() < GPS_SOL_EXPIRY_MS) && (reader.date.age() < GPS_SOL_EXPIRY_MS))) { - DEBUG_MSG("SOME data is TOO OLD\n"); + DEBUG_MSG("SOME data is TOO OLD: LOC %u, TIME %u, DATE %u\n", reader.location.age(), reader.time.age(), reader.date.age()); return false; } diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index c751a7c26..36d3b2251 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -239,8 +239,8 @@ int MeshService::onGPSChanged(const meshtastic::GPSStatus *newStatus) pos.time = getValidTime(RTCQualityGPS); // In debug logs, identify position by @timestamp:stage (stage 4 = nodeDB) - DEBUG_MSG("onGPSChanged() pos@%x:4, time=%u, lat=%d\n", - pos.pos_timestamp, pos.time, pos.latitude_i); + DEBUG_MSG("onGPSChanged() pos@%x, time=%u, lat=%d, lon=%d, alt=%d\n", + pos.pos_timestamp, pos.time, pos.latitude_i, pos.longitude_i, pos.altitude); // Update our current position in the local DB nodeDB.updatePosition(nodeDB.getNodeNum(), pos, RX_SRC_LOCAL); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 52e76a88e..64ac00673 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -453,8 +453,8 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p, RxSource src) if (src == RX_SRC_LOCAL) { // Local packet, fully authoritative - DEBUG_MSG("updatePosition LOCAL pos@%x:5, time=%u, latI=%d, lonI=%d\n", - p.pos_timestamp, p.time, p.latitude_i, p.longitude_i); + DEBUG_MSG("updatePosition LOCAL pos@%x, time=%u, latI=%d, lonI=%d, alt=%d\n", + p.pos_timestamp, p.time, p.latitude_i, p.longitude_i, p.altitude); info->position = p; } else if ((p.time > 0) && !p.latitude_i && !p.longitude_i && !p.pos_timestamp && From 286e64d5f67403765af3bea7659b8efdaf253f8e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 31 Mar 2022 16:27:55 -0500 Subject: [PATCH 4/9] Smoke test moving device telemetry into portduino --- src/modules/Modules.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index 7d65acc89..0221418e6 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -13,8 +13,8 @@ #include "modules/ReplyModule.h" #include "modules/RoutingModule.h" #include "modules/TextMessageModule.h" -#ifndef PORTDUINO #include "modules/Telemetry/DeviceTelemetry.h" +#ifndef PORTDUINO #include "modules/Telemetry/EnvironmentTelemetry.h" #endif #ifndef NO_ESP32 @@ -68,4 +68,4 @@ void setupModules() // NOTE! This module must be added LAST because it likes to check for replies from other modules and avoid sending extra acks routingModule = new RoutingModule(); -} \ No newline at end of file +} From d73ef3c2fe9e4c85abcec869683f4ad14790a59a Mon Sep 17 00:00:00 2001 From: ssysm Date: Thu, 31 Mar 2022 23:25:37 -0400 Subject: [PATCH 5/9] Change GPS Pin on Heltec v2.1 --- variants/heltec_v2.1/variant.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/variants/heltec_v2.1/variant.h b/variants/heltec_v2.1/variant.h index 2c0f4e165..f361e0f46 100644 --- a/variants/heltec_v2.1/variant.h +++ b/variants/heltec_v2.1/variant.h @@ -1,9 +1,12 @@ -// the default ESP32 Pin of 15 is the Oled SCL, set to 36 and 37 and works fine. +// Pin planning should refer to this document +// https://resource.heltec.cn/download/WiFi_LoRa_32/WIFI_LoRa_32_V2.pdf + +// the default ESP32 Pin of 15 is the Oled SCL, 37 is battery pin. // Tested on Neo6m module. #undef GPS_RX_PIN #undef GPS_TX_PIN -#define GPS_RX_PIN 36 -#define GPS_TX_PIN 37 +#define GPS_RX_PIN 32 +#define GPS_TX_PIN 33 #ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag #define I2C_SDA 4 // I2C pins for this board From 9ce8db1a0bfb48ea76dac25a9741c0f70439aeb4 Mon Sep 17 00:00:00 2001 From: Shengming Yuan <11619780+ssysm@users.noreply.github.com> Date: Fri, 1 Apr 2022 15:30:55 -0400 Subject: [PATCH 6/9] Change RX pin back to 36 --- variants/heltec_v2.1/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/heltec_v2.1/variant.h b/variants/heltec_v2.1/variant.h index f361e0f46..d2c00a18c 100644 --- a/variants/heltec_v2.1/variant.h +++ b/variants/heltec_v2.1/variant.h @@ -5,7 +5,7 @@ // Tested on Neo6m module. #undef GPS_RX_PIN #undef GPS_TX_PIN -#define GPS_RX_PIN 32 +#define GPS_RX_PIN 36 #define GPS_TX_PIN 33 #ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag From 07e2816703a3936c953d02fb12a3d137c501c4b7 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 1 Apr 2022 23:35:18 +0000 Subject: [PATCH 7/9] Promote device metrics (#1347) * NodeInfo slimfast * Update --- proto | 2 +- src/mesh/NodeDB.cpp | 4 ++-- src/mesh/generated/deviceonly.pb.h | 2 +- src/mesh/generated/mesh.pb.h | 18 +++++++++--------- src/mesh/generated/telemetry.pb.h | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/proto b/proto index 99ce57802..31eaff092 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 99ce57802da9e8a3106d29b94e14e4a090cde3b3 +Subproject commit 31eaff092449a75ebbbf0114cf120c746dc96349 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 64ac00673..a394db13e 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -506,8 +506,8 @@ void NodeDB::updateTelemetry(uint32_t nodeId, const Telemetry &t, RxSource src) } else { DEBUG_MSG("updateTelemetry REMOTE node=0x%x \n", nodeId); } - info->telemetry = t; - info->has_telemetry = true; + info->device_metrics = t.variant.device_metrics; + info->has_device_metrics = true; updateGUIforNode = info; notifyObservers(true); // Force an update whether or not our node counts have changed } diff --git a/src/mesh/generated/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h index 0dc8daa33..8250cf568 100644 --- a/src/mesh/generated/deviceonly.pb.h +++ b/src/mesh/generated/deviceonly.pb.h @@ -108,7 +108,7 @@ extern const pb_msgdesc_t ChannelFile_msg; /* Maximum encoded size of messages (where known) */ #define ChannelFile_size 832 -#define DeviceState_size 25183 +#define DeviceState_size 23903 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index aef07ed15..eadcfa32a 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -562,9 +562,9 @@ typedef struct _NodeInfo { float snr; /* Set to indicate the last time we received a packet from this node */ uint32_t last_heard; - /* The latest device telemetry data for the node. */ - bool has_telemetry; - Telemetry telemetry; + /* The latest device metrics for the node. */ + bool has_device_metrics; + DeviceMetrics device_metrics; } NodeInfo; /* A Routing control Data packet handled by the routing module */ @@ -737,7 +737,7 @@ extern "C" { #define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, Location_init_default} #define Location_init_default {0, 0, 0, 0, 0} #define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} -#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, Telemetry_init_default} +#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, DeviceMetrics_init_default} #define MyNodeInfo_init_default {0, 0, "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} #define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}} @@ -750,7 +750,7 @@ extern "C" { #define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, Location_init_zero} #define Location_init_zero {0, 0, 0, 0, 0} #define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} -#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, Telemetry_init_zero} +#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, DeviceMetrics_init_zero} #define MyNodeInfo_init_zero {0, 0, "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} #define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}} @@ -833,7 +833,7 @@ extern "C" { #define NodeInfo_position_tag 3 #define NodeInfo_snr_tag 4 #define NodeInfo_last_heard_tag 5 -#define NodeInfo_telemetry_tag 6 +#define NodeInfo_device_metrics_tag 6 #define Routing_route_request_tag 1 #define Routing_route_reply_tag 2 #define Routing_error_reason_tag 3 @@ -964,12 +964,12 @@ X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \ X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \ X(a, STATIC, SINGULAR, FLOAT, snr, 4) \ X(a, STATIC, SINGULAR, FIXED32, last_heard, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, telemetry, 6) +X(a, STATIC, OPTIONAL, MESSAGE, device_metrics, 6) #define NodeInfo_CALLBACK NULL #define NodeInfo_DEFAULT NULL #define NodeInfo_user_MSGTYPE User #define NodeInfo_position_MSGTYPE Position -#define NodeInfo_telemetry_MSGTYPE Telemetry +#define NodeInfo_device_metrics_MSGTYPE DeviceMetrics #define MyNodeInfo_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \ @@ -1067,7 +1067,7 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg; #define LogRecord_size 81 #define MeshPacket_size 347 #define MyNodeInfo_size 210 -#define NodeInfo_size 299 +#define NodeInfo_size 283 #define Position_size 142 #define RouteDiscovery_size 40 #define Routing_size 42 diff --git a/src/mesh/generated/telemetry.pb.h b/src/mesh/generated/telemetry.pb.h index b3bf3df1d..1fb5ea0d7 100644 --- a/src/mesh/generated/telemetry.pb.h +++ b/src/mesh/generated/telemetry.pb.h @@ -40,10 +40,10 @@ typedef struct _EnvironmentMetrics { /* Types of Measurements the telemetry module is equipped to handle */ typedef struct _Telemetry { - /* This is usually not sent over the mesh (to save space), but it is sent - from the phone so that the local device can set its RTC If it is sent over - the mesh (because there are devices on the mesh without GPS), it will only - be sent by devices which has a hardware GPS clock (IE Mobile Phone). + /* This is usually not sent over the mesh (to save space), but it is sent + from the phone so that the local device can set its RTC If it is sent over + the mesh (because there are devices on the mesh without GPS), it will only + be sent by devices which has a hardware GPS clock (IE Mobile Phone). seconds since 1970 */ uint32_t time; /* Key native device metrics such as battery level */ From 357c9fcd76c5ef2406b505378920284a99e2eab3 Mon Sep 17 00:00:00 2001 From: ssysm Date: Fri, 1 Apr 2022 23:38:23 -0400 Subject: [PATCH 8/9] revert --- proto | 2 +- src/mesh/NodeDB.cpp | 4 ++-- src/mesh/generated/deviceonly.pb.h | 2 +- src/mesh/generated/mesh.pb.h | 18 +++++++++--------- src/mesh/generated/telemetry.pb.h | 8 ++++---- variants/heltec_v2.1/variant.h | 7 +++++-- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/proto b/proto index 99ce57802..31eaff092 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 99ce57802da9e8a3106d29b94e14e4a090cde3b3 +Subproject commit 31eaff092449a75ebbbf0114cf120c746dc96349 diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 64ac00673..a394db13e 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -506,8 +506,8 @@ void NodeDB::updateTelemetry(uint32_t nodeId, const Telemetry &t, RxSource src) } else { DEBUG_MSG("updateTelemetry REMOTE node=0x%x \n", nodeId); } - info->telemetry = t; - info->has_telemetry = true; + info->device_metrics = t.variant.device_metrics; + info->has_device_metrics = true; updateGUIforNode = info; notifyObservers(true); // Force an update whether or not our node counts have changed } diff --git a/src/mesh/generated/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h index 0dc8daa33..8250cf568 100644 --- a/src/mesh/generated/deviceonly.pb.h +++ b/src/mesh/generated/deviceonly.pb.h @@ -108,7 +108,7 @@ extern const pb_msgdesc_t ChannelFile_msg; /* Maximum encoded size of messages (where known) */ #define ChannelFile_size 832 -#define DeviceState_size 25183 +#define DeviceState_size 23903 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index aef07ed15..eadcfa32a 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -562,9 +562,9 @@ typedef struct _NodeInfo { float snr; /* Set to indicate the last time we received a packet from this node */ uint32_t last_heard; - /* The latest device telemetry data for the node. */ - bool has_telemetry; - Telemetry telemetry; + /* The latest device metrics for the node. */ + bool has_device_metrics; + DeviceMetrics device_metrics; } NodeInfo; /* A Routing control Data packet handled by the routing module */ @@ -737,7 +737,7 @@ extern "C" { #define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, Location_init_default} #define Location_init_default {0, 0, 0, 0, 0} #define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} -#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, Telemetry_init_default} +#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, DeviceMetrics_init_default} #define MyNodeInfo_init_default {0, 0, "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} #define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}} @@ -750,7 +750,7 @@ extern "C" { #define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, Location_init_zero} #define Location_init_zero {0, 0, 0, 0, 0} #define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN} -#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, Telemetry_init_zero} +#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, DeviceMetrics_init_zero} #define MyNodeInfo_init_zero {0, 0, "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0} #define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}} @@ -833,7 +833,7 @@ extern "C" { #define NodeInfo_position_tag 3 #define NodeInfo_snr_tag 4 #define NodeInfo_last_heard_tag 5 -#define NodeInfo_telemetry_tag 6 +#define NodeInfo_device_metrics_tag 6 #define Routing_route_request_tag 1 #define Routing_route_reply_tag 2 #define Routing_error_reason_tag 3 @@ -964,12 +964,12 @@ X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \ X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \ X(a, STATIC, SINGULAR, FLOAT, snr, 4) \ X(a, STATIC, SINGULAR, FIXED32, last_heard, 5) \ -X(a, STATIC, OPTIONAL, MESSAGE, telemetry, 6) +X(a, STATIC, OPTIONAL, MESSAGE, device_metrics, 6) #define NodeInfo_CALLBACK NULL #define NodeInfo_DEFAULT NULL #define NodeInfo_user_MSGTYPE User #define NodeInfo_position_MSGTYPE Position -#define NodeInfo_telemetry_MSGTYPE Telemetry +#define NodeInfo_device_metrics_MSGTYPE DeviceMetrics #define MyNodeInfo_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \ @@ -1067,7 +1067,7 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg; #define LogRecord_size 81 #define MeshPacket_size 347 #define MyNodeInfo_size 210 -#define NodeInfo_size 299 +#define NodeInfo_size 283 #define Position_size 142 #define RouteDiscovery_size 40 #define Routing_size 42 diff --git a/src/mesh/generated/telemetry.pb.h b/src/mesh/generated/telemetry.pb.h index b3bf3df1d..1fb5ea0d7 100644 --- a/src/mesh/generated/telemetry.pb.h +++ b/src/mesh/generated/telemetry.pb.h @@ -40,10 +40,10 @@ typedef struct _EnvironmentMetrics { /* Types of Measurements the telemetry module is equipped to handle */ typedef struct _Telemetry { - /* This is usually not sent over the mesh (to save space), but it is sent - from the phone so that the local device can set its RTC If it is sent over - the mesh (because there are devices on the mesh without GPS), it will only - be sent by devices which has a hardware GPS clock (IE Mobile Phone). + /* This is usually not sent over the mesh (to save space), but it is sent + from the phone so that the local device can set its RTC If it is sent over + the mesh (because there are devices on the mesh without GPS), it will only + be sent by devices which has a hardware GPS clock (IE Mobile Phone). seconds since 1970 */ uint32_t time; /* Key native device metrics such as battery level */ diff --git a/variants/heltec_v2.1/variant.h b/variants/heltec_v2.1/variant.h index 2c0f4e165..d2c00a18c 100644 --- a/variants/heltec_v2.1/variant.h +++ b/variants/heltec_v2.1/variant.h @@ -1,9 +1,12 @@ -// the default ESP32 Pin of 15 is the Oled SCL, set to 36 and 37 and works fine. +// Pin planning should refer to this document +// https://resource.heltec.cn/download/WiFi_LoRa_32/WIFI_LoRa_32_V2.pdf + +// the default ESP32 Pin of 15 is the Oled SCL, 37 is battery pin. // Tested on Neo6m module. #undef GPS_RX_PIN #undef GPS_TX_PIN #define GPS_RX_PIN 36 -#define GPS_TX_PIN 37 +#define GPS_TX_PIN 33 #ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag #define I2C_SDA 4 // I2C pins for this board From 5a67dada959c145bd760a832761e9ef4842e3555 Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Sat, 2 Apr 2022 16:30:34 +1100 Subject: [PATCH 9/9] Create New Board.yml --- .github/ISSUE_TEMPLATE/New Board.yml | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/New Board.yml diff --git a/.github/ISSUE_TEMPLATE/New Board.yml b/.github/ISSUE_TEMPLATE/New Board.yml new file mode 100644 index 000000000..ad706f3c0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/New Board.yml @@ -0,0 +1,46 @@ +name: New Board +description: Request us to support new hardware +title: "[Board]: " +labels: ["enhancement", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for requesting a new board, this will not gurantee that we will support it, but will be on our radar. + + - type: dropdown + id: soc + attributes: + label: SOC + description: What SOC does your board have? + multiple: true + options: + - NRF52 + - ESP32 + - Other + validations: + required: true + + - type: input + id: lora + attributes: + label: Lora IC + description: What LoRa IC does the board have? + validations: + required: true + + - type: input + id: link + attributes: + label: Product Link + description: Where can we find this product? + validations: + required: true + + - type: textarea + id: body + attributes: + label: Description + description: Please provide any further details you think we may need. + validations: + required: true