Skip to main content

Heltec ESP32 Series Quick Start

This article describes the installation of the Heltec ESP32 series development framework and library.

Summary

Heltec's Arduino-based ESP32 development environment consists of two parts:

  • Heltec ESP32 Development Framework: Fully adapted from the official Espressif library, it includes board definitions, core functionalities, and examples for the ESP32 (such as Wi-Fi, Bluetooth, and external drivers etc.).

  • Heltec Extended Example Library: This library depends on the aforementioned ESP32 Development Framework**. It includes examples for LoRa/LoRaWAN, display demonstrations, GPS, sensors, and factory test programs for Heltec products etc..

warning

Framework v3.0.0 and Library v2.0.0 are updated together, Older frameworks and libraries are no longer applicable to the new ones.

tip

You can also use the official Espressif Arduino framework as a replacement for the Heltec ESP32 Development Framework. Just ensure that the corresponding version is compatible.

Preparation

Hardware

tip

Some cables only charge and do not transfer data, so you need to avoid this when uploading code.

Software

There are three methods to install the development framework, choose one of they:

  1. Open Arduino IDE, and click File->Peferences.

  1. Input the last ESP32 package URL: https://resource.heltec.cn/download/package_heltec_esp32_index.json

  1. Click on the Boards Manager icon on the left side, and enter "heltec esp32" in the search box that pops up, then select the latest version and click INSTALL .

  1. Install Heltec Esp32 Extended library
    Click on the Library Manager icon on the left side, search for "HELTEC ESP32", select the latest version and install

Programming

Once you have the framework and libraries installed, connect your computer to the board and start programming nodes.

Example

  1. Connect your node to the computer with a USB cable.

  2. Open Arduino IDE, Correctly select a board and relevant options in the Tools menu:

  1. Then select an example.

  1. To execute the code in a library, you need to mouse over, scroll down, find the library, and find the code in it.

  1. Compile & Upload

tip

If you cannot upload the code, please manually enter the BOOTLOADER mode: hold down the PRG (USER/BOOT) key and do not release it, press the RST key once, and then release the PRG (USER/BOOT).

New program

Open Arduino IDE, create a new .ino file, then copy the below code.

#include <heltec.h>

// the setup routine runs once when starts up
void setup(){

// Initialize the Heltec ESP32 object
Heltec.begin(true /*DisplayEnable Enable*/, true /*LoRa Disable*/, true /*Serial Enable*/, true /*PABOOST Enable*/, 470E6 /**/);
}

// the loop routine runs over and over again forever
void loop() {

}

compile it and upload, the screen (if this board has a screen) will show and Arduino's serial monitor will print something, it means Heltec ESP32 board is running successfully!