Skip to content

Commit 8507bf9

Browse files
authored
Merge pull request #233 from G4lile0/beta
beta to master sync
2 parents 5c4785b + 4498d78 commit 8507bf9

File tree

11 files changed

+365
-94
lines changed

11 files changed

+365
-94
lines changed

platformio.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,11 @@ upload_port = /dev/ttyUSB*
4444
platform = espressif32@ 6.5.0
4545
board = heltec_wifi_lora_32_V3
4646
board_build.mcu = esp32s3
47+
framework = arduino
48+
49+
[env:esp32c3]
50+
platform = espressif32@ 6.5.0
51+
board = seeed_xiao_esp32c3
52+
board_build.mcu = esp32c3
53+
board_build.f_cpu = 160000000L
4754
framework = arduino

tinyGS/src/ConfigManager/ConfigManager.cpp

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,37 @@ na SX1281 2.4–2.5Ghz 130 5.5 2000 0.476-202
4949

5050
ConfigManager::ConfigManager()
5151
: IotWebConf2(thingName, &dnsServer, &server, initialApPassword, configVersion), server(80), gsConfigHtmlFormatProvider(*this), boards({
52-
//OLED_add, OLED_SDA, OLED_SCL, OLED_RST, PROG_BUTTON, BOARD_LED, L_SX127X?, L_NSS, L_DI00, L_DI01, L_BUSSY, L_RST, L_MISO, L_MOSI, L_SCK, L_TCXO_V, RX_EN, TX_EN, BOARD
52+
//OLED_add, OLED_SDA, OLED_SCL, OLED_RST, PROG_BUTTON, BOARD_LED, L_SX127X?, L_NSS, L_DI00, L_DI01, L_BUSSY, L_RST, L_MISO, L_MOSI, L_SCK, L_TCXO_V, RX_EN, TX_EN, BOARD
5353
#if CONFIG_IDF_TARGET_ESP32S3
54-
{ 0x3c, 17, 18, 21, 0, 35, 6, 8, UNUSED, 14, 13, 12, 11, 10, 9, 1.6f, UNUSED, UNUSED, "150–960Mhz - HELTEC LORA32 V3 SX1262" }, // SX1262
55-
{ 0x3c, 17, 18, UNUSED, 0, 35, 1, 8, 6, 14, UNUSED, 12, 11, 10, 9, 0.0f, UNUSED, UNUSED, "Custom ESP32-S3 433MHz SX1278" }, // SX1278 @g4lile0
54+
{ 0x3c, 17, 18, 21, 0, 35, RADIO_SX1262, 8, UNUSED, 14, 13, 12, 11, 10, 9, 1.6f, UNUSED, UNUSED, "150–960Mhz - HELTEC LORA32 V3 SX1262" }, // SX1262
55+
{ 0x3c, 17, 18, UNUSED, 0, 35, RADIO_SX1278, 8, 6, 14, UNUSED, 12, 11, 10, 9, 0.0f, UNUSED, UNUSED, "Custom ESP32-S3 433MHz SX1278" }, // SX1278 @g4lile0
56+
#elif CONFIG_IDF_TARGET_ESP32C3
57+
{ 0x3c, 0, 1, UNUSED, 20, 21, RADIO_SX1262, 8, UNUSED, 3, 4, 5, 6, 7, 10, 1.6f, UNUSED, UNUSED, "433MHz HELTEC LORA32 HT-CT62 SX1262" }, // SX1262 @gargomoma
58+
{ 0x3c, 0, 1, UNUSED, 20, 21, RADIO_SX1278, 8, 4, UNUSED, UNUSED, 5, 6, 7, 10, 0.0f, UNUSED, UNUSED, "Custom ESP32-C3 433MHz SX1278" }, // SX1278 @gargomoma
5659
#else
57-
{ 0x3c, 4, 15, 16, 0, 25, 1, 18, 26, 12, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz HELTEC WiFi LoRA 32 V1" }, // SX1278 @4m1g0
58-
{ 0x3c, 4, 15, 16, 0, 25, 2, 18, 26, 12, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "863-928MHz HELTEC WiFi LoRA 32 V1" }, // SX1276
59-
{ 0x3c, 4, 15, 16, 0, 25, 1, 18, 26, 35, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz HELTEC WiFi LoRA 32 V2" }, // SX1278 @4m1g0
60-
{ 0x3c, 4, 15, 16, 0, 25, 2, 18, 26, 35, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "863-928MHz HELTEC WiFi LoRA 32 V2" }, // SX1276
61-
{ 0x3c, 4, 15, 16, 0, 2, 1, 18, 26, UNUSED, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433Mhz TTGO LoRa 32 v1" }, // SX1278 @g4lile0
62-
{ 0x3c, 4, 15, 16, 0, 2, 2, 18, 26, UNUSED, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz TTGO LoRa 32 v1" }, // SX1276
63-
{ 0x3c, 21, 22, UNUSED, 0, 22, 1, 18, 26, 33, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz TTGO LoRA 32 v2" }, // SX1278 @TCRobotics
64-
{ 0x3c, 21, 22, UNUSED, 0, 22, 2, 18, 26, 33, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz TTGO LoRA 32 v2" }, // SX1276
65-
{ 0x3c, 21, 22, UNUSED, 39, 22, 1, 18, 26, 33, 32, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz T-BEAM + OLED" }, // SX1278
66-
{ 0x3c, 21, 22, 16, 39, 22, 2, 18, 26, 33, 32, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz T-BEAM + OLED" }, // SX1276
67-
{ 0x3c, 21, 22, 16, 0, 25, 5, 5, UNUSED, 27, 26, 14, 19, 23, 18, 0.0f, UNUSED, UNUSED, "Custom ESP32 Wroom + SX126x (Crystal)" }, // SX1268 @4m1g0, @lillefyr
68-
{ 0x3c, 21, 22, UNUSED, 0, 25, 5, 18, UNUSED, 33, 32, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "TTGO LoRa 32 V2 Modified with module SX126x (crystal)" }, // SX1268 @TCRobotics
69-
{ 0x3c, 21, 22, 16, 0, 25, 5, 5, UNUSED, 2, 13, 26, 19, 23, 18, 1.6f, UNUSED, UNUSED, "Custom ESP32 Wroom + SX126x DRF1268T (TCX0) (5, 2, 26, 13)" }, // SX1268 @sdey76
70-
{ 0x3c, 21, 22, 16, 0, 25, 5, 5, UNUSED, 26, 12, 14, 19, 23, 18, 1.6f, UNUSED, UNUSED, "Custom ESP32 Wroom + SX126x DRF1268T (TCX0) (5, 26, 14, 12)" }, // SX1268 @imants
71-
{ 0x3c, 21, 22, UNUSED, 38, 22, 1, 18, 26, 33, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz T-BEAM V1.0 + OLED" }, // SX1278 @fafu
72-
{ 0x3c, 21, 22, 16, 0, 2, 5, 5, UNUSED, 34, 32, 14, 19, 27, 18, 1.6f, UNUSED, UNUSED, "433MHz FOSSA 1W Ground Station" }, // SX1268 @jgromes
73-
{ 0x3c, 21, 22, 16, 0, 2, 2, 5, UNUSED, 34, 32, 14, 19, 27, 18, 1.6f, UNUSED, UNUSED, "868-915MHz FOSSA 1W Ground Station" }, //SX1276 @jgromes
74-
{ 0x3c, 21, 22, UNUSED, 0, 22, 8, 5, 26, 34, 32, 14, 19, 27, 18, 0.0f, UNUSED, UNUSED, "2.4GHz ESP32 + SX1280" }, //SX1280 @g4lile0
75-
{ 0x3c, 21, 22, UNUSED, 38, 22, 2, 18, 26, 33, UNUSED , 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz T-BEAM V1.0 + OLED" }, // SX1276 @fafu
76-
{ 0x3c, 21, 22, UNUSED, 0, 25, 1, 18, 26, 33, UNUSED , 23, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz LILYGO T3_V1.6.1" }, // SX1278
77-
{ 0x3c, 21, 22, UNUSED, 0, 25, 2, 18, 26, 33, UNUSED , 23, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz LILYGO T3_V1.6.1" }, // SX1276
60+
{ 0x3c, 4, 15, 16, 0, 25, RADIO_SX1278, 18, 26, 12, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz HELTEC WiFi LoRA 32 V1" }, // SX1278 @4m1g0
61+
{ 0x3c, 4, 15, 16, 0, 25, RADIO_SX1276, 18, 26, 12, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "863-928MHz HELTEC WiFi LoRA 32 V1" }, // SX1276
62+
{ 0x3c, 4, 15, 16, 0, 25, RADIO_SX1278, 18, 26, 35, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz HELTEC WiFi LoRA 32 V2" }, // SX1278 @4m1g0
63+
{ 0x3c, 4, 15, 16, 0, 25, RADIO_SX1276, 18, 26, 35, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "863-928MHz HELTEC WiFi LoRA 32 V2" }, // SX1276
64+
{ 0x3c, 4, 15, 16, 0, 2, RADIO_SX1278, 18, 26, UNUSED, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433Mhz TTGO LoRa 32 v1" }, // SX1278 @g4lile0
65+
{ 0x3c, 4, 15, 16, 0, 2, RADIO_SX1276, 18, 26, UNUSED, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz TTGO LoRa 32 v1" }, // SX1276
66+
{ 0x3c, 21, 22, UNUSED, 0, 22, RADIO_SX1278, 18, 26, 33, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz TTGO LoRA 32 v2" }, // SX1278 @TCRobotics
67+
{ 0x3c, 21, 22, 16, 0, 22, RADIO_SX1276, 18, 26, 33, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz TTGO LoRA 32 v2" }, // SX1276
68+
{ 0x3c, 21, 22, 16, 39, 22, RADIO_SX1278, 18, 26, 33, 32, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz T-BEAM + OLED" }, // SX1278
69+
{ 0x3c, 21, 22, 16, 39, 22, RADIO_SX1276, 18, 26, 33, 32, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz T-BEAM + OLED" }, // SX1276
70+
{ 0x3c, 21, 22, 16, 0, 25, RADIO_SX1268, 5, UNUSED, 27, 26, 14, 19, 23, 18, 0.0f, UNUSED, UNUSED, "Custom ESP32 Wroom + SX126x (Crystal)" }, // SX1268 @4m1g0, @lillefyr
71+
{ 0x3c, 21, 22, UNUSED, 0, 25, RADIO_SX1268, 18, UNUSED, 33, 32, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "TTGO LoRa 32 V2 Modified with module SX126x (crystal)" }, // SX1268 @TCRobotics
72+
{ 0x3c, 21, 22, 16, 0, 25, RADIO_SX1268, 5, UNUSED, 2, 13, 26, 19, 23, 18, 1.6f, UNUSED, UNUSED, "Custom ESP32 Wroom + SX126x DRF1268T (TCX0) (5, 2, 26, 13)" }, // SX1268 @sdey76
73+
{ 0x3c, 21, 22, 16, 0, 25, RADIO_SX1268, 5, UNUSED, 26, 12, 14, 19, 23, 18, 1.6f, UNUSED, UNUSED, "Custom ESP32 Wroom + SX126x DRF1268T (TCX0) (5, 26, 14, 12)" }, // SX1268 @imants
74+
{ 0x3c, 21, 22, UNUSED, 38, 22, RADIO_SX1278, 18, 26, 33, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz T-BEAM V1.0 + OLED" }, // SX1278 @fafu
75+
{ 0x3c, 21, 22, 16, 0, 2, RADIO_SX1268, 5, UNUSED, 34, 32, 14, 19, 27, 18, 1.6f, UNUSED, UNUSED, "433MHz FOSSA 1W Ground Station" }, // SX1268 @jgromes
76+
{ 0x3c, 21, 22, 16, 0, 2, RADIO_SX1276, 5, UNUSED, 34, 32, 14, 19, 27, 18, 1.6f, UNUSED, UNUSED, "868-915MHz FOSSA 1W Ground Station" }, //SX1276 @jgromes
77+
{ 0x3c, 21, 22, UNUSED, 0, 22, RADIO_SX1280, 5, 26, 34, 32, 14, 19, 27, 18, 0.0f, UNUSED, UNUSED, "2.4GHz ESP32 + SX1280" }, //SX1280 @g4lile0
78+
{ 0x3c, 21, 22, UNUSED, 38, 22, RADIO_SX1276, 18, 26, 33, UNUSED, 14, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz T-BEAM V1.0 + OLED" }, // SX1276 @fafu
79+
{ 0x3c, 21, 22, UNUSED, 0, 25, RADIO_SX1278, 18, 26, 33, UNUSED, 23, 19, 27, 5, 0.0f, UNUSED, UNUSED, "433MHz LILYGO T3_V1.6.1" }, // SX1278
80+
{ 0x3c, 21, 22, UNUSED, 0, 25, RADIO_SX1276, 18, 26, 33, UNUSED, 23, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz LILYGO T3_V1.6.1" }, // SX1276
81+
{ 0x3c, 21, 22, UNUSED, 0, 25, RADIO_SX1276, 18, 26, UNUSED, 32, 23, 19, 27, 5, 0.0f, UNUSED, UNUSED, "868-915MHz LILYGO T3_V1.6.1 TCXO" }, // SX1262
82+
7883
#endif
7984
})
8085
{
@@ -562,41 +567,39 @@ void ConfigManager::boardDetection()
562567
Log::error(PSTR("Automatic board detection running... "));
563568

564569

565-
// If the cpu is a ESP32-PICO-D4 we know it is the Lilygo T3_v1.6.1
566-
// and we cant use GPIO16 to test for an OLED
570+
// If the cpu is a ESP32-PICO-D4 (Lilygo T3_v1.6.1) we have to avoid using pin GPIO16 as this is used for the FLASH_CS
567571
// https://github.com/mpmarks/tinyGS-newboards/commit/e520086f1b43c7cea4cb85d996f0fc379f2d2786
568572

569573
#if CONFIG_IDF_TARGET_ESP32S3
570574
// nothing yet
575+
#elif CONFIG_IDF_TARGET_ESP32C3
576+
// nothing yet
571577
#else
572-
if (strcmp(ESP.getChipModel(), "ESP32-PICO-D4")==0) {
573-
itoa(LILYGO_T3_V1_6_1_LF, board, 10);
574-
return;
575-
};
576-
#endif
577-
578-
for (uint8_t ite = 0; ite < ((sizeof(boards) / sizeof(boards[0]))); ite++)
579-
{
580-
Log::error(PSTR("%s \n"), boards[ite].BOARD);
581-
if (boards[ite].OLED__RST != UNUSED) {
582-
pinMode(boards[ite].OLED__RST, OUTPUT);
583-
digitalWrite(boards[ite].OLED__RST, LOW);
584-
delay(50);
585-
digitalWrite(boards[ite].OLED__RST, HIGH);
586-
}
587-
Wire.begin(boards[ite].OLED__SDA, boards[ite].OLED__SCL);
588-
Wire.beginTransmission(boards[ite].OLED__address);
589-
if (!Wire.endTransmission())
590-
{
591-
Log::error(PSTR("Compatible OLED FOUND"));
592-
itoa(ite, board, 10);
593-
return;
594-
}
595-
else
596-
{
597-
Log::error(PSTR("Not Compatible board found, please select it manually on the web config panel"));
598-
}
599-
}
578+
if (strcmp(ESP.getChipModel(), "ESP32-PICO-D4") != 0) {
579+
for (uint8_t ite = 0; ite < ((sizeof(boards) / sizeof(boards[0]))); ite++)
580+
{
581+
Log::error(PSTR("%s \n"), boards[ite].BOARD);
582+
if (boards[ite].OLED__RST != UNUSED) {
583+
pinMode(boards[ite].OLED__RST, OUTPUT);
584+
digitalWrite(boards[ite].OLED__RST, LOW);
585+
delay(25);
586+
digitalWrite(boards[ite].OLED__RST, HIGH);
587+
}
588+
Wire.begin(boards[ite].OLED__SDA, boards[ite].OLED__SCL);
589+
Wire.beginTransmission(boards[ite].OLED__address);
590+
if (!Wire.endTransmission())
591+
{
592+
Log::error(PSTR("Compatible OLED FOUND"));
593+
itoa(ite, board, 10);
594+
return;
595+
}
596+
else
597+
{
598+
Log::error(PSTR("Not Compatible board found, please select it manually on the web config panel"));
599+
}
600+
}
601+
};
602+
#endif
600603
}
601604

602605
void ConfigManager::printConfig()

tinyGS/src/ConfigManager/ConfigManager.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ enum boardNum
7070
#if CONFIG_IDF_TARGET_ESP32S3
7171
HELTEC_LORA32_V3 = 0,
7272
ESP32S3_SX1278_LF,
73+
#elif CONFIG_IDF_TARGET_ESP32C3
74+
HELTEC_LORA32_HTCT62 = 0,
75+
ESP32C3_SX1278_LF,
7376
#else
7477
HELTEC_V1_LF = 0,
7578
HELTEC_V1_HF,
@@ -92,6 +95,7 @@ enum boardNum
9295
TBEAM_OLED_v1_0_HF,
9396
LILYGO_T3_V1_6_1_LF,
9497
LILYGO_T3_V1_6_1_HF,
98+
LILYGO_T3_V1_6_1_HF_TCXO,
9599
#endif
96100
NUM_BOARDS //this line always has to be the last one
97101
};

tinyGS/src/ConfigManager/html.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ const char BOARD_NAMES[][BOARD_NAME_LENGTH] PROGMEM =
2929
#if CONFIG_IDF_TARGET_ESP32S3
3030
"433MHz HELTEC LORA32 V3",
3131
"Custom ESP32-S3 433MHz SX1278",
32+
#elif CONFIG_IDF_TARGET_ESP32C3
33+
"433MHz HELTEC LORA32 HT-CT62 SX1262",
34+
"Custom ESP32-C3 433MHz SX1278" ,
3235
#else
3336
"433MHz HELTEC WiFi LoRA 32 V1",
3437
"863-928MHz HELTEC WiFi LoRA 32 V1",
@@ -51,15 +54,18 @@ const char BOARD_NAMES[][BOARD_NAME_LENGTH] PROGMEM =
5154
"868-915MHzT-BEAM V1.0 + OLED",
5255
"433MHz LILYGO T3_V1.6.1",
5356
"868-915MHz LILYGO T3_V1.6.1" ,
57+
"868-915MHz LILYGO T3_V1.6.1 TCXO" ,
5458
#endif
5559
};
5660

5761
constexpr auto BOARD_LENGTH = 3;
5862

5963
#if CONFIG_IDF_TARGET_ESP32S3
6064
const char BOARD_VALUES[][BOARD_LENGTH] PROGMEM = {"0", "1" };
65+
#elif CONFIG_IDF_TARGET_ESP32C3
66+
const char BOARD_VALUES[][BOARD_LENGTH] PROGMEM = {"0", "1" };
6167
#else
62-
const char BOARD_VALUES[][BOARD_LENGTH] PROGMEM = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" };
68+
const char BOARD_VALUES[][BOARD_LENGTH] PROGMEM = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" , "21"};
6369
#endif
6470

6571
const char IOTWEBCONF_DASHBOARD_STYLE_INNER[] PROGMEM = "table{margin:20px auto;}h3{text-align:center;}.card{height:12em;margin:10px;text-align:left;font-family:Arial;border:3px groove;border-radius:0.3rem;display:inline-block;padding:10px;min-width:260px;}td{padding:0 10px;}textarea{resize:vertical;width:100%;margin:0;height:318px;padding:5px;overflow:auto;}#c1{width:98%;padding:5px;}#t1{width:98%}.console{display:inline-block;text-align:center;margin:10px 0;width:98%;max-width:1080px;}.G{color:green;}.R{color:red}";

tinyGS/src/Display/Display.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,20 @@ void displayInit()
6565
ui->setFrames(frames, frameCount);
6666
ui->setOverlays(overlays, overlaysCount);
6767

68+
#if CONFIG_IDF_TARGET_ESP32S3 // Heltec Lora 32 V3 patch to enable Vext that power OLED
69+
if (ConfigManager::getInstance().getBoard()== HELTEC_LORA32_V3 ) {
70+
pinMode (36, OUTPUT);
71+
digitalWrite(36, LOW);
72+
}
73+
#endif
74+
6875
if (board.OLED__RST != UNUSED) {
69-
pinMode(board.OLED__RST, OUTPUT);
70-
digitalWrite(board.OLED__RST, LOW);
71-
delay(50);
72-
digitalWrite(board.OLED__RST, HIGH);
76+
if (!((strcmp(ESP.getChipModel(), "ESP32-PICO-D4") == 0) && (board.OLED__RST == 16))) {
77+
pinMode(board.OLED__RST, OUTPUT);
78+
digitalWrite(board.OLED__RST, LOW);
79+
delay(50);
80+
digitalWrite(board.OLED__RST, HIGH);
81+
}
7382
}
7483

7584
/* ui init() also initialises the underlying display */

0 commit comments

Comments
 (0)