Reading view
Loading Meshtastic Firmware onto Heltec ESP32 v3 Devices
The loading of the Meshtastic firmware on the Heltec ESP32 v3 devices is really simple if done via a Linux PC/RaspberryPi. There are of course other ways to load the firmware using a web browser that supports USB/Serial devices and this method is preferred by many however, being a Linux command line junkie I far prefer the simplicity of using the Linux command line to do the job.
So, how much experience with the Linux command line do you need?
In all honesty none at all. If you know how to use copy and paste then all you have to do is follow the simple steps Iβve detailed below. In reality it will only take a few minutes to do so, donβt be put off by the long article, Iβve just tried to cover everything and provide screen shots along the way.
To get started fire up your Linux PC/RaspberryPi and get yourself to the desktop. Next you will need to open a Linux command line terminal. This is often just called βTerminalβ on most Linux desktop installations.
The first thing you need to do is check to see if you have python3 installed. This is done using the following command:
python3 --version
Running the above command you should see a result something like what is shown below.
Next we need to check if pip3 is installed using the following command:
pip3 --version
If pip3 is installed then you should get a result similar to that shown below.
If your computer doesnβt have Python3 or Pip3 installed they can be easily installed from the command line. To install Python3 enter the following command into your terminal:
sudo apt install python3
You will be asked to enter your login password and then the installation will begin. You should see output in your terminal similar to that shown below.
To install Pip3 enter the following command into your terminal:
sudo apt-get install python3-pip
This will detail a long list of packages that will be installed on your computer, Enter Y to answer Yes and let the packages install.
You will see many messages scroll up the terminal screen such as getting, selecting, preparing, unpacking and setting up, this is all normal.
Once Pip3 is installed you should be dropped back at the command line with a terminal screen that looks something like the one below.
At this point you will now have Python3 and Pip3 available on your computer.
You are now ready to install the tool we are going to use to check your Meshtastic device is connected to your PC and install the firmware to it. (Do not connect your Meshtastic device to your PC just yet!)
Run the following command in your terminal to install the ESP Tool:
pip3 install --upgrade esptool
You will see an output from the installation process similar to that shown below.
Now that we have the ESP tool installed plug your Meshtastic device into your USB port on your computer and then run the following command to interrogate the device to find out what kind of device it is.
esptool chip_id
You should see the information about your device that looks similar to that shown below. This information should confirm the device type (ESP32) and which USB port it is connected on (/dev/tty/USB0).
Once you have this information you will need to download the firmware for your device from Github using the following URL:
https://github.com/meshtastic/firmware/releases
At the time of writing this I downloaded and used the v2.2.22.404d firmware which I have found to be extremely reliable.
In your terminal you now need to change directory (cd) into the Downloads directory where your downloaded firmware should be. (If you downloaded your firmware into another directory then you will need to cd into that directory). Use the following command to change directory into the Downloads directory.
cd ~/Downloads
Now we need to find the filename of the firmware we have just downloaded, we can use the list directory contents command to find the file using the simple command below.
ls -la firm*.zip
In the screenshot above we can see that the filename is called
firmware-2.2.22.404d0dd.zip.
We now need to unzip the file using the unzip command.
unzip firmware-2.2.22.404d0dd.zip
Youβll see lots of output from the unzip command about inflating files etc, this is normal.
Once the file has been unzipped you are ready to load the firmware onto your Heltec device. First you need to find the .bin file for your Heltec device. Use the following ls command to list the files available.
ls -la firmware-heltec*
This will list out all the firmware file options for the Heltec device as shown below.
The file you need to use for a new firmware installation on a Heltec v3 device is
firmware-heltec-v3-2.2.22.404d0dd.bin. (If you downloaded a different version then the version number in the file will be different).
Using the filename you found above enter the following command into your terminal.
./device-install.sh -f firmware-heltec-v3-2.2.22.404d0dd.bin
This will now clear down your Heltec device and will load the Meshtastic firmware. This will take a little time especially on slower computers like the RaspberryPi so, just let it run until it finishes. Do not interrupt the process whilst it is running.
Once the firmware is loaded the Heltec device will reboot and you will see the Meshtastic banner on the OLED screen. Your device is now ready for configuration.
Now that you have Python3 and Pip3 installed you can load the firmware onto other devices just by downloading the firmware and then running the device-install.sh script file, you wonβt need to install Python3 or Pip3 again.
If you want to update your device in the future to a newer version of the firmware then just use the update script and update binary file as shown below.
./device-update.sh -f firmware-heltec-v3-2.2.22.404d0dd-update.bin
Thatβs it, you are now a Linux Command line junkie!
More soon β¦