Display offline after running sample

ESP32 Lora V3 WiFi+BLE Development Board 0.96inch OLED Display ESP32-S3 Dual-core SX1262 Type-C Lora Kit for Arduino

After running what I thought to be an innocuous code sample at the bottom of
https://docs.heltec.org/en/node/esp32/esp32_general_docs/quick_start.html via Arduino IDE
my ESP32 board’s display no longer works.

It outputs via serial when I reboot it, but appears to be bricked.
17:02:41.394 -> ESP-ROM:esp32s3-20210327
17:02:41.394 -> Build:Mar 27 2021
17:02:41.394 -> rst:0x1 (POWERON),boot:0x18 (SPI_FAST_FLASH_BOOT)
17:02:41.394 -> SPIWP:0xee
17:02:41.394 -> mode:DIO, clock div:1
17:02:41.394 -> load:0x3fce3808,len:0x43c
17:02:41.394 -> load:0x403c9700,len:0xbec
17:02:41.394 -> load:0x403cc700,len:0x2a3c
17:02:41.394 -> SHA-256 comparison failed:
17:02:41.394 -> Calculated: dcde8d8a4817d9bf5d5d69a7247667264e4e10ac7493514868b61f5aa6146539
17:02:41.440 -> Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
17:02:41.440 -> Attempting to boot anyway…
17:02:41.440 -> entry 0x403c98d8
17:02:41.527 -> Serial initial done
17:02:41.565 -> Board does not have an on board display, Display option must be FALSE!!!
17:02:41.565 -> Board does not have LoRa function, LoRa option must be FALSE!!!

New to this.
Please advise.

You’re probably using the wrong software. Perhaps start by reading the following (and associated links):

Thanks.

The only complete example shown there is over a year old.

To be clear, at this point my goal is to restore the board to its factory default. So I will need to find an updated board manager and library somewhere.

My Arduino IDE is 2.3.2.

It shouldn’t matter how old the example is if it’s for the V3 board, but if you have the correct Heltec support software loaded (anything 0.0.7 or later should be fine in this regard), and the correct board chosen (WiFi LoRa 32(V3) / Wireless shell(V3) / Wireless stick lite (V3)), the factory test software that is initially loaded on the board can be found [in the Arduino IDE] at Examples > Heltec-Example > Factory_Test > WiFi_LoRa_32_V3_FactoryTest.

Good to know.

I have “Heltec ESP32 Series Dev-boards” 1.0.0 installed, along with “esp32” by Espressif Systems, and I have “WiFi LoRa 32(V3) / Wireless shell(V3) / Wireless stick lite (V3)” chosen as the board. For clarity, this is what I have been working with since I started.

For good measure, I uploaded
Examples > Heltec-Example > Factory_Test > WiFi_LoRa_32_V3_FactoryTest
and it seems to have restored the ESP32 to its OOTB behavior, displaying all the WiFi networks it can see. However, I am seeing the following serial output:
“07:33:34.477 -> Please provide a correct license! For more information:”

I have the Chip ID and have gotten the license strings (4 hex strings) from https://resource.heltec.cn/search, but I have not determined if/how it should be activated/uploaded. Searching for “activate license” at http://community.heltec.cn/ yields other people asking the same thing and a couple of ambiguous references to issuing the command “AT+CDKEY=” with no result.

Also, in WiFi_LoRa_32_V3_FactoryTest.ino, I changed
#define RF_FREQUENCY 868000000 //Hz
to
#define RF_FREQUENCY 915000000 //Hz
since I am in the US.

The frequency shouldn’t make any difference to anything at this point, as long as any modules you want to communicate are using the same frequency.

I’ve just reloaded the factory test sketch to a new V3 board, using either the 868 or 915 frequencies, and I don’t see any message about a license. My understanding was that the license is only required when using LoRaWAN (which is not the case in the factory test sketch) so I can’t answer that question, as I don’t use LoRAWAN. From what I’ve seen in other posts, however, this is only a ‘requirement’ when using the Heltec LoRaWan_APP library for LoRaWAN applications and there seems to be a growing number of people suggesting that you consider using an alternate library, specifically the RadioLib library—I’m sure that one of them will chime in when they read this.

2 Likes

:eyes:
(these characters are just here because of the minimum 20 character post limit)

The purpose of the ESP32 for me is to run Meshtastic, which I believe just uses peer-to-peer and not LoRaWAN. So I guess my only concern with regard to the endlessly-scrolling license message in the Serial Monitor is making it stop. I did notice "#include “LoRaWan_APP.h” is near the top of WiFi_LoRa_32_V3_FactoryTest.ino.

To provide some context, the only reason I was making changes in the first place was to connect my HiLetgo GY-NEO6MV2 GPS. I have the physical connections (pwr, serial) made but was trying to enable the serial connection with the GPS on pins 45, 46 by using the TinyGPSPlus .ino as demonstrated here: https://youtu.be/tQZC4GlYhMc. This resulted in many errors and would not compile. So I would definitely be up for an alternative method for enabling this communication.

The appearance of the license message is curious. Not using LoRaWAN, I’ve never seen it, so I’m at a bit of a loss there. Using the LoRaWan_APP library doesn’t necessarily mean that the LoRaWAN stuff is used—there used to be a LoRa_APP library, which I used to use and which I always assumed was just the LoRa subset of the LoRaWAN library. But the LoRa_APP library hasn’t appeared in recent releases of the Heltec software so I guess they figured it was just unnecessary maintenance overhead. The problem there, from my perspective, is that a user who has no intention of using any of the LoRaWAN extensions, by including the entire library, can unintentionally invoke something on the LoRaWAN side of things that can subsequently produce errors or warnings (maybe like your license message) that would never have occurred if the LoRaWAN stuff wasn’t there in the first place.

In any case, since your original post suggests that you didn’t have the correct Heltec support software loaded in the first place, you could try using TinyGPS again. I have used this software, admittedly on a CubeCell Plus module, but using the [LoRa part of the] LoRaWan_APP library nonetheless, without any problem.

Otherwise, just search these forums for “RadioLib” for a bit of guidance on that front. I don’t recall seeing anyone talk about using that simply for LoRa, but I’m sure @bns would be happy to provide help if you need it on that front.

1 Like

If the end goal is to run Meshtastic, maybe it’s an idea to just go get their build environment set up and see if it works for you? It also uses RadioLib so you’re not going to have to deal with the Heltec LoRa library stuff.

Their discord server is very active too if you run into any issues.

2 Likes

I got rid of the license message by running AT+CDKEY=<4 raw hex values concatenated>.

I am running the exact same software I was when I made my original post, so the issue with running TinyGPS remains. I will have to delve into that further.

I have installed Meshtastic a couple of times. I cannot get it to recognize the GPS either.

It does strike me, though, that because I am trying to enable 2 pins on a Heltec ESP32 V3 I would need to be using the Heltec-specific libraries to make changes. Perhaps I am misunderstanding how this works.

Also, it’s hard to grasp that there is no simple way to enable 2 pins when I’m running the factory firmware.

I do think this might be the case. I’ll try and give a broad introduction; apologies if it covers things you already know, or if my own understanding is not 100% correct either.

I also don’t have the exact same development board as you, so I can’t personally check to see if any code should run for you.


Your Heltec V3 is, of course, manufactured by Heltec. The PCB is their design. On that PCB, they have placed components made by other manufacturers. These include the processor (ESP32S3, manufactured by Espressif Systems) and the LoRa radio (SX1262, manufactured by Semtech Semiconductor).

When you are setting up the Arduino IDE to write software for your Heltec V3, you first add the “board manager URL”, then install the “Heltec ESP32 Series Dev-boards” package from the Board Manager.

This package contains the code and tools to build a Heltec V3 version of “Arduino”. In this sense, “Arduino” is sort of a compatibility-layer. It sits between the code you will write, and the underlying scary microchip stuff. The package is released by Heltec, but it is based on code written by Espressif Systems. As of March 2024, the latest version is v1.0.0.

The board manager package really only contains the core stuff to get the processor running. For the peripheral hardware, like the LoRa radio, more code is required. This extra code is provided in the form of “Libraries”. A LoRa library takes simple code you write and makes all the scary LoRa hardware stuff happen. Heltec provide a library to do this job for their hardware. It is called “Heltec ESP32 Dev-Boards” and can be installed through the Arduino IDE’s library manager.

To be honest, the Heltec library is not very user friendly. The hardware used on the V3 is also used by other manufactures, so there are alternative libraries available. You will hear people recommend the RadioLib library for LoRa. Generally speaking, all the important “platform-specific” stuff comes in the “Board Manager Package”, you are not obliged to work with the Heltec library on-top of this. Note that Meshtastic does not use the Heltec library either.

It has more to do with Espressif’s processor design than Heltec’s board design. The code used for low-level stuff like this comes with the “Board Manager Package”, rather than the libraries.

You’re not really dealing with a “factory firmware” here. What you’re doing is using the Arduino IDE to compile the “Arduino source code” (Heltec’s version), any libraries you have included, and any of your own code you have written, to make your own firmware, which is then uploaded to the board.

In order for it to compile correctly, you need the correct “Arduino source code” for your board, the correct libraries, and your own correctly written code. If any one of these three parts is off, the compilation will fail, or the code will fail to run on your device.

I agree: it should be straight-forward. My advice to you is to start simple:

  • Forget about the Heltec Library. Start a New Sketch in the Arduino IDE. Select your board model from the drop-down menu in the toolbar. Upload the blank sketch to your device. Any problems? Hopefully not.

  • Try an example from the Arduino IDE menu, maybe File > Examples > 04.Communication > ASCII Table. Upload the sketch to your device. Any problems? Can you open the Serial Monitor in Arduino IDE? When you press the V3’s reset button, does it transmit a bunch of info to the Serial Monitor at start-up?

  • Try and get your GPS module working. Meshtastic uses the TinyGPSPlus library, which I see you have tried out too. Install it from the Arduino IDE library manager. The example sketch uses SoftwareSerial for Arduino Uno, rather than Serial1 for ESP32. Here is a slightly modified version. Make sure to set RXPin TXPin and GPSBaud to match your device:

#include <TinyGPSPlus.h>

// XPBDev, please set these!
static const int RXPin = 26, TXPin = 25;
static const uint32_t GPSBaud = 9600;

// This sample sketch demonstrates the normal use of a TinyGPSPlus (TinyGPSPlus) object.

// The TinyGPSPlus object
TinyGPSPlus gps;

void setup()
{
  Serial.begin(115200);
  Serial1.begin(GPSBaud, SERIAL_8N1, RXPin, TXPin);

  Serial.println(F("DeviceExample.ino"));
  Serial.println(F("A simple demonstration of TinyGPSPlus with an attached GPS module"));
  Serial.print(F("Testing TinyGPSPlus library v. ")); Serial.println(TinyGPSPlus::libraryVersion());
  Serial.println(F("by Mikal Hart"));
  Serial.println();
}

void loop()
{
  // This sketch displays information every time a new sentence is correctly encoded.
  while (Serial1.available() > 0)
    if (gps.encode(Serial1.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: ")); 
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Date/Time: "));
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print(F("/"));
    Serial.print(gps.date.day());
    Serial.print(F("/"));
    Serial.print(gps.date.year());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F(" "));
  if (gps.time.isValid())
  {
    if (gps.time.hour() < 10) Serial.print(F("0"));
    Serial.print(gps.time.hour());
    Serial.print(F(":"));
    if (gps.time.minute() < 10) Serial.print(F("0"));
    Serial.print(gps.time.minute());
    Serial.print(F(":"));
    if (gps.time.second() < 10) Serial.print(F("0"));
    Serial.print(gps.time.second());
    Serial.print(F("."));
    if (gps.time.centisecond() < 10) Serial.print(F("0"));
    Serial.print(gps.time.centisecond());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.println();
}


Do you mean by flashing a pre-compiled firmware, or by building with Visual Studio Code? If your GPS module baud-rate is not 9600, you will need to modify the code and compile your own version of the Meshtastic firmware in Visual Studio Code.

Even if you do not need to change the baud-rate, it may help you with debugging to be able to see and modify the Meshtastic code.