test new boards and gps read update

This commit is contained in:
Ricardo Guzman (Richonguzman)
2026-03-25 12:03:00 -03:00
parent 7f8c2af86b
commit f9f8a9b957
8 changed files with 154 additions and 6 deletions

View File

@@ -68,8 +68,8 @@ ___________________________________________________________________*/
#endif
String versionDate = "2026-03-11";
String versionNumber = "3.2.107";
String versionDate = "2026-03-25";
String versionNumber = "3.2.3";
Configuration Config;
WiFiClient aprsIsClient;
WiFiClient mqttClient;

View File

@@ -46,7 +46,7 @@ Adafruit_INA219 ina219;
#ifdef HAS_ADC_CALIBRATION
#include <esp_adc_cal.h>
#if defined(TTGO_LORA32_V2_1) || defined(TTGO_LORA32_V2_1_915)
#if defined(TTGO_LORA32_V2_1) || defined(TTGO_LORA32_V2_1_GPS) || defined(TTGO_LORA32_V2_1_915) || defined(TTGO_LORA32_V2_1_915_GPS)
#define InternalBattery_ADC_Channel ADC1_CHANNEL_7 // t_lora32 pin35
#define ExternalVoltage_ADC_Channel ADC1_CHANNEL_6 // t_lora32 pin34
#endif

View File

@@ -80,6 +80,9 @@ bool Configuration::writeFile() {
data["beacon"]["statusPacket"] = beacon.statusPacket;
data["beacon"]["gpsActive"] = beacon.gpsActive;
#if !defined(HAS_GPS)
data["beacon"]["gpsActive"] = false;
#endif
data["beacon"]["ambiguityLevel"] = beacon.ambiguityLevel;
data["personalNote"] = personalNote;

View File

@@ -153,11 +153,18 @@ namespace Utils {
beaconUpdate = true;
}
bool configLocationIsValid = !(Config.beacon.latitude == 0.0 && Config.beacon.longitude == 0.0);
#ifdef HAS_GPS
if (Config.beacon.gpsActive && gps.location.lat() == 0.0 && gps.location.lng() == 0.0 && Config.beacon.latitude == 0.0 && Config.beacon.longitude == 0.0) {
GPS_Utils::getData();
if (Config.beacon.gpsActive) { // GPS activated
if (!gps.location.isValid()) {
GPS_Utils::getData(); // refresh GPS
beaconUpdate = false;
}
} else { // GPS not active: use saved data in Config
if (!configLocationIsValid) beaconUpdate = false;
}
#else // No GPS available: use saved data in Config
if (!configLocationIsValid) beaconUpdate = false;
#endif
if (beaconUpdate) {

View File

@@ -0,0 +1,58 @@
/* Copyright (C) 2025 Ricardo Guzman - CA2RXU
*
* This file is part of LoRa APRS iGate.
*
* LoRa APRS iGate is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LoRa APRS iGate is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LoRa APRS iGate. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef BOARD_PINOUT_H_
#define BOARD_PINOUT_H_
// LoRa Radio
#define HAS_SX1276
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_RST_PIN 14
#define RADIO_BUSY_PIN 26
#define RADIO_WAKEUP_PIN RADIO_BUSY_PIN
#define GPIO_WAKEUP_PIN GPIO_SEL_26
// I2C
#define USE_WIRE_WITH_OLED_PINS
// Display
#define HAS_DISPLAY
#undef OLED_SDA
#undef OLED_SCL
#undef OLED_RST
#define OLED_SDA 21
#define OLED_SCL 22
#define OLED_RST -1 // Reset pin # (or -1 if sharing Arduino reset pin)
// GPS
#define HAS_GPS
#define GPS_BAUDRATE 9600
#define GPS_RX 12
#define GPS_TX 34
// Aditional Config
#define INTERNAL_LED_PIN 25 // Green Led
#define BATTERY_PIN 35
#define HAS_ADC_CALIBRATION
#endif

View File

@@ -0,0 +1,11 @@
[env:ttgo-lora32-v21_915_GPS]
board = ttgo-lora32-v21
build_flags =
${common.build_flags}
-D RADIOLIB_EXCLUDE_LR11X0=1
-D RADIOLIB_EXCLUDE_SX126X=1
-D RADIOLIB_EXCLUDE_SX128X=1
-D TTGO_LORA32_V2_1_915_GPS
lib_deps =
${common.lib_deps}
${common.display_libs}

View File

@@ -0,0 +1,58 @@
/* Copyright (C) 2025 Ricardo Guzman - CA2RXU
*
* This file is part of LoRa APRS iGate.
*
* LoRa APRS iGate is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LoRa APRS iGate is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LoRa APRS iGate. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef BOARD_PINOUT_H_
#define BOARD_PINOUT_H_
// LoRa Radio
#define HAS_SX1278
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 19
#define RADIO_MOSI_PIN 27
#define RADIO_CS_PIN 18
#define RADIO_RST_PIN 14
#define RADIO_BUSY_PIN 26
#define RADIO_WAKEUP_PIN RADIO_BUSY_PIN
#define GPIO_WAKEUP_PIN GPIO_SEL_26
// I2C
#define USE_WIRE_WITH_OLED_PINS
// Display
#define HAS_DISPLAY
#undef OLED_SDA
#undef OLED_SCL
#undef OLED_RST
#define OLED_SDA 21
#define OLED_SCL 22
#define OLED_RST -1 // Reset pin # (or -1 if sharing Arduino reset pin)
// GPS
#define HAS_GPS
#define GPS_BAUDRATE 9600
#define GPS_RX 12
#define GPS_TX 34
// Aditional Config
#define INTERNAL_LED_PIN 25 // Green Led
#define BATTERY_PIN 35
#define HAS_ADC_CALIBRATION
#endif

View File

@@ -0,0 +1,11 @@
[env:ttgo-lora32-v21_GPS]
board = ttgo-lora32-v21
build_flags =
${common.build_flags}
-D RADIOLIB_EXCLUDE_LR11X0=1
-D RADIOLIB_EXCLUDE_SX126X=1
-D RADIOLIB_EXCLUDE_SX128X=1
-D TTGO_LORA32_V2_1_GPS
lib_deps =
${common.lib_deps}
${common.display_libs}