diff --git a/Boards.h b/Boards.h
index 3a41183..3afdd9f 100644
--- a/Boards.h
+++ b/Boards.h
@@ -12,6 +12,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+#define BOARD_MODEL BOARD_HELTEC_MESHP // MeshPocket board ID
#include "Interfaces.h"
#include "ROM.h"
@@ -118,6 +119,11 @@
#define MODEL_C7 0xC7 // Heltec Mesh Node T114, 863-928 MHz
#define MODEL_CB 0xCB // Heltec Mesh Node T114, 863-928 MHz + GPS
+ #define PRODUCT_HELTEC_MESHP 0xC3 // Heltec MeshPocket
+ #define BOARD_HELTEC_MESHP 0x46 // MeshPocket board ID
+ #define MODEL_C7 0xC7 // 863-928 MHz
+
+
#define PRODUCT_TECHO 0x15 // LilyGO T-Echo devices
#define BOARD_TECHO 0x44
#define MODEL_16 0x16 // T-Echo 433 MHz
@@ -216,7 +222,7 @@
#elif BOARD_MODEL == BOARD_TBEAM
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_PMU true
#define HAS_BLUETOOTH true
#define HAS_CONSOLE true
@@ -320,7 +326,7 @@
#elif BOARD_MODEL == BOARD_LORA32_V1_0
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_BLUETOOTH true
#define HAS_CONSOLE true
#define HAS_EEPROM true
@@ -363,7 +369,7 @@
#elif BOARD_MODEL == BOARD_LORA32_V2_0
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_BLUETOOTH true
#define HAS_CONSOLE true
#define HAS_EEPROM true
@@ -407,7 +413,7 @@
#elif BOARD_MODEL == BOARD_LORA32_V2_1
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_BLUETOOTH true
#define HAS_PMU true
#define HAS_NP true
@@ -480,7 +486,7 @@
#elif BOARD_MODEL == BOARD_HELTEC32_V2
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_BLUETOOTH true
#define HAS_CONSOLE true
#define HAS_EEPROM true
@@ -528,7 +534,7 @@
#elif BOARD_MODEL == BOARD_HELTEC32_V3
#define IS_ESP32S3 true
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_BLUETOOTH false
#define HAS_BLE true
#define HAS_PMU true
@@ -588,7 +594,7 @@
#define HAS_EEPROM true
#define HAS_INPUT true
#define HAS_SLEEP true
- #define DISPLAY EINK_BW
+ #define DISPLAY_TYPE EINK_BW
#define DISPLAY_SCALE_OVERRIDE true
#define DISPLAY_SCALE 1.90625
#define DISPLAY_MODEL GxEPD2_213_BN
@@ -640,7 +646,7 @@
#elif BOARD_MODEL == BOARD_RNODE_NG_20
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_BLUETOOTH true
#define HAS_NP true
#define HAS_CONSOLE true
@@ -688,7 +694,7 @@
#elif BOARD_MODEL == BOARD_RNODE_NG_21
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_BLUETOOTH true
#define HAS_CONSOLE true
#define HAS_PMU true
@@ -741,7 +747,7 @@
#elif BOARD_MODEL == BOARD_T3S3
#define IS_ESP32S3 true
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
#define HAS_CONSOLE true
#define HAS_BLUETOOTH false
#define HAS_BLE true
@@ -858,7 +864,7 @@
#elif BOARD_MODEL == BOARD_TDECK
#define IS_ESP32S3 true
#define HAS_DISPLAY false
- #define DISPLAY TFT // to be tested...
+ #define DISPLAY_TYPE TFT // to be tested...
#define HAS_CONSOLE false
#define HAS_BLUETOOTH false
#define HAS_BLE true
@@ -929,7 +935,7 @@
#define OCP_TUNED 0x38
#define HAS_DISPLAY true
- #define DISPLAY MONO_OLED
+ #define DISPLAY_TYPE MONO_OLED
#define HAS_CONSOLE true
#define HAS_BLUETOOTH false
#define HAS_BLE true
@@ -993,7 +999,7 @@
#elif BOARD_MODEL == BOARD_E22_ESP32
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
// currently there is only support for using one Bluetooth type,
// Bluetooth has been chosen over BLE as it is less experimental
#define HAS_BLUETOOTH true
@@ -1035,7 +1041,7 @@
#define IS_ESP32S3 true
#define HAS_DISPLAY true
- #define DISPLAY OLED
+ #define DISPLAY_TYPE OLED
//#define HAS_CONSOLE true
#define HAS_BLUETOOTH false
#define HAS_BLE true
@@ -1121,7 +1127,7 @@
#define HAS_EEPROM false
#define HAS_SD false
#define HAS_DISPLAY true
- #define DISPLAY EINK_BW
+ #define DISPLAY_TYPE EINK_BW
#define DISPLAY_MODEL GxEPD2_154_D67
#define BLE_MANUFACTURER "LilyGO"
#define BLE_MODEL "T-Echo"
@@ -1238,7 +1244,7 @@
};
#elif BOARD_VARIANT == MODEL_13 || BOARD_VARIANT == MODEL_14 || BOARD_VARIANT == MODEL_21
#define HAS_DISPLAY true
- #define DISPLAY EINK_BW
+ #define DISPLAY_TYPE EINK_BW
#define DISPLAY_SCALE_OVERRIDE true
#define DISPLAY_SCALE 1.90625
#define DISPLAY_MODEL GxEPD2_213_BN
@@ -1307,8 +1313,10 @@
#elif BOARD_MODEL == BOARD_HELTEC_T114
#define HAS_EEPROM false
+ #define EEPROM_SIZE 296 // RNode expects these even if HAS_EEPROM false
+ #define EEPROM_OFFSET EEPROM_SIZE-EEPROM_RESERVED
#define HAS_DISPLAY true
- #define DISPLAY TFT
+ #define DISPLAY_TYPE TFT
#define DISPLAY_SCALE_OVERRIDE true
#define DISPLAY_SCALE 2
#define HAS_BLUETOOTH false
@@ -1390,6 +1398,51 @@
#define PIN_GPS_RX 37
#define PIN_GPS_TX 39
#endif
+
+ #elif BOARD_MODEL == BOARD_HELTEC_MESHP
+ #define HAS_EEPROM false
+ #define EEPROM_SIZE 296 // RNode expects these even if HAS_EEPROM false
+ #define EEPROM_OFFSET EEPROM_SIZE-EEPROM_RESERVED
+ #undef HAS_DISPLAY // forget the default
+ #define HAS_DISPLAY true
+ #define DISPLAY_TYPE EINK_BW
+ #define DISPLAY_SCALE_OVERRIDE true
+ #define DISPLAY_SCALE 1.90 // tweak if font looks off
+ #define DISPLAY_MODEL GxEPD2_213_B73
+
+ const int pin_disp_cs = 12;
+ const int pin_disp_dc = 11;
+ const int pin_disp_reset = 10;
+ const int pin_disp_busy = 9;
+ const int pin_disp_en = 20; // gate Q1
+
+ #define INTERFACE_COUNT 1
+ const uint8_t interfaces[INTERFACE_COUNT] = {SX1262};
+ const bool interface_cfg[INTERFACE_COUNT][3]= {{false,true,true}};
+ const int8_t interface_pins[INTERFACE_COUNT][10] = {
+ /* SX1262 */ {24, 19, 22, 23, 17, 20, 25, -1, -1, -1 }
+ };
+
+ const int pin_led_rx = 35;
+ const int pin_led_tx = 35;
+ const int pin_btn_usr1 = 42;
+// -------------------------------------------------------------------------
+// MeshPocket – user LED is the green one on GPIO35 (LOW = off, HIGH = on)
+// -------------------------------------------------------------------------
+#ifndef LED_ON
+ #define LED_ON HIGH
+#endif
+#ifndef LED_OFF
+ #define LED_OFF LOW
+#endif
+inline void led_rx_on() { digitalWrite(pin_led_rx, LED_ON); }
+inline void led_rx_off() { digitalWrite(pin_led_rx, LED_OFF); }
+inline void led_tx_on() { digitalWrite(pin_led_tx, LED_ON); }
+inline void led_tx_off() { digitalWrite(pin_led_tx, LED_OFF); }
+inline void led_id_on() { } // MeshPocket has no separate “ID” LED
+inline void led_id_off() { }
+
+
#else
#error An unsupported nRF board was selected. Cannot compile RNode firmware.
#endif
diff --git a/Display.h b/Display.h
index 5fe4c0e..3686ff8 100644
--- a/Display.h
+++ b/Display.h
@@ -33,31 +33,31 @@ void busyCallback(const void* p) { display_callback(); }
#define DISPLAY_BLACK GxEPD_BLACK
#define DISPLAY_WHITE GxEPD_WHITE
-#elif DISPLAY == ADAFRUIT_TFT
+#elif DISPLAY_TYPE == ADAFRUIT_TFT
// t-deck
#include
#define DISPLAY_WHITE ST77XX_WHITE
#define DISPLAY_BLACK ST77XX_BLACK
-#elif DISPLAY == TFT
+#elif DISPLAY_TYPE == TFT
// t114
#include "src/display/ST7789.h"
#define DISPLAY_WHITE ST77XX_WHITE
#define DISPLAY_BLACK ST77XX_BLACK
#define COLOR565(r, g, b) (((r & 0xF8) << 8) | ((g & 0xFC) << 3) | ((b & 0xF8) >> 3))
-#elif DISPLAY == MONO_OLED
+#elif DISPLAY_TYPE == MONO_OLED
// tbeam_s
#include
#define DISPLAY_WHITE SH110X_WHITE
#define DISPLAY_BLACK SH110X_BLACK
#endif
-#if DISPLAY == EINK_BW
+#if DISPLAY_TYPE == EINK_BW
// use GxEPD2 because adafruit EPD support for partial refresh is bad
#include
#include
-#elif DISPLAY == EINK_3C
+#elif DISPLAY_TYPE == EINK_3C
#include
#include
#endif
diff --git a/Makefile b/Makefile
index 3a86441..44a0e9e 100644
--- a/Makefile
+++ b/Makefile
@@ -158,6 +158,11 @@ firmware-heltec_t114:
firmware-heltec_t114_gps:
arduino-cli compile --log --fqbn Heltec_nRF52:Heltec_nRF52:HT-n5262 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x3C\" \"-DBOARD_VARIANT=0xCB\""
+
+firmware-heltec_meshpocket:
+ arduino-cli compile --log --fqbn Heltec_nRF52:Heltec_nRF52:HT-n5262-e213 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x46\""
+
+
upload-tbeam:
arduino-cli upload -p $(or $(port), /dev/ttyACM0) --fqbn esp32:esp32:t-beam
@sleep 1
diff --git a/RNode_Firmware_CE.ino b/RNode_Firmware_CE.ino
index d02da4c..368d96b 100644
--- a/RNode_Firmware_CE.ino
+++ b/RNode_Firmware_CE.ino
@@ -16,6 +16,8 @@
#include
#include
#include "Utilities.h"
+#define BOARD_MODEL BOARD_HELTEC_MESHP // MeshPocket
+#include "Boards.h"
#if MCU_VARIANT == MCU_NRF52
#if BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
@@ -59,7 +61,13 @@
// INTERFACE_SPI is only required on NRF52 platforms, as the SPI pins are set in the class constructor and not by a setter method.
// Even if custom SPI interfaces are not needed, the array must exist to prevent compilation errors.
#define INTERFACE_SPI
-SPIClass interface_spi[1];
+// MeshPocket has only one radio → use SPIM0 and the pins you already defined
+SPIClass interface_spi[1] = {
+ SPIClass(NRF_SPIM0, // hardware block
+ interface_pins[0][3], // MISO → 23
+ interface_pins[0][1], // SCK → 19
+ interface_pins[0][2]) // MOSI → 22
+};
#endif
FIFOBuffer serialFIFO;
diff --git a/Radio.hpp b/Radio.hpp
index f798e92..d957586 100644
--- a/Radio.hpp
+++ b/Radio.hpp
@@ -60,8 +60,13 @@
#define RSSI_OFFSET 157
+#ifdef PHY_HEADER_LORA_SYMBOLS
+#undef PHY_HEADER_LORA_SYMBOLS
+#endif
#define PHY_HEADER_LORA_SYMBOLS 8
+
+
#define MODEM_TIMEOUT_MULT 1.5
// Status flags
@@ -98,7 +103,7 @@ public:
_csma_slot_ms(CSMA_SLOT_MIN_MS),
_preambleLength(LORA_PREAMBLE_SYMBOLS_MIN), _lora_symbol_time_ms(0.0),
_lora_preamble_time_ms(0), _lora_header_time_ms(0), _lora_symbol_rate(0.0), _lora_us_per_byte(0.0), _bitrate(0),
- _packet{0}, _onReceive(NULL), _txp(0), _ldro(false), _limit_rate(false), _interference_detected(false), _avoid_interference(true), _difs_ms(CSMA_SIFS_MS + 2 * _csma_slot_ms), _difs_wait_start(0), _cw_wait_start(0), _cw_wait_target(0), _cw_wait_passed(0), _csma_cw(-1), _cw_band(1), _cw_min(0), _cw_max(CSMA_CW_PER_BAND_WINDOWS), _noise_floor_sampled(false), _noise_floor_sample(0), _noise_floor_buffer({0}), _noise_floor(-292), _led_id_filter(0), _preamble_detected_at(0) {};
+ _packet{0}, _onReceive(NULL), _txp(0), _ldro(false), _limit_rate(false), _interference_detected(false), _avoid_interference(true), _difs_ms(CSMA_SIFS_MS + 2 * _csma_slot_ms), _difs_wait_start(0), _cw_wait_start(0), _cw_wait_target(0), _cw_wait_passed(0), _csma_cw(-1), _cw_band(1), _cw_min(0), _cw_max(CSMA_CW_PER_BAND_WINDOWS), _noise_floor_sampled(false), _noise_floor_sample(0), _noise_floor_buffer{0}, _noise_floor(-292), _led_id_filter(0), _preamble_detected_at(0) {};
virtual void reset() = 0;