From 44ffdc5172158ee836e9407730eabd630bf52be6 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 31 Jul 2022 11:13:12 -0500 Subject: [PATCH 1/8] Send to phone like position packets (#1582) --- src/modules/Telemetry/DeviceTelemetry.cpp | 2 +- src/modules/Telemetry/EnvironmentTelemetry.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/Telemetry/DeviceTelemetry.cpp b/src/modules/Telemetry/DeviceTelemetry.cpp index 3fb1807ba..868f68d34 100644 --- a/src/modules/Telemetry/DeviceTelemetry.cpp +++ b/src/modules/Telemetry/DeviceTelemetry.cpp @@ -72,7 +72,7 @@ bool DeviceTelemetryModule::sendOurTelemetry(NodeNum dest, bool wantReplies) lastMeasurementPacket = packetPool.allocCopy(*p); DEBUG_MSG("Device Telemetry: Sending packet to mesh\n"); - service.sendToMesh(p); + service.sendToMesh(p, RX_SRC_LOCAL, true); nodeDB.updateTelemetry(nodeDB.getNodeNum(), t, RX_SRC_LOCAL); return true; } diff --git a/src/modules/Telemetry/EnvironmentTelemetry.cpp b/src/modules/Telemetry/EnvironmentTelemetry.cpp index 51df254cd..14d9c2243 100644 --- a/src/modules/Telemetry/EnvironmentTelemetry.cpp +++ b/src/modules/Telemetry/EnvironmentTelemetry.cpp @@ -229,6 +229,6 @@ bool EnvironmentTelemetryModule::sendOurTelemetry(NodeNum dest, bool wantReplies lastMeasurementPacket = packetPool.allocCopy(*p); DEBUG_MSG("Environment Telemetry: Sending packet to mesh"); - service.sendToMesh(p); + service.sendToMesh(p, RX_SRC_LOCAL, true); return true; } From ba9d52da25c3fc3cc1de60538a85676f2d4003e6 Mon Sep 17 00:00:00 2001 From: Ted Schundler Date: Sun, 31 Jul 2022 19:06:48 -0700 Subject: [PATCH 2/8] Respect GPS pins set in variant.h --- src/esp32/architecture.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/esp32/architecture.h b/src/esp32/architecture.h index ab0764db3..dd9031d6d 100644 --- a/src/esp32/architecture.h +++ b/src/esp32/architecture.h @@ -77,12 +77,16 @@ // #define GPS_SERIAL_NUM 1 +#ifndef GPS_RX_PIN #define GPS_RX_PIN 34 +#endif +#ifndef GPS_TX_PIN #ifdef USE_JTAG #define GPS_TX_PIN -1 #else #define GPS_TX_PIN 12 #endif +#endif // ----------------------------------------------------------------------------- // LoRa SPI From d64c5528651ebd986b402284ac5c7a32dbc6d792 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Mon, 1 Aug 2022 23:59:50 +0200 Subject: [PATCH 3/8] Rebroadcast direct message until (implicit) ACK (#1578) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ben Meadors Co-authored-by: Thomas Göttgens --- src/mesh/FloodingRouter.cpp | 8 ++++++-- src/mesh/ReliableRouter.cpp | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index e01863de1..5e3126f77 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -29,8 +29,12 @@ bool FloodingRouter::shouldFilterReceived(MeshPacket *p) void FloodingRouter::sniffReceived(const MeshPacket *p, const Routing *c) { - - if ((p->to == NODENUM_BROADCAST) && (p->hop_limit > 0) && (getFrom(p) != getNodeNum())) { + PacketId ackId = ((c && c->error_reason == Routing_Error_NONE) || !c) ? p->decoded.request_id : 0; + if (ackId && p->to != getNodeNum()) { + // do not flood direct message that is ACKed + DEBUG_MSG("Receiving an ACK not for me, but don't need to rebroadcast this direct message anymore.\n"); + Router::cancelSending(p->to, p->decoded.request_id); // cancel rebroadcast for this DM + } else if ((p->to != getNodeNum()) && (p->hop_limit > 0) && (getFrom(p) != getNodeNum())) { if (p->id != 0) { if (config.device.role != Config_DeviceConfig_Role_ClientMute) { MeshPacket *tosend = packetPool.allocCopy(*p); // keep a copy because we will be sending it diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index a23adfa7d..9a65823ec 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -16,7 +16,7 @@ ErrorCode ReliableRouter::send(MeshPacket *p) // If someone asks for acks on broadcast, we need the hop limit to be at least one, so that first node that receives our // message will rebroadcast. But asking for hop_limit 0 in that context means the client app has no preference on hop // counts and we want this message to get through the whole mesh, so use the default. - if (p->to == NODENUM_BROADCAST && p->hop_limit == 0) { + if (p->hop_limit == 0) { if (config.lora.hop_limit && config.lora.hop_limit <= HOP_MAX) { p->hop_limit = (config.lora.hop_limit >= HOP_MAX) ? HOP_MAX : config.lora.hop_limit; } else { @@ -34,7 +34,7 @@ ErrorCode ReliableRouter::send(MeshPacket *p) bool ReliableRouter::shouldFilterReceived(MeshPacket *p) { // Note: do not use getFrom() here, because we want to ignore messages sent from phone - if (p->to == NODENUM_BROADCAST && p->from == getNodeNum()) { + if (p->from == getNodeNum()) { printPacket("Rx someone rebroadcasting for us", p); // We are seeing someone rebroadcast one of our broadcast attempts. @@ -231,4 +231,4 @@ void ReliableRouter::setNextTx(PendingPacket *pending) DEBUG_MSG("Setting next retransmission in %u msecs: ", d); printPacket("", pending->packet); setReceivedMessage(); // Run ASAP, so we can figure out our correct sleep time -} \ No newline at end of file +} From 41f9541f95e26aa9316fb114148bb4f182d21419 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 1 Aug 2022 16:06:27 -0700 Subject: [PATCH 4/8] Update version.properties --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 3eb2c9ab4..e6f5a11df 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 1 minor = 3 -build = 27 +build = 28 From faac761dc003f14028e75936912cfd5c123d9591 Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 3 Aug 2022 04:23:32 +0800 Subject: [PATCH 5/8] 'station-g1' --- src/esp32/architecture.h | 2 ++ src/mesh/generated/mesh.pb.h | 4 +++- variants/station-g1/platformio.ini | 8 +++++++ variants/station-g1/variant.h | 36 ++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 variants/station-g1/platformio.ini create mode 100644 variants/station-g1/variant.h diff --git a/src/esp32/architecture.h b/src/esp32/architecture.h index dd9031d6d..9c4509359 100644 --- a/src/esp32/architecture.h +++ b/src/esp32/architecture.h @@ -70,6 +70,8 @@ #define HW_VENDOR HardwareModel_NANO_G1 #elif defined(M5STACK) #define HW_VENDOR HardwareModel_M5STACK +#elif defined(STATION_G1) + #define HW_VENDOR HardwareModel_STATION_G1 #endif // diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 37710ebc8..8c05cb319 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -70,7 +70,9 @@ typedef enum _HardwareModel { /* Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 */ HardwareModel_DR_DEV = 43, /* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ - HardwareModel_M5STACK = 44, + HardwareModel_M5STACK = 44, + /* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ + HardwareModel_STATION_G1 = 45, /* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */ HardwareModel_PRIVATE_HW = 255 } HardwareModel; diff --git a/variants/station-g1/platformio.ini b/variants/station-g1/platformio.ini new file mode 100644 index 000000000..a466414d0 --- /dev/null +++ b/variants/station-g1/platformio.ini @@ -0,0 +1,8 @@ +; The 1.0 release of the nano-g1 board +[env:station-g1] +extends = esp32_base +board = ttgo-t-beam +lib_deps = + ${esp32_base.lib_deps} +build_flags = + ${esp32_base.build_flags} -D STATION_G1 -I variants/station-g1 \ No newline at end of file diff --git a/variants/station-g1/variant.h b/variants/station-g1/variant.h new file mode 100644 index 000000000..c40bca743 --- /dev/null +++ b/variants/station-g1/variant.h @@ -0,0 +1,36 @@ +// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep + +#define I2C_SDA 21 +#define I2C_SCL 22 + +#define BUTTON_PIN 36 // The middle button GPIO on the Nano G1 +//#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_OUT 13 // Default pin to use for Ext Notify Module. + +// common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if +// not found then probe for SX1262 +#define USE_RF95 +#define USE_SX1262 + +#define LORA_DIO0 26 // a No connect on the SX1262 module +#define LORA_RESET 23 +#define LORA_DIO1 33 // SX1262 IRQ +#define LORA_DIO2 32 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB + +#ifdef USE_SX1262 +#define SX126X_CS RF95_NSS // FIXME - we really should define LORA_CS instead +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +//#define SX126X_E22 // Not really an E22 +// Internally the module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface +// code) +#endif + +#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage +#define BATTERY_SENSE_SAMPLES 30 //Set the number of samples, It has an effect of increasing sensitivity. +#define ADC_MULTIPLIER 2.15 + +// different screen +#define USE_SH1106 From 151321ac3c3993d2e57ebab33cf616346899adc0 Mon Sep 17 00:00:00 2001 From: caveman99 Date: Wed, 3 Aug 2022 08:09:05 +0000 Subject: [PATCH 6/8] [create-pull-request] automated change --- protobufs | 2 +- src/mesh/generated/mesh.pb.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/protobufs b/protobufs index 11d94c9b1..59293c211 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 11d94c9b15e9085b0f2516735ad816a3a35d5680 +Subproject commit 59293c211a7db32e76a0815f6dac43899eba16dd diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 37710ebc8..718fc52ef 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -71,6 +71,8 @@ typedef enum _HardwareModel { HardwareModel_DR_DEV = 43, /* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ HardwareModel_M5STACK = 44, + /* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ + HardwareModel_STATION_G1 = 45, /* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */ HardwareModel_PRIVATE_HW = 255 } HardwareModel; From 47da3b695a955999122f11af535117d7fe5e0c6b Mon Sep 17 00:00:00 2001 From: Neil Hao Date: Wed, 3 Aug 2022 16:13:21 +0800 Subject: [PATCH 7/8] Update mesh.pb.h --- src/mesh/generated/mesh.pb.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 8c05cb319..80048680c 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -71,8 +71,6 @@ typedef enum _HardwareModel { HardwareModel_DR_DEV = 43, /* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ HardwareModel_M5STACK = 44, - /* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ - HardwareModel_STATION_G1 = 45, /* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */ HardwareModel_PRIVATE_HW = 255 } HardwareModel; From 4ad2e58047afe7b21d50ba33ee918d2ae32dc34d Mon Sep 17 00:00:00 2001 From: Neil Hao Date: Wed, 3 Aug 2022 16:15:11 +0800 Subject: [PATCH 8/8] Update mesh.pb.h --- src/mesh/generated/mesh.pb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 80048680c..37710ebc8 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -70,7 +70,7 @@ typedef enum _HardwareModel { /* Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 */ HardwareModel_DR_DEV = 43, /* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ - HardwareModel_M5STACK = 44, + HardwareModel_M5STACK = 44, /* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */ HardwareModel_PRIVATE_HW = 255 } HardwareModel;