Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [Unreleased]

### Added
- **Heltec WiFi LoRa 32 V3 support** - ESP32-S3 with 128x64 OLED, LoRa SX1262

# Changelog

All notable changes to SparkMiner will be documented in this file.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Find your board below and download the matching firmware from [Releases](https:/
| **Wemos/Lolin S3 Mini** | `esp32-s3-mini_firmware.bin` | RGB LED status indicator |
| **WeAct S3 Mini** | `esp32-s3-mini_firmware.bin` | Compatible with Lolin |
| **ESP32-S3 + SSD1306 OLED** | `esp32-s3-oled_firmware.bin` | 128x64 I2C OLED |
| **Heltec WiFi LoRa 32 V3** | `heltec-wifi-lora32-v3_firmware.bin` | ESP32-S3, 128x64 OLED, LoRa SX1262 |

### ESP32-C3 Boards

Expand Down Expand Up @@ -179,6 +180,7 @@ Find your board below and download the matching firmware from [Releases](https:/
| Wemos Lolin32 + OLED | ✅ Full | 128x64 SSD1306 I2C (SDA=GPIO5, SCL=GPIO4, RST=GPIO16, addr=0x3C) |
| ESP32-S3/C3 Mini | ✅ Full | RGB LED status |
| ESP32 Headless | ✅ Full | GPIO LED status indicator |
| Heltec WiFi LoRa 32 V3 | ✅ Full | ESP32-S3, 128x64 OLED, LoRa SX1262 |
| LILYGO T-Display S3 | ❌ None | Not yet supported |
| LILYGO T-Display V1 | ❌ None | Not yet supported |
| ESP32-S2 boards | ❌ None | Single-core not supported |
Expand Down
9 changes: 9 additions & 0 deletions devtool.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,15 @@ description = "Wemos Lolin32 with SSD1306 OLED (SDA=GPIO5, SCL=GPIO4, RST=GPIO16
needs_boot_mode = false
group = "OLED Display"

[boards.heltec-wifi-lora32-v3]
name = "Heltec WiFi LoRa 32 V3"
env = "heltec-wifi-lora32-v3"
chip = "esp32s3"
description = "Heltec WiFi LoRa 32 V3: ESP32-S3, 128x64 OLED (I2C), LoRa SX1262, no PSRAM (~280 H/s)"
needs_boot_mode = true
port_changes_on_reset = true
group = "OLED Display"

# ============================================================
# Release Settings
# ============================================================
Expand Down
30 changes: 30 additions & 0 deletions include/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,36 @@
// SHA Implementation: classic ESP32 hardware SHA peripheral
// Defined in platformio.ini via -D USE_HARDWARE_SHA=1

// Heltec WiFi LoRa 32 V3 - ESP32-S3, 128x64 OLED (I2C), LoRa SX1262
// ============================================================
#elif defined(HELTEC_V3)
#define BOARD_NAME "Heltec WiFi LoRa 32 V3"

// Use OLED display (not TFT)
#define USE_DISPLAY 0
#define USE_OLED_DISPLAY 1

// OLED configuration (128x64 SSD1306 I2C)
#define OLED_WIDTH 128
#define OLED_HEIGHT 64
#define OLED_SDA_PIN 17
#define OLED_SCL_PIN 18
#define OLED_I2C_ADDR 0x3C
#define OLED_RST_PIN 21

// Display power enable (Vext)
#define VEXT_PIN 36

// Onboard LED
#define LED_PIN 35

// Buttons
#define BUTTON_PIN 0 // BOOT
#define USER_BUTTON_PIN 14
#define BUTTON_ACTIVE_LOW 1

// SHA Implementation: Defined in platformio.ini (USE_HARDWARE_SHA=1)

// ============================================================
// Default - Generic ESP32
// ============================================================
Expand Down
43 changes: 43 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,49 @@ lib_ignore =
SD_MMC
FastLED

; ============================================================
; Heltec WiFi LoRa 32 V3 - ESP32-S3, 128x64 OLED (I2C), LoRa SX1262
; Compatible with SparkMiner (SSD1306, U8g2, no PSRAM)
; ============================================================
[env:heltec-wifi-lora32-v3]
board = heltec_wifi_lora_32_V3
board_build.partitions = default_8MB.csv
board_build.mcu = esp32s3
board_build.f_cpu = 240000000L
upload_speed = 921600

build_unflags = -Os

build_flags =
-D HELTEC_V3=1
-D USE_HARDWARE_SHA=1
-D USE_DISPLAY=0
-D USE_OLED_DISPLAY=1
-D OLED_WIDTH=128
-D OLED_HEIGHT=64
-D OLED_SDA_PIN=17
-D OLED_SCL_PIN=18
-D OLED_I2C_ADDR=0x3C
-D OLED_RST_PIN=21
-D VEXT_PIN=36
-D LED_PIN=35
-D BUTTON_PIN=0
-D USER_BUTTON_PIN=14
-O3
-funroll-loops
;-D DEBUG_MINING=1

lib_deps =
${env.lib_deps}
olikraus/U8g2@^2.35.9

lib_ignore =
TFT_eSPI
OpenFontRender
SD
SD_MMC
FastLED

; ============================================================
; ESP32-S3 Headless - No display, serial only
; Dual-core with monochrome display and LoRa
Expand Down
22 changes: 20 additions & 2 deletions src/display/display_oled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,25 @@ static void drawStatsScreen(const display_data_t *data) {
void oled_display_init(uint8_t rotation, uint8_t brightness) {
Serial.printf("[OLED] Initializing %dx%d display\n", OLED_WIDTH, OLED_HEIGHT);

// Initialize I2C with custom pins

#ifdef HELTEC_V3
Serial.println("HELTEC: Enabling Vext (GPIO36 LOW)");
pinMode(VEXT_PIN, OUTPUT);
digitalWrite(VEXT_PIN, LOW); // Vext ON (active low)
delay(50);

Serial.println("HELTEC: Resetting OLED (GPIO21)");
pinMode(OLED_RST_PIN, OUTPUT);
digitalWrite(OLED_RST_PIN, LOW);
delay(20);
digitalWrite(OLED_RST_PIN, HIGH);
delay(20);

Serial.println("HELTEC: Starting I2C (17,18)");
#endif
Wire.begin(OLED_SDA_PIN, OLED_SCL_PIN);

// Initialize U8g2
Serial.println("Initializing SSD1306 OLED with U8g2 library");
s_u8g2.begin();

// Set rotation
Expand All @@ -237,6 +252,9 @@ void oled_display_init(uint8_t rotation, uint8_t brightness) {
// Show boot screen
oled_display_show_boot();

pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW); // Off by default

Serial.println("[OLED] Display initialized");
}

Expand Down
Loading