added support for Heltec Lora32v2
This commit is contained in:
parent
e635d5757f
commit
179c93f96a
|
|
@ -8,9 +8,11 @@
|
||||||
; Please visit documentation for the other options and examples
|
; Please visit documentation for the other options and examples
|
||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
[env:ttgo-lora32-v21]
|
[platformio]
|
||||||
|
default_envs = ttgo-lora32-v21
|
||||||
|
|
||||||
|
[env]
|
||||||
platform = espressif32 @ 6.3.1
|
platform = espressif32 @ 6.3.1
|
||||||
board = ttgo-lora32-v21
|
|
||||||
framework = arduino
|
framework = arduino
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
lib_deps =
|
lib_deps =
|
||||||
|
|
@ -24,4 +26,12 @@ lib_deps =
|
||||||
mikalhart/TinyGPSPlus @ 1.0.3
|
mikalhart/TinyGPSPlus @ 1.0.3
|
||||||
adafruit/Adafruit Unified Sensor@^1.1.9
|
adafruit/Adafruit Unified Sensor@^1.1.9
|
||||||
adafruit/Adafruit BME280 Library@^2.2.2
|
adafruit/Adafruit BME280 Library@^2.2.2
|
||||||
adafruit/Adafruit BMP280 Library@^2.6.8
|
adafruit/Adafruit BMP280 Library@^2.6.8
|
||||||
|
|
||||||
|
[env:ttgo-lora32-v21]
|
||||||
|
board = ttgo-lora32-v21
|
||||||
|
build_flags = -Werror -Wall -DTTGO_T_LORA_V2_1
|
||||||
|
|
||||||
|
[env:heltec-lora32-v2]
|
||||||
|
board = ttgo-lora32-v21
|
||||||
|
build_flags = -Werror -Wall -DHELTEC_V2
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
Configuration Config;
|
Configuration Config;
|
||||||
WiFiClient espClient;
|
WiFiClient espClient;
|
||||||
|
|
||||||
String versionDate = "2023.11.26";
|
String versionDate = "2023.12.03";
|
||||||
int myWiFiAPIndex = 0;
|
int myWiFiAPIndex = 0;
|
||||||
int myWiFiAPSize = Config.wifiAPs.size();
|
int myWiFiAPSize = Config.wifiAPs.size();
|
||||||
WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex];
|
WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex];
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,6 @@
|
||||||
#define SCREEN_WIDTH 128 // OLED display width, in pixels
|
#define SCREEN_WIDTH 128 // OLED display width, in pixels
|
||||||
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
|
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
|
||||||
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
|
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
|
||||||
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
|
|
||||||
/*change to
|
|
||||||
#define OLED_RESET 16
|
|
||||||
for HELTEC_WIFI_LORA_32_V2 screen to work
|
|
||||||
*/
|
|
||||||
|
|
||||||
void setup_display();
|
void setup_display();
|
||||||
void display_toggle(bool toggle);
|
void display_toggle(bool toggle);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
#undef OLED_SDA
|
||||||
|
#undef OLED_SCL
|
||||||
|
#undef OLED_RST
|
||||||
|
|
||||||
#define LORA_SCK 5 // GPIO5 - SX1276 SCK
|
#define LORA_SCK 5 // GPIO5 - SX1276 SCK
|
||||||
#define LORA_MISO 19 // GPIO19 - SX1276 MISO
|
#define LORA_MISO 19 // GPIO19 - SX1276 MISO
|
||||||
#define LORA_MOSI 27 // GPIO27 - SX1276 MOSI
|
#define LORA_MOSI 27 // GPIO27 - SX1276 MOSI
|
||||||
|
|
@ -10,8 +14,17 @@
|
||||||
#define LORA_RST 23 // GPIO14 - SX1276 RST
|
#define LORA_RST 23 // GPIO14 - SX1276 RST
|
||||||
#define LORA_IRQ 26 // GPIO26 - SX1276 IRQ ---->DIO0
|
#define LORA_IRQ 26 // GPIO26 - SX1276 IRQ ---->DIO0
|
||||||
|
|
||||||
#define OLED_SDA 21 // change to "4" in Heltec WiFi Lora 32 V2
|
#ifdef TTGO_T_LORA_V2_1
|
||||||
#define OLED_SCL 22 // change to "15" in Heltec WiFi Lora 32 V2
|
#define OLED_SDA 21
|
||||||
|
#define OLED_SCL 22
|
||||||
|
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HELTEC_V2
|
||||||
|
#define OLED_SDA 4
|
||||||
|
#define OLED_SCL 15
|
||||||
|
#define OLED_RESET 16
|
||||||
|
#endif
|
||||||
|
|
||||||
#define greenLed 25 // Green Led
|
#define greenLed 25 // Green Led
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ void checkWiFi() {
|
||||||
|
|
||||||
void startWiFi() {
|
void startWiFi() {
|
||||||
int wifiCounter = 0;
|
int wifiCounter = 0;
|
||||||
int status = WL_IDLE_STATUS;
|
|
||||||
if (stationMode!=6) {
|
if (stationMode!=6) {
|
||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
WiFi.disconnect();
|
WiFi.disconnect();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue