Heltec LoRa V3: "Starting LoRa failed!" error on sender code

Hello everyone,

I’m working with a Heltec WiFi LoRa 32 V3 board, and I’m trying to set up a basic LoRa sender. Despite following the initial setup instructions, I’m encountering the following issue: the display on my board shows “Starting LoRa failed!”.

Here’s the sender code I’m using:

#include <Arduino.h>
#include <heltec.h>

void setup() {
    Serial.begin(115200);
    delay(1000); // Wait for stabilization
    Serial.println("Initializing Heltec with LoRa...");

    // Initialize Heltec with Display and LoRa
    Heltec.begin(true /* Display */, true /* LoRa */, false /* BLE */);
    Serial.println("Heltec initialized, configuring LoRa pins...");

    // Manually configure LoRa module pins
    LoRa.setPins(8 /* CS */, 12 /* RST */, 14 /* DIO0 */);
    Serial.println("Pins set, initializing LoRa...");

    // Check if the LoRa module initialized correctly
    if (!LoRa.begin(868E6, true)) {
        Serial.println("Starting LoRa failed! Check power and antenna connection.");
        Heltec.display->clear();
        Heltec.display->drawString(0, 0, "Starting LoRa failed!");
        Heltec.display->display();
        while (1); // Stop here if initialization failed
    }

    Serial.println("LoRa Initialized Successfully!");
    Heltec.display->clear();
    Heltec.display->drawString(0, 0, "LoRa Sender Started!");
    Heltec.display->display();
}

void loop() {
    Serial.println("Sending packet...");

    // Send a test packet
    LoRa.beginPacket();
    LoRa.print("Hello, this is a test message from LoRa!");
    LoRa.endPacket();

    delay(2000); // Wait 2 seconds before the next packet
}

Here is my platformio.ini configuration:

[env:heltec_wifi_lora_32_V3]
platform = espressif32
board = heltec_wifi_lora_32_V3
framework = arduino
monitor_speed = 115200
lib_deps =
     heltecautomation/Heltec ESP32 Dev-Boards@^1.1.2
    Wire

I’ve double-checked the connections and antenna, but the initialization still fails with the message “Starting LoRa failed!”. Has anyone else encountered this issue with the Heltec LoRa V3, or is there something I might be missing in the code or setup?

Any insights or suggestions would be greatly appreciated!

Thanks in advance!

Cross post with