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.