diff --git a/platformio.ini b/platformio.ini index 4fa73a94..c91b9524 100644 --- a/platformio.ini +++ b/platformio.ini @@ -19,6 +19,7 @@ default_envs = tbeam ;default_envs = rak4631_5005 ;default_envs = rak4631_5005_eink ;default_envs = rak4631_19003 +;default_envs = nano-g1 ;default_envs = meshtastic-diy-v1 ;default_envs = meshtastic-diy-v1.1 @@ -157,4 +158,4 @@ extends = nrf52_base board = rak815 debug_tool = jlink upload_protocol = jlink -monitor_speed = 115200 \ No newline at end of file +monitor_speed = 115200 diff --git a/src/configuration.h b/src/configuration.h index 2597e2a7..d1b335ec 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -240,6 +240,10 @@ along with this program. If not, see . #define HW_VENDOR HardwareModel_T_ECHO +#elif defined(NANO_G1) + +#define HW_VENDOR HardwareModel_NANO_G1 + #elif NRF52_SERIES #define HW_VENDOR HardwareModel_NRF52_UNKNOWN diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index eadcfa32..653c36e2 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -61,6 +61,8 @@ typedef enum _HardwareModel { HardwareModel_DIY_V1 = 39, /* RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/ */ HardwareModel_RAK11200 = 40, + /* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */ + HardwareModel_NANO_G1 = 41, /* 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/nano-g1/platformio.ini b/variants/nano-g1/platformio.ini new file mode 100644 index 00000000..a3107423 --- /dev/null +++ b/variants/nano-g1/platformio.ini @@ -0,0 +1,8 @@ +; The 1.0 release of the nano-g1 board +[env:nano-g1] +extends = esp32_base +board = ttgo-t-beam +lib_deps = + ${esp32_base.lib_deps} +build_flags = + ${esp32_base.build_flags} -D NANO_G1 -I variants/nano-g1 \ No newline at end of file diff --git a/variants/nano-g1/variant.h b/variants/nano-g1/variant.h new file mode 100644 index 00000000..0915013a --- /dev/null +++ b/variants/nano-g1/variant.h @@ -0,0 +1,30 @@ +// #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 +