diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index c0caaa86b..bad04e9ec 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -38,6 +38,7 @@ jobs: - board: rak4631_eink - board: t-echo - board: nano-g1 + - board: station-g1 - board: m5stack-core - board: m5stack-coreink @@ -95,6 +96,7 @@ jobs: - board: tbeam0.7 - board: meshtastic-diy-v1 - board: nano-g1 + - board: station-g1 - board: m5stack-core - board: m5stack-coreink diff --git a/bin/build-all.sh b/bin/build-all.sh index 79486cda8..55c151da1 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -5,7 +5,7 @@ set -e VERSION=`bin/buildinfo.py long` SHORT_VERSION=`bin/buildinfo.py short` -BOARDS_ESP32="rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 nano-g1 m5stack-core m5stack-coreink" +BOARDS_ESP32="rak11200 tlora-v2 tlora-v1 tlora_v1_3 tlora-v2-1-1.6 tbeam heltec-v1 heltec-v2.0 heltec-v2.1 tbeam0.7 meshtastic-diy-v1 nano-g1 station-g1 m5stack-core m5stack-coreink" #BOARDS_ESP32=tbeam # FIXME note nrf52840dk build is for some reason only generating a BIN file but not a HEX file nrf52840dk-geeksville is fine 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/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/gps/GPS.cpp b/src/gps/GPS.cpp index b0a8164d0..f8bff1dfd 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -330,7 +330,7 @@ int32_t GPS::runOnce() if(devicestate.did_gps_reset && (millis() > 60000) && !hasFlow()) { DEBUG_MSG("GPS is not communicating, trying factory reset on next bootup.\n"); devicestate.did_gps_reset = false; - nodeDB.saveToDisk(); + nodeDB.saveDeviceStateToDisk(); } #endif } diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 63d67871e..cb4c625db 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -435,6 +435,16 @@ void NodeDB::saveChannelsToDisk() } } +void NodeDB::saveDeviceStateToDisk() +{ + if (!devicestate.no_save) { +#ifdef FSCom + FSCom.mkdir("/prefs"); +#endif + saveProto(prefFileName, DeviceState_size, sizeof(devicestate), DeviceState_fields, &devicestate); + } +} + void NodeDB::saveToDisk() { if (!devicestate.no_save) { diff --git a/src/mesh/NodeDB.h b/src/mesh/NodeDB.h index 0a2a5bdb7..a96fe22c2 100644 --- a/src/mesh/NodeDB.h +++ b/src/mesh/NodeDB.h @@ -44,7 +44,7 @@ class NodeDB void init(); /// write to flash - void saveToDisk(), saveChannelsToDisk(); + void saveToDisk(), saveChannelsToDisk(), saveDeviceStateToDisk(); /** Reinit radio config if needed, because either: * a) sometimes a buggy android app might send us bogus settings or 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; 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 diff --git a/version.properties b/version.properties index e6f5a11df..fdb24c552 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 1 minor = 3 -build = 28 +build = 29