From df88feba0f12b3af85b9c69c59eb2a6385ebfb75 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 7 Dec 2021 09:14:31 -0800 Subject: [PATCH 1/8] Feature request: add the hop limit info to range test plugin #967 --- src/plugins/esp32/RangeTestPlugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/esp32/RangeTestPlugin.cpp b/src/plugins/esp32/RangeTestPlugin.cpp index df15a385..aa188132 100644 --- a/src/plugins/esp32/RangeTestPlugin.cpp +++ b/src/plugins/esp32/RangeTestPlugin.cpp @@ -229,7 +229,7 @@ bool RangeTestPluginRadio::appendFile(const MeshPacket &mp) // Print the CSV header if (fileToWrite.println( - "time,from,sender name,sender lat,sender long,rx lat,rx long,rx elevation,rx snr,distance,payload")) { + "time,from,sender name,sender lat,sender long,rx lat,rx long,rx elevation,rx snr,distance,hop limit,payload")) { DEBUG_MSG("File was written\n"); } else { DEBUG_MSG("File write failed\n"); @@ -279,6 +279,8 @@ bool RangeTestPluginRadio::appendFile(const MeshPacket &mp) fileToAppend.printf("0,"); } + fileToAppend.printf("%d,", mp.hop_limit); // Packet Hop Limit + // TODO: If quotes are found in the payload, it has to be escaped. fileToAppend.printf("\"%s\"\n", p.payload.bytes); fileToAppend.close(); From a904bb8cc591ac1bbce5a91f2f7dc6bcd84649d7 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 7 Dec 2021 11:26:06 -0800 Subject: [PATCH 2/8] Generated protos for Feature request: add airtime to NodeInfo #970 --- src/mesh/generated/deviceonly.pb.h | 4 +++- src/mesh/generated/mesh.pb.h | 21 +++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/mesh/generated/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h index deb141d2..db97425a 100644 --- a/src/mesh/generated/deviceonly.pb.h +++ b/src/mesh/generated/deviceonly.pb.h @@ -125,7 +125,9 @@ extern const pb_msgdesc_t ChannelFile_msg; /* Maximum encoded size of messages (where known) */ #define LegacyRadioConfig_size 4 #define LegacyRadioConfig_LegacyPreferences_size 2 -#define DeviceState_size 9599 +#if defined(MyNodeInfo_size) +#define DeviceState_size (9497 + MyNodeInfo_size) +#endif #define ChannelFile_size 832 #ifdef __cplusplus diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 69c7756e..925c7119 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -153,6 +153,9 @@ typedef struct _MyNodeInfo { uint32_t message_timeout_msec; uint32_t min_app_version; uint32_t max_channels; + pb_callback_t air_period_tx; + pb_callback_t air_period_rx; + pb_callback_t air_period_tx_all; } MyNodeInfo; typedef struct _Position { @@ -316,7 +319,7 @@ extern "C" { #define Data_init_default {_PortNum_MIN, {0, {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} #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 MyNodeInfo_init_default {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} #define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}} #define ToRadio_init_default {0, {MeshPacket_init_default}} @@ -328,7 +331,7 @@ extern "C" { #define Data_init_zero {_PortNum_MIN, {0, {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} #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 MyNodeInfo_init_zero {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} #define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}} #define ToRadio_init_zero {0, {MeshPacket_init_zero}} @@ -359,6 +362,9 @@ extern "C" { #define MyNodeInfo_message_timeout_msec_tag 13 #define MyNodeInfo_min_app_version_tag 14 #define MyNodeInfo_max_channels_tag 15 +#define MyNodeInfo_air_period_tx_tag 16 +#define MyNodeInfo_air_period_rx_tag 17 +#define MyNodeInfo_air_period_tx_all_tag 18 #define Position_latitude_i_tag 1 #define Position_longitude_i_tag 2 #define Position_altitude_tag 3 @@ -535,8 +541,11 @@ X(a, STATIC, SINGULAR, UINT32, reboot_count, 10) \ X(a, STATIC, SINGULAR, FLOAT, bitrate, 11) \ X(a, STATIC, SINGULAR, UINT32, message_timeout_msec, 13) \ X(a, STATIC, SINGULAR, UINT32, min_app_version, 14) \ -X(a, STATIC, SINGULAR, UINT32, max_channels, 15) -#define MyNodeInfo_CALLBACK NULL +X(a, STATIC, SINGULAR, UINT32, max_channels, 15) \ +X(a, CALLBACK, REPEATED, UINT32, air_period_tx, 16) \ +X(a, CALLBACK, REPEATED, UINT32, air_period_rx, 17) \ +X(a, CALLBACK, REPEATED, UINT32, air_period_tx_all, 18) +#define MyNodeInfo_CALLBACK pb_default_field_callback #define MyNodeInfo_DEFAULT NULL #define LogRecord_FIELDLIST(X, a) \ @@ -613,9 +622,9 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg; #define Data_size 260 #define MeshPacket_size 309 #define NodeInfo_size 270 -#define MyNodeInfo_size 106 +/* MyNodeInfo_size depends on runtime parameters */ #define LogRecord_size 81 -#define FromRadio_size 318 +/* FromRadio_size depends on runtime parameters */ #define ToRadio_size 312 #define ToRadio_PeerInfo_size 8 From d3dc51d1023ac7a0f2012f7312e58be9bbf926ba Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 7 Dec 2021 11:31:46 -0800 Subject: [PATCH 3/8] Fix typo --- src/mesh/generated/mesh.pb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 925c7119..61486759 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -155,7 +155,7 @@ typedef struct _MyNodeInfo { uint32_t max_channels; pb_callback_t air_period_tx; pb_callback_t air_period_rx; - pb_callback_t air_period_tx_all; + pb_callback_t air_period_rx_all; } MyNodeInfo; typedef struct _Position { @@ -364,7 +364,7 @@ extern "C" { #define MyNodeInfo_max_channels_tag 15 #define MyNodeInfo_air_period_tx_tag 16 #define MyNodeInfo_air_period_rx_tag 17 -#define MyNodeInfo_air_period_tx_all_tag 18 +#define MyNodeInfo_air_period_rx_all_tag 18 #define Position_latitude_i_tag 1 #define Position_longitude_i_tag 2 #define Position_altitude_tag 3 @@ -544,7 +544,7 @@ X(a, STATIC, SINGULAR, UINT32, min_app_version, 14) \ X(a, STATIC, SINGULAR, UINT32, max_channels, 15) \ X(a, CALLBACK, REPEATED, UINT32, air_period_tx, 16) \ X(a, CALLBACK, REPEATED, UINT32, air_period_rx, 17) \ -X(a, CALLBACK, REPEATED, UINT32, air_period_tx_all, 18) +X(a, CALLBACK, REPEATED, UINT32, air_period_rx_all, 18) #define MyNodeInfo_CALLBACK pb_default_field_callback #define MyNodeInfo_DEFAULT NULL From 67766b817c7c88e110e19c2c469bf4947771ddf2 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 7 Dec 2021 11:44:48 -0800 Subject: [PATCH 4/8] Reduce size of airtime structure for mynodeinfo --- src/mesh/generated/deviceonly.pb.h | 4 +--- src/mesh/generated/mesh.pb.c | 2 +- src/mesh/generated/mesh.pb.h | 23 +++++++++++------------ 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/mesh/generated/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h index db97425a..46fdcac7 100644 --- a/src/mesh/generated/deviceonly.pb.h +++ b/src/mesh/generated/deviceonly.pb.h @@ -125,9 +125,7 @@ extern const pb_msgdesc_t ChannelFile_msg; /* Maximum encoded size of messages (where known) */ #define LegacyRadioConfig_size 4 #define LegacyRadioConfig_LegacyPreferences_size 2 -#if defined(MyNodeInfo_size) -#define DeviceState_size (9497 + MyNodeInfo_size) -#endif +#define DeviceState_size 9936 #define ChannelFile_size 832 #ifdef __cplusplus diff --git a/src/mesh/generated/mesh.pb.c b/src/mesh/generated/mesh.pb.c index 6f5c55eb..5113bbdb 100644 --- a/src/mesh/generated/mesh.pb.c +++ b/src/mesh/generated/mesh.pb.c @@ -27,7 +27,7 @@ PB_BIND(MeshPacket, MeshPacket, 2) PB_BIND(NodeInfo, NodeInfo, AUTO) -PB_BIND(MyNodeInfo, MyNodeInfo, AUTO) +PB_BIND(MyNodeInfo, MyNodeInfo, 2) PB_BIND(LogRecord, LogRecord, AUTO) diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 61486759..8defe625 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -153,9 +153,10 @@ typedef struct _MyNodeInfo { uint32_t message_timeout_msec; uint32_t min_app_version; uint32_t max_channels; - pb_callback_t air_period_tx; - pb_callback_t air_period_rx; - pb_callback_t air_period_rx_all; + pb_size_t air_period_tx_count; + uint32_t air_period_tx[24]; + pb_size_t air_period_rx_count; + uint32_t air_period_rx[24]; } MyNodeInfo; typedef struct _Position { @@ -319,7 +320,7 @@ extern "C" { #define Data_init_default {_PortNum_MIN, {0, {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} #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, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} +#define MyNodeInfo_init_default {0, 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, 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, 0}} #define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}} #define ToRadio_init_default {0, {MeshPacket_init_default}} @@ -331,7 +332,7 @@ extern "C" { #define Data_init_zero {_PortNum_MIN, {0, {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} #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, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} +#define MyNodeInfo_init_zero {0, 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, 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, 0}} #define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}} #define ToRadio_init_zero {0, {MeshPacket_init_zero}} @@ -364,7 +365,6 @@ extern "C" { #define MyNodeInfo_max_channels_tag 15 #define MyNodeInfo_air_period_tx_tag 16 #define MyNodeInfo_air_period_rx_tag 17 -#define MyNodeInfo_air_period_rx_all_tag 18 #define Position_latitude_i_tag 1 #define Position_longitude_i_tag 2 #define Position_altitude_tag 3 @@ -542,10 +542,9 @@ X(a, STATIC, SINGULAR, FLOAT, bitrate, 11) \ X(a, STATIC, SINGULAR, UINT32, message_timeout_msec, 13) \ X(a, STATIC, SINGULAR, UINT32, min_app_version, 14) \ X(a, STATIC, SINGULAR, UINT32, max_channels, 15) \ -X(a, CALLBACK, REPEATED, UINT32, air_period_tx, 16) \ -X(a, CALLBACK, REPEATED, UINT32, air_period_rx, 17) \ -X(a, CALLBACK, REPEATED, UINT32, air_period_rx_all, 18) -#define MyNodeInfo_CALLBACK pb_default_field_callback +X(a, STATIC, REPEATED, UINT32, air_period_tx, 16) \ +X(a, STATIC, REPEATED, UINT32, air_period_rx, 17) +#define MyNodeInfo_CALLBACK NULL #define MyNodeInfo_DEFAULT NULL #define LogRecord_FIELDLIST(X, a) \ @@ -622,9 +621,9 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg; #define Data_size 260 #define MeshPacket_size 309 #define NodeInfo_size 270 -/* MyNodeInfo_size depends on runtime parameters */ +#define MyNodeInfo_size 442 #define LogRecord_size 81 -/* FromRadio_size depends on runtime parameters */ +#define FromRadio_size 451 #define ToRadio_size 312 #define ToRadio_PeerInfo_size 8 From f86e0d46b6eb5f892fdb0b92e4afc57379eaedcf Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 7 Dec 2021 13:04:50 -0800 Subject: [PATCH 5/8] Add calculated airtimes to myNodeInfo https://github.com/meshtastic/Meshtastic-device/issues/970 --- src/airtime.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/airtime.cpp b/src/airtime.cpp index 221ba119..683b8f2c 100644 --- a/src/airtime.cpp +++ b/src/airtime.cpp @@ -1,7 +1,8 @@ #include "configuration.h" #include "airtime.h" +#include "NodeDB.h" -#define periodsToLog 48 +#define periodsToLog 24 AirTime *airTime; @@ -24,9 +25,11 @@ void AirTime::logAirtime(reportTypes reportType, uint32_t airtime_ms) if (reportType == TX_LOG) { DEBUG_MSG("AirTime - Packet transmitted : %ums\n", airtime_ms); airtimes.periodTX[0] = airtimes.periodTX[0] + airtime_ms; + myNodeInfo.air_period_tx[0] = myNodeInfo.air_period_tx[0] + airtime_ms; } else if (reportType == RX_LOG) { DEBUG_MSG("AirTime - Packet received : %ums\n", airtime_ms); airtimes.periodRX[0] = airtimes.periodRX[0] + airtime_ms; + myNodeInfo.air_period_rx[0] = myNodeInfo.air_period_rx[0] + airtime_ms; } else if (reportType == RX_ALL_LOG) { DEBUG_MSG("AirTime - Packet received (noise?) : %ums\n", airtime_ms); airtimes.periodRX_ALL[0] = airtimes.periodRX_ALL[0] + airtime_ms; @@ -50,11 +53,18 @@ void airtimeRotatePeriod() airtimes.periodTX[i + 1] = airtimes.periodTX[i]; airtimes.periodRX[i + 1] = airtimes.periodRX[i]; airtimes.periodRX_ALL[i + 1] = airtimes.periodRX_ALL[i]; + + myNodeInfo.air_period_tx[i + 1] = myNodeInfo.air_period_tx[i]; + myNodeInfo.air_period_rx[i + 1] = myNodeInfo.air_period_rx[i]; } airtimes.periodTX[0] = 0; airtimes.periodRX[0] = 0; airtimes.periodRX_ALL[0] = 0; + myNodeInfo.air_period_tx[0] = 0; + myNodeInfo.air_period_rx[0] = 0; + + airtimes.lastPeriodIndex = currentPeriodIndex(); } } From 6cfdd99fd1499def08f3bffc4707f50ac5fed953 Mon Sep 17 00:00:00 2001 From: Solanaceae <93513823+Solarvortx@users.noreply.github.com> Date: Tue, 7 Dec 2021 20:26:26 -0700 Subject: [PATCH 6/8] Update and configure ExNotify platforms --- src/configuration.h | 6 +++++- src/plugins/ExternalNotificationPlugin.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index 4e73531d..1b392ad5 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -171,7 +171,8 @@ along with this program. If not, see . #define I2C_SCL 22 #define BUTTON_PIN 38 // The middle button GPIO on the T-Beam -#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed +//#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented anywhere. +#define EXT_NOTIFY_PIN 13 // Default pin to use for Ext Notify Plugin. #define LED_INVERTED 1 #define LED_PIN 4 // Newer tbeams (1.1) have an extra led on GPIO4 @@ -213,6 +214,7 @@ along with this program. If not, see . #define BUTTON_PIN 39 #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage +#define EXT_NOTIFY_PIN 13 // Default pin to use for Ext Notify Plugin. #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module @@ -316,6 +318,7 @@ along with this program. If not, see . #define HW_VENDOR HardwareModel_HELTEC_V2_1 #define BATTERY_PIN 37 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage +#define EXT_NOTIFY_PIN 13 // Default pin to use for Ext Notify Plugin. #endif @@ -338,6 +341,7 @@ along with this program. If not, see . #define LED_PIN 2 // If defined we will blink this LED #define BUTTON_PIN 0 // If defined, this will be used for user button presses #define BUTTON_NEED_PULLUP +#define EXT_NOTIFY_PIN 13 // Default pin to use for Ext Notify Plugin. #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module diff --git a/src/plugins/ExternalNotificationPlugin.cpp b/src/plugins/ExternalNotificationPlugin.cpp index b19e9ad4..e731c851 100644 --- a/src/plugins/ExternalNotificationPlugin.cpp +++ b/src/plugins/ExternalNotificationPlugin.cpp @@ -44,7 +44,7 @@ */ // Default configurations -#define EXT_NOTIFICATION_PLUGIN_OUTPUT 13 +#define EXT_NOTIFICATION_PLUGIN_OUTPUT EXT_NOTIFY_PIN #define EXT_NOTIFICATION_PLUGIN_OUTPUT_MS 1000 #define ASCII_BELL 0x07 @@ -84,21 +84,25 @@ int32_t ExternalNotificationPlugin::runOnce() void ExternalNotificationPlugin::setExternalOn() { + #ifdef EXT_NOTIFY_PIN externalCurrentState = 1; externalTurnedOn = millis(); digitalWrite((radioConfig.preferences.ext_notification_plugin_output ? radioConfig.preferences.ext_notification_plugin_output : EXT_NOTIFICATION_PLUGIN_OUTPUT), (radioConfig.preferences.ext_notification_plugin_active ? true : false)); + #endif } void ExternalNotificationPlugin::setExternalOff() { + #ifdef EXT_NOTIFY_PIN externalCurrentState = 0; digitalWrite((radioConfig.preferences.ext_notification_plugin_output ? radioConfig.preferences.ext_notification_plugin_output : EXT_NOTIFICATION_PLUGIN_OUTPUT), (radioConfig.preferences.ext_notification_plugin_active ? false : true)); + #endif } // -------- @@ -111,6 +115,7 @@ ExternalNotificationPlugin::ExternalNotificationPlugin() boundChannel = Channels::gpioChannel; #ifndef NO_ESP32 + #ifdef EXT_NOTIFY_PIN /* Uncomment the preferences below if you want to use the plugin @@ -140,12 +145,14 @@ ExternalNotificationPlugin::ExternalNotificationPlugin() DEBUG_MSG("External Notification Plugin Disabled\n"); enabled = false; } + #endif #endif } ProcessMessage ExternalNotificationPlugin::handleReceived(const MeshPacket &mp) { #ifndef NO_ESP32 + #ifdef EXT_NOTIFY_PIN if (radioConfig.preferences.ext_notification_plugin_enabled) { @@ -173,6 +180,7 @@ ProcessMessage ExternalNotificationPlugin::handleReceived(const MeshPacket &mp) } else { DEBUG_MSG("External Notification Plugin Disabled\n"); } + #endif #endif From b6d63059bfe13ea0aad22918d111e6e38eb607d3 Mon Sep 17 00:00:00 2001 From: Solanaceae <93513823+Solarvortx@users.noreply.github.com> Date: Tue, 7 Dec 2021 21:34:10 -0700 Subject: [PATCH 7/8] Change EXT_NOTIFY_PIN to EXT_NOTIFY_OUT per req. --- src/configuration.h | 8 ++++---- src/plugins/ExternalNotificationPlugin.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index 1b392ad5..0d32e36f 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -172,7 +172,7 @@ along with this program. If not, see . #define BUTTON_PIN 38 // The middle button GPIO on the T-Beam //#define BUTTON_PIN_ALT 13 // Alternate GPIO for an external button if needed. Does anyone use this? It is not documented anywhere. -#define EXT_NOTIFY_PIN 13 // Default pin to use for Ext Notify Plugin. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. #define LED_INVERTED 1 #define LED_PIN 4 // Newer tbeams (1.1) have an extra led on GPIO4 @@ -214,7 +214,7 @@ along with this program. If not, see . #define BUTTON_PIN 39 #define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define EXT_NOTIFY_PIN 13 // Default pin to use for Ext Notify Plugin. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module @@ -318,7 +318,7 @@ along with this program. If not, see . #define HW_VENDOR HardwareModel_HELTEC_V2_1 #define BATTERY_PIN 37 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define EXT_NOTIFY_PIN 13 // Default pin to use for Ext Notify Plugin. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. #endif @@ -341,7 +341,7 @@ along with this program. If not, see . #define LED_PIN 2 // If defined we will blink this LED #define BUTTON_PIN 0 // If defined, this will be used for user button presses #define BUTTON_NEED_PULLUP -#define EXT_NOTIFY_PIN 13 // Default pin to use for Ext Notify Plugin. +#define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. #define USE_RF95 #define LORA_DIO0 26 // a No connect on the SX1262 module diff --git a/src/plugins/ExternalNotificationPlugin.cpp b/src/plugins/ExternalNotificationPlugin.cpp index e731c851..8b25d77e 100644 --- a/src/plugins/ExternalNotificationPlugin.cpp +++ b/src/plugins/ExternalNotificationPlugin.cpp @@ -44,7 +44,7 @@ */ // Default configurations -#define EXT_NOTIFICATION_PLUGIN_OUTPUT EXT_NOTIFY_PIN +#define EXT_NOTIFICATION_PLUGIN_OUTPUT EXT_NOTIFY_OUT #define EXT_NOTIFICATION_PLUGIN_OUTPUT_MS 1000 #define ASCII_BELL 0x07 @@ -84,7 +84,7 @@ int32_t ExternalNotificationPlugin::runOnce() void ExternalNotificationPlugin::setExternalOn() { - #ifdef EXT_NOTIFY_PIN + #ifdef EXT_NOTIFY_OUT externalCurrentState = 1; externalTurnedOn = millis(); @@ -96,7 +96,7 @@ void ExternalNotificationPlugin::setExternalOn() void ExternalNotificationPlugin::setExternalOff() { - #ifdef EXT_NOTIFY_PIN + #ifdef EXT_NOTIFY_OUT externalCurrentState = 0; digitalWrite((radioConfig.preferences.ext_notification_plugin_output ? radioConfig.preferences.ext_notification_plugin_output @@ -115,7 +115,7 @@ ExternalNotificationPlugin::ExternalNotificationPlugin() boundChannel = Channels::gpioChannel; #ifndef NO_ESP32 - #ifdef EXT_NOTIFY_PIN + #ifdef EXT_NOTIFY_OUT /* Uncomment the preferences below if you want to use the plugin @@ -152,7 +152,7 @@ ExternalNotificationPlugin::ExternalNotificationPlugin() ProcessMessage ExternalNotificationPlugin::handleReceived(const MeshPacket &mp) { #ifndef NO_ESP32 - #ifdef EXT_NOTIFY_PIN + #ifdef EXT_NOTIFY_OUT if (radioConfig.preferences.ext_notification_plugin_enabled) { From 2ad37e2126d9e808361bfa950919c74379947c04 Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Wed, 8 Dec 2021 17:13:34 -0800 Subject: [PATCH 8/8] updating proto submodule to latest --- proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto b/proto index a05411df..f9fed7a6 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit a05411df398d67aee668c366233ddfb88307698a +Subproject commit f9fed7a630bb47505ce2645ab875859b5e554ab2