Просмотр исходного кода

Merge branch 'meshcore-dev:dev' into dev

Brad Ferguson 8 месяцев назад
Родитель
Сommit
2a33246c6f

+ 79 - 0
boards/keepteen_lt1.json

@@ -0,0 +1,79 @@
+{
+    "build": {
+      "arduino":{
+        "ldscript": "nrf52840_s140_v6.ld"
+      },
+      "core": "nRF5",
+      "cpu": "cortex-m4",
+      "extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
+      "f_cpu": "64000000L",
+      "hwids": [
+        [
+          "0x239A",
+          "0x00B3"
+        ],
+        [
+          "0x239A",
+          "0x8029"
+        ],
+        [
+          "0x239A",
+          "0x0029"
+        ],
+        [
+          "0x239A",
+          "0x002A"
+        ],
+        [
+          "0x239A",
+          "0x802A"
+        ]
+      ],
+      "usb_product": "Keepteen LT1",
+      "mcu": "nrf52840",
+      "variant": "Keepteen LT1",
+      "variants_dir": "variants",
+      "bsp": {
+        "name": "adafruit"
+      },
+      "softdevice": {
+        "sd_flags": "-DS140",
+        "sd_name": "s140",
+        "sd_version": "6.1.1",
+        "sd_fwid": "0x00B6"
+      },
+      "bootloader": {
+        "settings_addr": "0xFF000"
+      }
+    },
+    "connectivity": [
+      "bluetooth"
+    ],
+    "debug": {
+      "jlink_device": "nRF52840_xxAA",
+      "svd_path": "nrf52840.svd",
+      "openocd_target": "nrf52.cfg"
+    },
+    "frameworks": [
+      "arduino",
+      "zephyr"
+    ],
+    "name": "Keepteen LT1",
+    "upload": {
+      "maximum_ram_size": 248832,
+      "maximum_size": 815104,
+      "speed": 115200,
+      "protocol": "nrfutil",
+      "protocols": [
+        "jlink",
+        "nrfjprog",
+        "nrfutil",
+        "stlink"
+      ],
+      "use_1200bps_touch": true,
+      "require_upload_port": true,
+      "wait_for_upload_port": true
+    },
+    "url": "http://www.keepteen.com/",
+    "vendor": "Keepteen"
+  }

+ 1 - 1
examples/companion_radio/MyMesh.cpp

@@ -1128,7 +1128,7 @@ void MyMesh::handleCmdFrame(size_t len) {
     uint8_t sf = cmd_frame[i++];
     uint8_t cr = cmd_frame[i++];
 
-    if (freq >= 300000 && freq <= 2500000 && sf >= 7 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7000 &&
+    if (freq >= 300000 && freq <= 2500000 && sf >= 5 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7000 &&
         bw <= 500000) {
       _prefs.sf = sf;
       _prefs.cr = cr;

+ 4 - 0
examples/simple_repeater/MyMesh.cpp

@@ -710,6 +710,8 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
   _prefs.gps_enabled = 0;
   _prefs.gps_interval = 0;
   _prefs.advert_loc_policy = ADVERT_LOC_PREFS;
+
+  _prefs.adc_multiplier = 0.0f; // 0.0f means use default board multiplier
 }
 
 void MyMesh::begin(FILESYSTEM *fs) {
@@ -733,6 +735,8 @@ void MyMesh::begin(FILESYSTEM *fs) {
   updateAdvertTimer();
   updateFloodAdvertTimer();
 
+  board.setAdcMultiplier(_prefs.adc_multiplier);
+
 #if ENV_INCLUDE_GPS == 1
   applyGpsPrefs();
 #endif

+ 2 - 0
examples/simple_room_server/MyMesh.cpp

@@ -641,6 +641,8 @@ void MyMesh::begin(FILESYSTEM *fs) {
   updateAdvertTimer();
   updateFloodAdvertTimer();
 
+  board.setAdcMultiplier(_prefs.adc_multiplier);
+
 #if ENV_INCLUDE_GPS == 1
   applyGpsPrefs();
 #endif

+ 2 - 0
examples/simple_sensor/SensorMesh.cpp

@@ -740,6 +740,8 @@ void SensorMesh::begin(FILESYSTEM* fs) {
   updateAdvertTimer();
   updateFloodAdvertTimer();
 
+   board.setAdcMultiplier(_prefs.adc_multiplier);
+
 #if ENV_INCLUDE_GPS == 1
   applyGpsPrefs();
 #endif

+ 2 - 0
src/MeshCore.h

@@ -42,6 +42,8 @@ namespace mesh {
 class MainBoard {
 public:
   virtual uint16_t getBattMilliVolts() = 0;
+  virtual bool setAdcMultiplier(float multiplier) { return false; };
+  virtual float getAdcMultiplier() const { return 0.0f; }
   virtual const char* getManufacturerName() const = 0;
   virtual void onBeforeTransmit() { }
   virtual void onAfterTransmit() { }

+ 27 - 4
src/helpers/CommonCLI.cpp

@@ -70,7 +70,8 @@ void CommonCLI::loadPrefsInt(FILESYSTEM* fs, const char* filename) {
     file.read((uint8_t *)&_prefs->gps_interval, sizeof(_prefs->gps_interval));                     // 157
     file.read((uint8_t *)&_prefs->advert_loc_policy, sizeof (_prefs->advert_loc_policy));          // 161
     file.read((uint8_t *)&_prefs->discovery_mod_timestamp, sizeof(_prefs->discovery_mod_timestamp)); // 162
-    // 166
+    file.read((uint8_t *)&_prefs->adc_multiplier, sizeof(_prefs->adc_multiplier)); // 166
+    // 170
 
     // sanitise bad pref values
     _prefs->rx_delay_base = constrain(_prefs->rx_delay_base, 0, 20.0f);
@@ -83,6 +84,7 @@ void CommonCLI::loadPrefsInt(FILESYSTEM* fs, const char* filename) {
     _prefs->cr = constrain(_prefs->cr, 5, 8);
     _prefs->tx_power_dbm = constrain(_prefs->tx_power_dbm, 1, 30);
     _prefs->multi_acks = constrain(_prefs->multi_acks, 0, 1);
+    _prefs->adc_multiplier = constrain(_prefs->adc_multiplier, 0.0f, 10.0f);
 
     // sanitise bad bridge pref values
     _prefs->bridge_enabled = constrain(_prefs->bridge_enabled, 0, 1);
@@ -148,7 +150,8 @@ void CommonCLI::savePrefs(FILESYSTEM* fs) {
     file.write((uint8_t *)&_prefs->gps_interval, sizeof(_prefs->gps_interval));                     // 157
     file.write((uint8_t *)&_prefs->advert_loc_policy, sizeof(_prefs->advert_loc_policy));           // 161
     file.write((uint8_t *)&_prefs->discovery_mod_timestamp, sizeof(_prefs->discovery_mod_timestamp)); // 162
-    // 166
+    file.write((uint8_t *)&_prefs->adc_multiplier, sizeof(_prefs->adc_multiplier));                 // 166
+    // 170
 
     file.close();
   }
@@ -233,7 +236,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
       uint8_t sf  = num > 2 ? atoi(parts[2]) : 0;
       uint8_t cr  = num > 3 ? atoi(parts[3]) : 0;
       int temp_timeout_mins  = num > 4 ? atoi(parts[4]) : 0;
-      if (freq >= 300.0f && freq <= 2500.0f && sf >= 7 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7.0f && bw <= 500.0f && temp_timeout_mins > 0) {
+      if (freq >= 300.0f && freq <= 2500.0f && sf >= 5 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7.0f && bw <= 500.0f && temp_timeout_mins > 0) {
         _callbacks->applyTempRadioParams(freq, bw, sf, cr, temp_timeout_mins);
         sprintf(reply, "OK - temp params for %d mins", temp_timeout_mins);
       } else {
@@ -331,6 +334,13 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
       } else if (memcmp(config, "bridge.secret", 13) == 0) {
         sprintf(reply, "> %s", _prefs->bridge_secret);
 #endif
+      } else if (memcmp(config, "adc.multiplier", 14) == 0) {
+        float adc_mult = _board->getAdcMultiplier();
+        if (adc_mult == 0.0f) {
+          strcpy(reply, "Error: unsupported by this board");
+        } else {
+          sprintf(reply, "> %.3f", adc_mult);
+        }
       } else {
         sprintf(reply, "??: %s", config);
       }
@@ -411,7 +421,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
         float bw    = num > 1 ? atof(parts[1]) : 0.0f;
         uint8_t sf  = num > 2 ? atoi(parts[2]) : 0;
         uint8_t cr  = num > 3 ? atoi(parts[3]) : 0;
-        if (freq >= 300.0f && freq <= 2500.0f && sf >= 7 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7.0f && bw <= 500.0f) {
+        if (freq >= 300.0f && freq <= 2500.0f && sf >= 5 && sf <= 12 && cr >= 5 && cr <= 8 && bw >= 7.0f && bw <= 500.0f) {
           _prefs->sf = sf;
           _prefs->cr = cr;
           _prefs->freq = freq;
@@ -523,6 +533,19 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
         savePrefs();
         strcpy(reply, "OK");
 #endif
+      } else if (memcmp(config, "adc.multiplier ", 15) == 0) {
+        _prefs->adc_multiplier = atof(&config[15]);
+        if (_board->setAdcMultiplier(_prefs->adc_multiplier)) {
+          savePrefs();
+          if (_prefs->adc_multiplier == 0.0f) {
+            strcpy(reply, "OK - using default board multiplier");
+          } else {
+            sprintf(reply, "OK - multiplier set to %.3f", _prefs->adc_multiplier);
+          }
+        } else {
+          _prefs->adc_multiplier = 0.0f;
+          strcpy(reply, "Error: unsupported by this board");
+        };
       } else {
         sprintf(reply, "unknown config: %s", config);
       }

+ 1 - 0
src/helpers/CommonCLI.h

@@ -47,6 +47,7 @@ struct NodePrefs { // persisted to file
   uint32_t gps_interval; // in seconds
   uint8_t advert_loc_policy;
   uint32_t discovery_mod_timestamp;
+  float adc_multiplier;
 };
 
 class CommonCLICallbacks {

+ 24 - 24
src/helpers/sensors/EnvironmentSensorManager.cpp

@@ -178,6 +178,16 @@ bool EnvironmentSensorManager::begin() {
   }
   #endif
 
+  #if ENV_INCLUDE_BME680
+  if (BME680.begin(TELEM_BME680_ADDRESS, TELEM_WIRE)) {
+    MESH_DEBUG_PRINTLN("Found BME680 at address: %02X", TELEM_BME680_ADDRESS);
+    BME680_initialized = true;
+  } else {
+    BME680_initialized = false;
+    MESH_DEBUG_PRINTLN("BME680 was not found at I2C address %02X", TELEM_BME680_ADDRESS);
+  }
+  #endif
+
   #if ENV_INCLUDE_BME280
   if (BME280.begin(TELEM_BME280_ADDRESS, TELEM_WIRE)) {
     MESH_DEBUG_PRINTLN("Found BME280 at address: %02X", TELEM_BME280_ADDRESS);
@@ -301,16 +311,6 @@ bool EnvironmentSensorManager::begin() {
   }
   #endif
 
-  #if ENV_INCLUDE_BME680
-  if (BME680.begin(TELEM_BME680_ADDRESS, TELEM_WIRE)) {
-    MESH_DEBUG_PRINTLN("Found BME680 at address: %02X", TELEM_BME680_ADDRESS);
-    BME680_initialized = true;
-  } else {
-    BME680_initialized = false;
-    MESH_DEBUG_PRINTLN("BME680 was not found at I2C address %02X", TELEM_BME680_ADDRESS);
-  }
-  #endif
-
   #if ENV_INCLUDE_BMP085
   // First argument is  MODE (aka oversampling)
   // choose ULTRALOWPOWER
@@ -344,6 +344,19 @@ bool EnvironmentSensorManager::querySensors(uint8_t requester_permissions, Cayen
     }
     #endif
 
+    #if ENV_INCLUDE_BME680
+    if (BME680_initialized) {
+      if (BME680.performReading()) {
+        telemetry.addTemperature(TELEM_CHANNEL_SELF, BME680.temperature);
+        telemetry.addRelativeHumidity(TELEM_CHANNEL_SELF, BME680.humidity);
+        telemetry.addBarometricPressure(TELEM_CHANNEL_SELF, BME680.pressure / 100);
+        telemetry.addAltitude(TELEM_CHANNEL_SELF, 44330.0 * (1.0 - pow((BME680.pressure / 100) / TELEM_BME680_SEALEVELPRESSURE_HPA, 0.1903)));
+        telemetry.addAnalogInput(next_available_channel, BME680.gas_resistance);
+        next_available_channel++;
+      }
+    }
+    #endif
+
     #if ENV_INCLUDE_BME280
     if (BME280_initialized) {
       telemetry.addTemperature(TELEM_CHANNEL_SELF, BME280.readTemperature());
@@ -452,19 +465,6 @@ bool EnvironmentSensorManager::querySensors(uint8_t requester_permissions, Cayen
     }
     #endif
 
-    #if ENV_INCLUDE_BME680
-    if (BME680_initialized) {
-      if (BME680.performReading()) {
-        telemetry.addTemperature(TELEM_CHANNEL_SELF, BME680.temperature);
-        telemetry.addRelativeHumidity(TELEM_CHANNEL_SELF, BME680.humidity);
-        telemetry.addBarometricPressure(TELEM_CHANNEL_SELF, BME680.pressure / 100);
-        telemetry.addAltitude(TELEM_CHANNEL_SELF, 44330.0 * (1.0 - pow((BME680.pressure / 100) / TELEM_BME680_SEALEVELPRESSURE_HPA, 0.1903)));
-        telemetry.addAnalogInput(next_available_channel, BME680.gas_resistance);
-        next_available_channel++;
-      }
-    }
-    #endif
-
     #if ENV_INCLUDE_BMP085
     if (BMP085_initialized) {
         telemetry.addTemperature(TELEM_CHANNEL_SELF, BMP085.readTemperature());
@@ -563,7 +563,7 @@ void EnvironmentSensorManager::initBasicGPS() {
   gps_active = false; //Set GPS visibility off until setting is changed
 }
 
-// gps code for rak might be moved to MicroNMEALoactionProvider 
+// gps code for rak might be moved to MicroNMEALoactionProvider
 // or make a new location provider ...
 #ifdef RAK_WISBLOCK_GPS
 void EnvironmentSensorManager::rakGPSInit(){

+ 5 - 0
variants/heltec_t114/platformio.ini

@@ -29,6 +29,11 @@ build_flags = ${nrf52_base.build_flags}
   -D SX126X_RX_BOOSTED_GAIN=1
   -D DISPLAY_CLASS=NullDisplayDriver
   -D ST7789
+  -D PIN_GPS_RX=39
+  -D PIN_GPS_TX=37
+  -D PIN_GPS_EN=21
+  -D PIN_GPS_RESET=38
+  -D PIN_GPS_RESET_ACTIVE=LOW
 build_src_filter = ${nrf52_base.build_src_filter}
   +<helpers/*.cpp>
   +<../variants/heltec_t114>

+ 1 - 1
variants/heltec_t114/target.cpp

@@ -11,7 +11,7 @@ WRAPPER_CLASS radio_driver(radio, board);
 
 VolatileRTCClock fallback_clock;
 AutoDiscoverRTCClock rtc_clock(fallback_clock);
-MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
+MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock);
 T114SensorManager sensors = T114SensorManager(nmea);
 
 #ifdef DISPLAY_CLASS

+ 2 - 0
variants/heltec_t114/variant.h

@@ -117,6 +117,8 @@
 
 #define GPS_EN                  (21)
 #define GPS_RESET               (38)
+#define PIN_GPS_RX              (39)  // This is for bits going TOWARDS the GPS
+#define PIN_GPS_TX              (37)  // This is for bits going TOWARDS the CPU
 
 ////////////////////////////////////////////////////////////////////////////////
 // TFT

+ 75 - 0
variants/keepteen_lt1/KeepteenLT1Board.cpp

@@ -0,0 +1,75 @@
+#include <Arduino.h>
+#include "KeepteenLT1Board.h"
+
+#include <bluefruit.h>
+#include <Wire.h>
+
+static BLEDfu bledfu;
+
+void KeepteenLT1Board::begin() {    
+    // for future use, sub-classes SHOULD call this from their begin()
+    startup_reason = BD_STARTUP_NORMAL;
+    btn_prev_state = HIGH;
+  
+    pinMode(PIN_VBAT_READ, INPUT);
+
+    #if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL)
+      Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL);
+    #endif
+    
+    Wire.begin();
+}
+
+static void connect_callback(uint16_t conn_handle) {
+    (void)conn_handle;
+    MESH_DEBUG_PRINTLN("BLE client connected");
+}
+
+static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
+    (void)conn_handle;
+    (void)reason;
+    MESH_DEBUG_PRINTLN("BLE client disconnected");
+}
+
+bool KeepteenLT1Board::startOTAUpdate(const char* id, char reply[]) {
+  // Config the peripheral connection with maximum bandwidth
+  // more SRAM required by SoftDevice
+  // Note: All config***() function must be called before begin()
+  Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
+  Bluefruit.configPrphConn(92, BLE_GAP_EVENT_LENGTH_MIN, 16, 16);
+
+  Bluefruit.begin(1, 0);
+  // Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4
+  Bluefruit.setTxPower(4);
+  // Set the BLE device name
+  Bluefruit.setName("KeepteenLT1_OTA");
+
+  Bluefruit.Periph.setConnectCallback(connect_callback);
+  Bluefruit.Periph.setDisconnectCallback(disconnect_callback);
+
+  // To be consistent OTA DFU should be added first if it exists
+  bledfu.begin();
+
+  // Set up and start advertising
+  // Advertising packet
+  Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
+  Bluefruit.Advertising.addTxPower();
+  Bluefruit.Advertising.addName();
+
+  /* Start Advertising
+    - Enable auto advertising if disconnected
+    - Interval:  fast mode = 20 ms, slow mode = 152.5 ms
+    - Timeout for fast mode is 30 seconds
+    - Start(timeout) with timeout = 0 will advertise forever (until connected)
+
+    For recommended advertising interval
+    https://developer.apple.com/library/content/qa/qa1931/_index.html
+  */
+  Bluefruit.Advertising.restartOnDisconnect(true);
+  Bluefruit.Advertising.setInterval(32, 244); // in unit of 0.625 ms
+  Bluefruit.Advertising.setFastTimeout(30);   // number of seconds in fast mode
+  Bluefruit.Advertising.start(0);             // 0 = Don't stop advertising after n seconds
+
+  strcpy(reply, "OK - started");
+  return true;
+}

+ 51 - 0
variants/keepteen_lt1/KeepteenLT1Board.h

@@ -0,0 +1,51 @@
+#pragma once
+
+#include <MeshCore.h>
+#include <Arduino.h>
+
+class KeepteenLT1Board : public mesh::MainBoard {
+protected:
+  uint8_t startup_reason;
+  uint8_t btn_prev_state;
+
+public:
+  void begin();
+
+  uint8_t getStartupReason() const override { return startup_reason; }
+
+  #define BATTERY_SAMPLES 8
+
+  uint16_t getBattMilliVolts() override {
+    analogReadResolution(12);
+
+    uint32_t raw = 0;
+    for (int i = 0; i < BATTERY_SAMPLES; i++) {
+      raw += analogRead(PIN_VBAT_READ);
+    }
+    raw = raw / BATTERY_SAMPLES;
+    return (ADC_MULTIPLIER * raw);
+  }
+
+  const char* getManufacturerName() const override {
+    return "Keepteen LT1";
+  }
+
+#if defined(P_LORA_TX_LED)
+  void onBeforeTransmit() override {
+    digitalWrite(P_LORA_TX_LED, HIGH);   // turn TX LED on
+  }
+  void onAfterTransmit() override {
+    digitalWrite(P_LORA_TX_LED, LOW);   // turn TX LED off
+  }
+#endif
+
+  void reboot() override {
+    NVIC_SystemReset();
+  }
+  
+  void powerOff() override {
+    sd_power_system_off();
+  }
+
+  bool startOTAUpdate(const char* id, char reply[]) override;
+};

+ 101 - 0
variants/keepteen_lt1/platformio.ini

@@ -0,0 +1,101 @@
+[KeepteenLT1]
+extends = nrf52_base
+board = keepteen_lt1
+build_flags = ${nrf52_base.build_flags}
+  -I variants/keepteen_lt1
+  -D KEEPTEEN_LT1
+  -D RADIO_CLASS=CustomSX1262
+  -D WRAPPER_CLASS=CustomSX1262Wrapper
+  -D LORA_TX_POWER=22
+  -D SX126X_CURRENT_LIMIT=140
+  -D SX126X_RX_BOOSTED_GAIN=1
+  -D PIN_BOARD_SDA=34
+  -D PIN_BOARD_SCL=36
+  -D ENV_INCLUDE_GPS=1
+build_src_filter = ${nrf52_base.build_src_filter}
+  +<helpers/sensors>
+  +<../variants/keepteen_lt1>
+lib_deps= ${nrf52_base.lib_deps}
+	adafruit/Adafruit SSD1306 @ ^2.5.13
+  stevemarple/MicroNMEA @ ^2.0.6
+
+[env:KeepteenLT1_repeater]
+extends = KeepteenLT1
+build_src_filter = ${KeepteenLT1.build_src_filter}
+  +<../examples/simple_repeater>
+  +<helpers/ui/SSD1306Display.cpp>
+  +<helpers/ui/MomentaryButton.cpp>
+build_flags =
+  ${KeepteenLT1.build_flags}
+  -D ADVERT_NAME='"KeepteenLT1 Repeater"'
+  -D ADVERT_LAT=0.0
+  -D ADVERT_LON=0.0
+  -D ADMIN_PASSWORD='"password"'
+  -D MAX_NEIGHBOURS=50
+  -D DISPLAY_CLASS=SSD1306Display
+;  -D MESH_PACKET_LOGGING=1
+;  -D MESH_DEBUG=1
+lib_deps = ${KeepteenLT1.lib_deps}
+  adafruit/RTClib @ ^2.1.3
+
+[env:KeepteenLT1_room_server]
+extends = KeepteenLT1
+build_src_filter = ${KeepteenLT1.build_src_filter}
+  +<../examples/simple_room_server>
+  +<helpers/ui/SSD1306Display.cpp>
+  +<helpers/ui/MomentaryButton.cpp>
+build_flags = ${KeepteenLT1.build_flags}
+  -D ADVERT_NAME='"KeepteenLT1 Room"'
+  -D ADVERT_LAT=0.0
+  -D ADVERT_LON=0.0
+  -D ADMIN_PASSWORD='"password"'
+  -D ROOM_PASSWORD='"hello"'
+  -D DISPLAY_CLASS=SSD1306Display
+;  -D MESH_PACKET_LOGGING=1
+;  -D MESH_DEBUG=1
+lib_deps = ${KeepteenLT1.lib_deps}
+  adafruit/RTClib @ ^2.1.3
+
+[env:KeepteenLT1_companion_radio_usb]
+extends = KeepteenLT1
+board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
+board_upload.maximum_size = 712704
+build_flags = ${KeepteenLT1.build_flags}
+  -I examples/companion_radio/ui-new
+  -D MAX_CONTACTS=350
+  -D MAX_GROUP_CHANNELS=40
+  -D DISPLAY_CLASS=SSD1306Display
+; NOTE: DO NOT ENABLE -->  -D MESH_PACKET_LOGGING=1
+; NOTE: DO NOT ENABLE -->  -D MESH_DEBUG=1
+build_src_filter = ${KeepteenLT1.build_src_filter}
+  +<helpers/ui/SSD1306Display.cpp>
+  +<helpers/ui/MomentaryButton.cpp>
+  +<../examples/companion_radio/*.cpp>
+  +<../examples/companion_radio/ui-new/*.cpp>
+lib_deps = ${KeepteenLT1.lib_deps}
+  adafruit/RTClib @ ^2.1.3
+  densaugeo/base64 @ ~1.4.0
+
+[env:KeepteenLT1_companion_radio_ble]
+extends = KeepteenLT1
+board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
+board_upload.maximum_size = 712704
+build_flags = ${KeepteenLT1.build_flags}
+  -I examples/companion_radio/ui-new
+  -D MAX_CONTACTS=350
+  -D MAX_GROUP_CHANNELS=40
+  -D BLE_PIN_CODE=123456
+  -D BLE_DEBUG_LOGGING=1
+  -D OFFLINE_QUEUE_SIZE=256
+  -D DISPLAY_CLASS=SSD1306Display
+;  -D MESH_PACKET_LOGGING=1
+  -D MESH_DEBUG=1
+build_src_filter = ${KeepteenLT1.build_src_filter}
+  +<helpers/nrf52/SerialBLEInterface.cpp>
+  +<helpers/ui/SSD1306Display.cpp>
+  +<helpers/ui/MomentaryButton.cpp>
+  +<../examples/companion_radio/*.cpp>
+  +<../examples/companion_radio/ui-new/*.cpp>
+lib_deps = ${KeepteenLT1.lib_deps}
+  adafruit/RTClib @ ^2.1.3
+  densaugeo/base64 @ ~1.4.0

+ 51 - 0
variants/keepteen_lt1/target.cpp

@@ -0,0 +1,51 @@
+#include <Arduino.h>
+#include "target.h"
+#include <helpers/ArduinoHelpers.h>
+
+KeepteenLT1Board board;
+
+RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);
+
+WRAPPER_CLASS radio_driver(radio, board);
+
+VolatileRTCClock fallback_clock;
+AutoDiscoverRTCClock rtc_clock(fallback_clock);
+#if ENV_INCLUDE_GPS
+  #include <helpers/sensors/MicroNMEALocationProvider.h>
+  MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
+  EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
+#else
+  EnvironmentSensorManager sensors;
+#endif
+
+#ifdef DISPLAY_CLASS
+  DISPLAY_CLASS display;
+  MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true);
+#endif
+
+bool radio_init() {
+  rtc_clock.begin(Wire);
+  
+  return radio.std_init(&SPI);
+}
+
+uint32_t radio_get_rng_seed() {
+  return radio.random(0x7FFFFFFF);
+}
+
+void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) {
+  radio.setFrequency(freq);
+  radio.setSpreadingFactor(sf);
+  radio.setBandwidth(bw);
+  radio.setCodingRate(cr);
+}
+
+void radio_set_tx_power(uint8_t dbm) {
+  radio.setOutputPower(dbm);
+}
+
+mesh::LocalIdentity radio_new_identity() {
+  RadioNoiseListener rng(radio);
+  return mesh::LocalIdentity(&rng);  // create new random identity
+}
+

+ 30 - 0
variants/keepteen_lt1/target.h

@@ -0,0 +1,30 @@
+#pragma once
+
+#define RADIOLIB_STATIC_ONLY 1
+#include <RadioLib.h>
+#include <helpers/radiolib/RadioLibWrappers.h>
+#include <KeepteenLT1Board.h>
+#include <helpers/radiolib/CustomSX1262Wrapper.h>
+#include <helpers/AutoDiscoverRTCClock.h>
+#ifdef DISPLAY_CLASS
+  #include <helpers/ui/SSD1306Display.h>
+  #include <helpers/ui/MomentaryButton.h>
+#endif
+
+#include <helpers/sensors/EnvironmentSensorManager.h>
+
+extern KeepteenLT1Board board;
+extern WRAPPER_CLASS radio_driver;
+extern AutoDiscoverRTCClock rtc_clock;
+extern EnvironmentSensorManager sensors;
+
+#ifdef DISPLAY_CLASS
+  extern DISPLAY_CLASS display;
+  extern MomentaryButton user_btn;
+#endif
+
+bool radio_init();
+uint32_t radio_get_rng_seed();
+void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
+void radio_set_tx_power(uint8_t dbm);
+mesh::LocalIdentity radio_new_identity();

+ 22 - 0
variants/keepteen_lt1/variant.cpp

@@ -0,0 +1,22 @@
+#include "variant.h"
+#include "wiring_constants.h"
+#include "wiring_digital.h"
+
+const uint32_t g_ADigitalPinMap[] = {
+  0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+  14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+  27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+  40, 41, 42, 43, 44, 45, 46, 47
+};
+
+void initVariant()
+{
+    // set LED pin as output and set it low for off
+    pinMode(PIN_LED, OUTPUT);
+    digitalWrite(PIN_LED, LOW);
+
+    // set INPUT_PULLUP for user button
+    pinMode(PIN_USER_BTN, INPUT_PULLUP);
+    
+}
+

+ 74 - 0
variants/keepteen_lt1/variant.h

@@ -0,0 +1,74 @@
+#ifndef _KEEPTEEN_LT1_H_
+#define _KEEPTEEN_LT1_H_
+
+/** Master clock frequency */
+#define VARIANT_MCK             (64000000ul)
+#define USE_LFRC
+
+/*----------------------------------------------------------------------------
+ *        Headers
+ *----------------------------------------------------------------------------*/
+
+#include "WVariant.h"
+
+#define PINS_COUNT              (48)
+#define NUM_DIGITAL_PINS        (48)
+#define NUM_ANALOG_INPUTS       (1)
+#define NUM_ANALOG_OUTPUTS      (0)
+
+// LEDs
+#define PIN_LED                 (15) // Blue LED
+#define PIN_LED2                (13) // Maybe red power LED?
+#define LED_BLUE                (-1) // Disable annoying flashing caused by Bluefruit
+#define LED_BUILTIN             PIN_LED
+#define P_LORA_TX_LED           PIN_LED
+#define LED_STATE_ON            1
+
+// Buttons
+#define PIN_BUTTON1             (32) // Menu / User Button
+#define PIN_USER_BTN            PIN_BUTTON1
+
+// Analog pins
+#define PIN_VBAT_READ           (31)
+#define AREF_VOLTAGE            (3.6F)
+#define ADC_MULTIPLIER          (1.535F)
+#define ADC_RESOLUTION          (12)
+
+// Serial interfaces
+#define PIN_SERIAL1_RX          (22)
+#define PIN_SERIAL1_TX          (20)
+
+// SPI Interfaces
+#define SPI_INTERFACES_COUNT    (1)
+
+#define PIN_SPI_MISO            (2)
+#define PIN_SPI_MOSI            (38)
+#define PIN_SPI_SCK             (43)
+
+// Lora Pins
+#define  P_LORA_BUSY            (29)
+#define  P_LORA_MISO            PIN_SPI_MISO
+#define  P_LORA_MOSI            PIN_SPI_MOSI
+#define  P_LORA_NSS             (45)
+#define  P_LORA_SCLK            PIN_SPI_SCK
+#define  P_LORA_DIO_1           (10)
+#define  P_LORA_RESET           (9)
+#define  SX126X_RXEN            RADIOLIB_NC
+#define  SX126X_TXEN            RADIOLIB_NC
+#define  SX126X_DIO2_AS_RF_SWITCH true
+#define  SX126X_DIO3_TCXO_VOLTAGE (1.8f)
+
+// Wire Interfaces
+#define WIRE_INTERFACES_COUNT   (1)
+
+#define PIN_WIRE_SDA            (34)
+#define PIN_WIRE_SCL            (36)
+#define I2C_NO_RESCAN
+
+// GPS L76KB
+#define GPS_BAUDRATE            9600
+#define PIN_GPS_TX              PIN_SERIAL1_RX
+#define PIN_GPS_RX              PIN_SERIAL1_TX
+#define PIN_GPS_EN              (24)
+
+#endif // _KEEPTEEN_LT1_H_

+ 18 - 1
variants/promicro/PromicroBoard.h

@@ -23,6 +23,7 @@ class PromicroBoard : public mesh::MainBoard {
 protected:
   uint8_t startup_reason;
   uint8_t btn_prev_state;
+  float adc_mult = ADC_MULTIPLIER;
 
 public:
   void begin();
@@ -39,7 +40,23 @@ public:
       raw += analogRead(PIN_VBAT_READ);
     }
     raw = raw / BATTERY_SAMPLES;
-    return (ADC_MULTIPLIER * raw);
+    return (adc_mult * raw);
+  }
+
+  bool setAdcMultiplier(float multiplier) override {
+    if (multiplier == 0.0f) {
+      adc_mult = ADC_MULTIPLIER;}
+    else {
+      adc_mult = multiplier;
+    }
+    return true;
+  }
+  float getAdcMultiplier() const override {
+    if (adc_mult == 0.0f) {
+      return ADC_MULTIPLIER;
+    } else {
+      return adc_mult;
+    }
   }
 
   const char* getManufacturerName() const override {

+ 35 - 35
variants/promicro/platformio.ini

@@ -1,9 +1,9 @@
-[Faketec]
+[Promicro]
 extends = nrf52_base
 board = promicro_nrf52840
 build_flags = ${nrf52_base.build_flags}
   -I variants/promicro
-  -D FAKETEC
+  -D PROMICRO
   -D RADIO_CLASS=CustomSX1262
   -D WRAPPER_CLASS=CustomSX1262Wrapper
   -D LORA_TX_POWER=22
@@ -34,15 +34,15 @@ lib_deps= ${nrf52_base.lib_deps}
   adafruit/Adafruit BMP280 Library@^2.6.8
   stevemarple/MicroNMEA @ ^2.0.6
 
-[env:Faketec_repeater]
-extends = Faketec
-build_src_filter = ${Faketec.build_src_filter}
+[env:ProMicro_repeater]
+extends = Promicro
+build_src_filter = ${Promicro.build_src_filter}
   +<../examples/simple_repeater>
   +<helpers/ui/SSD1306Display.cpp>
   +<helpers/ui/MomentaryButton.cpp>
 build_flags =
-  ${Faketec.build_flags}
-  -D ADVERT_NAME='"Faketec Repeater"'
+  ${Promicro.build_flags}
+  -D ADVERT_NAME='"ProMicro Repeater"'
   -D ADVERT_LAT=0.0
   -D ADVERT_LON=0.0
   -D ADMIN_PASSWORD='"password"'
@@ -50,17 +50,17 @@ build_flags =
   -D DISPLAY_CLASS=SSD1306Display
 ;  -D MESH_PACKET_LOGGING=1
 ;  -D MESH_DEBUG=1
-lib_deps = ${Faketec.lib_deps}
+lib_deps = ${Promicro.lib_deps}
   adafruit/RTClib @ ^2.1.3
 
-[env:Faketec_room_server]
-extends = Faketec
-build_src_filter = ${Faketec.build_src_filter}
+[env:ProMicro_room_server]
+extends = Promicro
+build_src_filter = ${Promicro.build_src_filter}
   +<../examples/simple_room_server>
   +<helpers/ui/SSD1306Display.cpp>
   +<helpers/ui/MomentaryButton.cpp>
-build_flags = ${Faketec.build_flags}
-  -D ADVERT_NAME='"Faketec Room"'
+build_flags = ${Promicro.build_flags}
+  -D ADVERT_NAME='"ProMicro Room"'
   -D ADVERT_LAT=0.0
   -D ADVERT_LON=0.0
   -D ADMIN_PASSWORD='"password"'
@@ -68,47 +68,47 @@ build_flags = ${Faketec.build_flags}
   -D DISPLAY_CLASS=SSD1306Display
 ;  -D MESH_PACKET_LOGGING=1
 ;  -D MESH_DEBUG=1
-lib_deps = ${Faketec.lib_deps}
+lib_deps = ${Promicro.lib_deps}
   adafruit/RTClib @ ^2.1.3
 
-[env:Faketec_terminal_chat]
-extends = Faketec
-build_flags = ${Faketec.build_flags}
+[env:ProMicro_terminal_chat]
+extends = Promicro
+build_flags = ${Promicro.build_flags}
   -D MAX_CONTACTS=100
   -D MAX_GROUP_CHANNELS=1
 ;  -D MESH_PACKET_LOGGING=1
 ;  -D MESH_DEBUG=1
-build_src_filter = ${Faketec.build_src_filter}
+build_src_filter = ${Promicro.build_src_filter}
   +<../examples/simple_secure_chat/main.cpp>
-lib_deps = ${Faketec.lib_deps}
+lib_deps = ${Promicro.lib_deps}
   densaugeo/base64 @ ~1.4.0
   adafruit/RTClib @ ^2.1.3
 
-[env:Faketec_companion_radio_usb]
-extends = Faketec
+[env:ProMicro_companion_radio_usb]
+extends = Promicro
 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
 board_upload.maximum_size = 712704
-build_flags = ${Faketec.build_flags}
+build_flags = ${Promicro.build_flags}
   -I examples/companion_radio/ui-new
   -D MAX_CONTACTS=350
   -D MAX_GROUP_CHANNELS=40
   -D DISPLAY_CLASS=SSD1306Display
 ; NOTE: DO NOT ENABLE -->  -D MESH_PACKET_LOGGING=1
 ; NOTE: DO NOT ENABLE -->  -D MESH_DEBUG=1
-build_src_filter = ${Faketec.build_src_filter}
+build_src_filter = ${Promicro.build_src_filter}
   +<helpers/ui/SSD1306Display.cpp>
   +<helpers/ui/MomentaryButton.cpp>
   +<../examples/companion_radio/*.cpp>
   +<../examples/companion_radio/ui-new/*.cpp>
-lib_deps = ${Faketec.lib_deps}
+lib_deps = ${Promicro.lib_deps}
   adafruit/RTClib @ ^2.1.3
   densaugeo/base64 @ ~1.4.0
 
-[env:Faketec_companion_radio_ble]
-extends = Faketec
+[env:ProMicro_companion_radio_ble]
+extends = Promicro
 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
 board_upload.maximum_size = 712704
-build_flags = ${Faketec.build_flags}
+build_flags = ${Promicro.build_flags}
   -I examples/companion_radio/ui-new
   -D MAX_CONTACTS=350
   -D MAX_GROUP_CHANNELS=40
@@ -118,30 +118,30 @@ build_flags = ${Faketec.build_flags}
   -D DISPLAY_CLASS=SSD1306Display
 ;  -D MESH_PACKET_LOGGING=1
   -D MESH_DEBUG=1
-build_src_filter = ${Faketec.build_src_filter}
+build_src_filter = ${Promicro.build_src_filter}
   +<helpers/nrf52/SerialBLEInterface.cpp>
   +<helpers/ui/SSD1306Display.cpp>
   +<helpers/ui/MomentaryButton.cpp>
   +<../examples/companion_radio/*.cpp>
   +<../examples/companion_radio/ui-new/*.cpp>
-lib_deps = ${Faketec.lib_deps}
+lib_deps = ${Promicro.lib_deps}
   adafruit/RTClib @ ^2.1.3
   densaugeo/base64 @ ~1.4.0
 
-[env:Faketec_sensor]
-extends = Faketec
+[env:ProMicro_sensor]
+extends = Promicro
 build_flags =
-  ${Faketec.build_flags}
-  -D ADVERT_NAME='"Faketec Sensor"'
+  ${Promicro.build_flags}
+  -D ADVERT_NAME='"ProMicro Sensor"'
   -D ADVERT_LAT=0.0
   -D ADVERT_LON=0.0
   -D ADMIN_PASSWORD='"password"'
   -D DISPLAY_CLASS=SSD1306Display
 ;  -D MESH_PACKET_LOGGING=1
 ;  -D MESH_DEBUG=1
-build_src_filter = ${Faketec.build_src_filter}
+build_src_filter = ${Promicro.build_src_filter}
   +<helpers/ui/SSD1306Display.cpp>
   +<helpers/ui/MomentaryButton.cpp>
   +<../examples/simple_sensor>
 lib_deps =
-  ${Faketec.lib_deps}
+  ${Promicro.lib_deps}

+ 2 - 2
variants/rak4631/platformio.ini

@@ -9,8 +9,8 @@ build_flags = ${nrf52_base.build_flags}
   -D RAK_BOARD
   -D PIN_BOARD_SCL=14
   -D PIN_BOARD_SDA=13
-  -D PIN_GPS_TX=16
-  -D PIN_GPS_RX=15
+  -D PIN_GPS_TX=PIN_SERIAL1_RX
+  -D PIN_GPS_RX=PIN_SERIAL1_TX
   -D PIN_GPS_EN=-1
   -D PIN_OLED_RESET=-1
   -D RADIO_CLASS=CustomSX1262

+ 2 - 2
variants/station_g2/platformio.ini

@@ -21,8 +21,8 @@ build_flags =
   -D PIN_BOARD_SDA=5
   -D PIN_BOARD_SCL=6
   -D PIN_USER_BTN=38
-  -D PIN_GPS_RX=7
-  -D PIN_GPS_TX=15
+  -D PIN_GPS_RX=15
+  -D PIN_GPS_TX=7
   -D SX126X_DIO2_AS_RF_SWITCH=true
   -D SX126X_DIO3_TCXO_VOLTAGE=1.8
   -D SX126X_CURRENT_LIMIT=140

+ 1 - 1
variants/station_g2/target.cpp

@@ -17,7 +17,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock);
 
 #if ENV_INCLUDE_GPS
   #include <helpers/sensors/MicroNMEALocationProvider.h>
-  MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
+  MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock);
   EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
 #else
   EnvironmentSensorManager sensors;

+ 20 - 12
variants/thinknode_m2/ThinknodeM2Board.cpp

@@ -3,12 +3,13 @@
 
 
 void ThinknodeM2Board::begin() {
+    pinMode(PIN_VEXT_EN, OUTPUT); 
+    digitalWrite(PIN_VEXT_EN, !PIN_VEXT_EN_ACTIVE); // force power cycle
+    delay(20); // allow power rail to discharge
+    digitalWrite(PIN_VEXT_EN, PIN_VEXT_EN_ACTIVE); // turn backlight back on
+    delay(120); // give display time to bias on cold boot
     ESP32Board::begin();
-    pinMode(PIN_VEXT_EN, OUTPUT); // init display
-    digitalWrite(PIN_VEXT_EN, PIN_VEXT_EN_ACTIVE); // pin needs to be high
-    delay(10); 
-    digitalWrite(PIN_VEXT_EN, PIN_VEXT_EN_ACTIVE); // need to do this twice. do not know why..
-    pinMode(PIN_STATUS_LED, OUTPUT); // init power led    
+    pinMode(PIN_STATUS_LED, OUTPUT); // init power led
   }
 
   void ThinknodeM2Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) {
@@ -19,14 +20,21 @@ void ThinknodeM2Board::begin() {
     enterDeepSleep(0);
   }
 
-  uint16_t ThinknodeM2Board::getBattMilliVolts()  {
+ uint16_t ThinknodeM2Board::getBattMilliVolts() {
     analogReadResolution(12);
-    delay(10);
-    float volts = (analogRead(PIN_VBAT_READ) * ADC_MULTIPLIER * AREF_VOLTAGE) / 4096;
-    analogReadResolution(10);
-    return volts * 1000;
-  }
+    analogSetPinAttenuation(PIN_VBAT_READ, ADC_11db);
+
+    uint32_t mv = 0;
+      for (int i = 0; i < 8; ++i) {
+        mv += analogReadMilliVolts(PIN_VBAT_READ);
+        delayMicroseconds(200);
+      }
+    mv /= 8;
+
+    analogReadResolution(10);  
+    return static_cast<uint16_t>(mv * ADC_MULTIPLIER );
+}
 
   const char* ThinknodeM2Board::getManufacturerName() const {
     return "Elecrow ThinkNode M2";
-  }
+  }

+ 2 - 5
variants/thinknode_m2/variant.h

@@ -1,8 +1,8 @@
 #define I2C_SCL 15
 #define I2C_SDA 16
-#define  PIN_VBAT_READ    17
+#define PIN_VBAT_READ    17
 #define AREF_VOLTAGE            (3.0)
-#define ADC_MULTIPLIER (1.548F)
+#define ADC_MULTIPLIER (1.509F)
 #define PIN_BUZZER 5
 #define PIN_VEXT_EN_ACTIVE HIGH
 #define PIN_VEXT_EN 46
@@ -10,6 +10,3 @@
 #define PIN_LED 6
 #define PIN_STATUS_LED 6
 #define PIN_PWRBTN 4
-
-
-

+ 27 - 2
variants/xiao_s3_wio/platformio.ini

@@ -4,7 +4,9 @@ board = seeed_xiao_esp32s3
 board_check = true
 board_build.mcu = esp32s3
 build_flags = ${esp32_base.build_flags}
+  ${sensor_base.build_flags}
   -I variants/xiao_s3_wio
+  -UENV_INCLUDE_GPS
   -D SEEED_XIAO_S3
   -D P_LORA_DIO_1=39
   -D P_LORA_NSS=41
@@ -15,6 +17,8 @@ build_flags = ${esp32_base.build_flags}
   -D P_LORA_MOSI=9
   -D PIN_USER_BTN=21
   -D PIN_STATUS_LED=48
+  -D PIN_BOARD_SDA=D4
+  -D PIN_BOARD_SCL=D5
   -D SX126X_RXEN=38
   -D SX126X_TXEN=RADIOLIB_NC
   -D SX126X_DIO2_AS_RF_SWITCH=true
@@ -26,6 +30,10 @@ build_flags = ${esp32_base.build_flags}
   -D SX126X_RX_BOOSTED_GAIN=1
 build_src_filter = ${esp32_base.build_src_filter}
   +<../variants/xiao_s3_wio>
+  +<helpers/sensors>
+lib_deps =
+  ${esp32_base.lib_deps}
+  ${sensor_base.lib_deps}
 
 [env:Xiao_S3_WIO_repeater]
 extends = Xiao_S3_WIO
@@ -57,8 +65,9 @@ lib_deps =
 ;   -D ADMIN_PASSWORD='"password"'
 ;   -D MAX_NEIGHBOURS=50
 ;   -D WITH_RS232_BRIDGE=Serial2
-;   -D WITH_RS232_BRIDGE_RX=5
-;   -D WITH_RS232_BRIDGE_TX=6
+; RS232 bridge Pins have been relocated from 5,6 which is the i2c bus on xiao_s3
+;   -D WITH_RS232_BRIDGE_RX=3
+;   -D WITH_RS232_BRIDGE_TX=4
 ;  -D BRIDGE_DEBUG=1
 ; ;  -D MESH_PACKET_LOGGING=1
 ; ;  -D MESH_DEBUG=1
@@ -185,3 +194,19 @@ lib_deps =
   ${Xiao_S3_WIO.lib_deps}
   densaugeo/base64 @ ~1.4.0
   adafruit/Adafruit SSD1306 @ ^2.5.13
+
+[env:Xiao_S3_WIO_sensor]
+extends = Xiao_S3_WIO
+build_src_filter = ${Xiao_S3_WIO.build_src_filter}
+  +<../examples/simple_sensor>
+build_flags =
+  ${Xiao_S3_WIO.build_flags}
+  -D ADVERT_NAME='"XiaoS3 sensor"'
+  -D ADVERT_LAT=0.0
+  -D ADVERT_LON=0.0
+  -D ADMIN_PASSWORD='"password"'
+;  -D MESH_PACKET_LOGGING=1
+;  -D MESH_DEBUG=1
+lib_deps =
+  ${Xiao_S3_WIO.lib_deps}
+  ${esp32_ota.lib_deps}

+ 1 - 1
variants/xiao_s3_wio/target.cpp

@@ -14,7 +14,7 @@ WRAPPER_CLASS radio_driver(radio, board);
 
 ESP32RTCClock fallback_clock;
 AutoDiscoverRTCClock rtc_clock(fallback_clock);
-SensorManager sensors;
+EnvironmentSensorManager sensors;
 
 #ifdef DISPLAY_CLASS
   DISPLAY_CLASS display;

+ 2 - 2
variants/xiao_s3_wio/target.h

@@ -6,7 +6,7 @@
 #include <helpers/ESP32Board.h>
 #include <helpers/radiolib/CustomSX1262Wrapper.h>
 #include <helpers/AutoDiscoverRTCClock.h>
-#include <helpers/SensorManager.h>
+#include <helpers/sensors/EnvironmentSensorManager.h>
 #ifdef DISPLAY_CLASS
   #include <helpers/ui/SSD1306Display.h>
   #include <helpers/ui/MomentaryButton.h>
@@ -16,7 +16,7 @@
 extern XiaoS3WIOBoard board;
 extern WRAPPER_CLASS radio_driver;
 extern AutoDiscoverRTCClock rtc_clock;
-extern SensorManager sensors;
+extern EnvironmentSensorManager sensors;
 
 #ifdef DISPLAY_CLASS
   extern DISPLAY_CLASS display;