heltec v3 plus GPS added

This commit is contained in:
richonguzman 2024-01-04 21:56:17 -03:00
parent 4b2511bc3b
commit 92c7978b16
7 changed files with 42 additions and 24 deletions

View File

@ -52,10 +52,6 @@ build_flags =
${env.build_flags}
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
;-UARDUINO_USB_CDC_ON_BOOT
;-UARDUINO_USB_DFU_ON_BOOT
;-UARDUINO_USB_MSC_ON_BOOT
;-DCORE_DEBUG_LEVEL=0
[env:ttgo-t-beam-v1_2]
board = ttgo-t-beam
@ -97,4 +93,9 @@ build_flags = -Werror -Wall -DTTGO_T_Beam_V0_7
board = esp32-s3-devkitc-1
build_flags = ${esp32s3_base.build_flags}
-DTTGO_T_Beam_S3_SUPREME_V3
-DBOARD_HAS_PSRAM
-DBOARD_HAS_PSRAM
[env:heltec_V3_GPS]
board = heltec_wifi_kit_32_V3
build_flags = -DHELTEC_V3_GPS
board_build.mcu = esp32s3

View File

@ -27,7 +27,7 @@
Configuration Config;
HardwareSerial neo6m_gps(1);
TinyGPSPlus gps;
#ifndef TTGO_T_Beam_S3_SUPREME_V3
#if !defined(TTGO_T_Beam_S3_SUPREME_V3) && !defined(HELTEC_V3_GPS)
BluetoothSerial SerialBT;
#endif
#if defined(TTGO_T_Beam_V0_7) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
@ -142,7 +142,7 @@ void setup() {
if (Config.bluetoothType==0) {
BLE_Utils::setup();
} else {
#ifndef TTGO_T_Beam_S3_SUPREME_V3
#if !defined(TTGO_T_Beam_S3_SUPREME_V3) && !defined(HELTEC_V3_GPS)
BLUETOOTH_Utils::setup();
#endif
}
@ -193,7 +193,7 @@ void loop() {
if (Config.bluetoothType==0) {
BLE_Utils::sendToLoRa();
} else {
#ifndef TTGO_T_Beam_S3_SUPREME_V3
#if !defined(TTGO_T_Beam_S3_SUPREME_V3) && !defined(HELTEC_V3_GPS)
BLUETOOTH_Utils::sendToLoRa();
#endif
}

View File

@ -12,6 +12,9 @@
#if defined(TTGO_T_Beam_S3_SUPREME_V3)
#undef ssd1306
#endif
#if defined(HELTEC_V3_GPS)
#define OLED_DISPLAY_HAS_RST_PIN
#endif
#ifdef ssd1306
#include <Adafruit_SSD1306.h>

View File

@ -16,7 +16,7 @@ SX1268 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUS
bool transmissionFlag = true;
bool enableInterrupt = true;
#endif
#if defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
#if defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
bool transmissionFlag = true;
bool enableInterrupt = true;
@ -25,13 +25,13 @@ bool enableInterrupt = true;
namespace LoRa_Utils {
void setFlag(void) {
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
transmissionFlag = true;
#endif
}
void setup() {
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "LoRa", "Set SPI pins!");
SPI.begin(RADIO_SCLK_PIN, RADIO_MISO_PIN, RADIO_MOSI_PIN);
float freq = (float)Config.loramodule.frequency/1000000;
@ -46,7 +46,7 @@ namespace LoRa_Utils {
radio.setSpreadingFactor(Config.loramodule.spreadingFactor);
radio.setBandwidth(Config.loramodule.signalBandwidth);
radio.setCodingRate(Config.loramodule.codingRate4);
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
state = radio.setOutputPower(Config.loramodule.power + 2); // values available: 10, 17, 22 --> if 20 in tracker_conf.json it will be updated to 22.
#endif
#ifdef ESP32_DIY_1W_LoRa_GPS
@ -99,7 +99,7 @@ namespace LoRa_Utils {
if (Config.notification.buzzerActive && Config.notification.txBeep) {
NOTIFICATION_Utils::beaconTxBeep();
}
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
int state = radio.transmit("\x3c\xff\x01" + newPacket);
if (state == RADIOLIB_ERR_NONE) {
//Serial.println(F("success!"));
@ -146,7 +146,7 @@ namespace LoRa_Utils {
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "LoRa Rx", "---> %s", packet.c_str());
}
#endif
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
#if defined(TTGO_T_Beam_V1_0_SX1268) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3) || defined(HELTEC_V3_GPS)
if (transmissionFlag) {
transmissionFlag = false;
radio.startReceive();

View File

@ -169,7 +169,7 @@ namespace MSG_Utils {
if (Config.bluetoothType==0) {
BLE_Utils::sendToPhone(packet.text.substring(3));
} else {
#ifndef TTGO_T_Beam_S3_SUPREME_V3
#if !defined(TTGO_T_Beam_S3_SUPREME_V3) && !defined(HELTEC_V3_GPS)
BLUETOOTH_Utils::sendPacket(packet.text.substring(3));
#endif
}

View File

@ -5,7 +5,7 @@
#undef OLED_SCL
#undef OLED_RST
#ifndef TTGO_T_Beam_S3_SUPREME_V3
#if !defined(TTGO_T_Beam_S3_SUPREME_V3) && !defined(HELTEC_V3_GPS)
#define OLED_SDA 21
#define OLED_SCL 22
#define OLED_RST 16
@ -67,17 +67,13 @@
#define BUTTON_PIN -1
#endif
#if defined(TTGO_T_Beam_S3_SUPREME_V3)
#define OLED_SDA 17
#define OLED_SCL 18
#define OLED_RST 16
#define GPS_RX 8
#define GPS_TX 9
#define BUTTON_PIN 0
#define RADIO_SCLK_PIN 12
#define RADIO_MISO_PIN 13
#define RADIO_MOSI_PIN 11
@ -86,7 +82,22 @@
#define RADIO_RST_PIN 5
#define RADIO_DIO1_PIN 1
#define RADIO_BUSY_PIN 4
#endif
#if defined(HELTEC_V3_GPS)
#define OLED_SDA 17
#define OLED_SCL 18
#define OLED_RST 21
#define GPS_RX 19
#define GPS_TX 20
#define BUTTON_PIN 0
#define RADIO_SCLK_PIN 9
#define RADIO_MISO_PIN 11
#define RADIO_MOSI_PIN 10
#define RADIO_CS_PIN 8
#define RADIO_RST_PIN 12
#define RADIO_DIO1_PIN 14
#define RADIO_BUSY_PIN 13
#endif

View File

@ -49,6 +49,9 @@ namespace POWER_Utils {
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
return PMU.getBattVoltage() / 1000.0;
#endif
#if defined(HELTEC_V3_GPS)
return 0; // Add measurement later
#endif
}
String getBatteryInfoVoltage() {
@ -76,7 +79,7 @@ namespace POWER_Utils {
}
bool isCharging() {
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS)
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS)
return 0;
#endif
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_2_SX1262) || defined(TTGO_T_Beam_S3_SUPREME_V3)
@ -93,7 +96,7 @@ namespace POWER_Utils {
}
double getBatteryChargeDischargeCurrent() {
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS)
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS)
return 0;
#endif
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)
@ -108,7 +111,7 @@ namespace POWER_Utils {
}
bool isBatteryConnected() {
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS)
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS)
if(getBatteryVoltage() > 1.0) {
return true;
} else {
@ -207,7 +210,7 @@ namespace POWER_Utils {
}
bool begin(TwoWire &port) {
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS)
#if defined(TTGO_T_Beam_V0_7) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(HELTEC_V3_GPS)
return true; // nor powerManagment chip for this boards (only a few measure battery voltage).
#endif
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268)