AmoghDesai.com

How to build and use Meshtastic firmware for Esp32-C3 Supermini and LLCC68 RF Module

This post is part of a series of posts about building the cheapest Meshtastic node. If you have directly reached this post, do read the last 2 parts here:

  1. Building and Testing simple LoRa communication between 2 nodes using cheap modules – ESP32-C3 supermini and LLCC68: https://amoghdesai.com/uncategorized/cheapest-lora-transceiver-with-the-llcc68-and-esp32%e2%80%91c3-supermini-plus/
    Also did a YoutTube video on this. Watch it here
  2. More about Pros and Cons of the llcc68 module, what works and what not: https://amoghdesai.com/uncategorized/does-meshtastic-support-llcc68/

And in this third post we will sum it up with building firmware from scratch (as I did not find any available from the Meshtastic or third parties), Flash the firmware to esp32-c3 and run 2 fully functional Meshtastic nodes that can communicate with each other. I am using the same hardware setup from the first post with minor changes to pin configuration.

Building the firmware

If you want to build the firmware yourself you can follow the steps here, if you want a ready built firmware skip to the next part. For building the firmware you will need Python3 (Python 3.6–3.12), PlatformIO and git installed. Also need, two github repos for Meshtastic firmware and my esp32c3_llcc68 repo. I am on a Windows machine with WSL, where I simply ran below commands to get it running.

Setup The build environment

# 1. Install required packages
sudo apt install python3 python3-pip python3-venv git build-essential

# 2. Locates the Python installation and Install PlatfomIO in a virtual environment using pip
curl -fsSL https://platformio.org/install.sh | sh

# 3. you can additionally setup add PlatformIO to your PATH (optional but useful)
echo 'export PATH="$HOME/.platformio/penv/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc  # or restart your terminal

# 4. Verify installation
platformio --version
   # or if you skipped the step #3 the from your user home
/<user_home>/.platformio/penv/bin/platformio --version

Build the firmware

# 1. Clone the Meshtastic firmware repo
git clone https://github.com/meshtastic/firmware.git
cd firmware/variants
     # Inside this directory you will find a lot of official and third party firmware variants released and ready to be built. Now time to get our custom build files.

# 2. Clone my repo, to get the build files for esp32-c3 + llcc68 based Meshtastic node firmware.
git clone https://github.com/desaiamogh/esp32c3_llcc68.git
ls -l esp32c3_llcc68   # ensure variant.h and platform.ini files exists.
cd ..  # go back to firmware directory.
 
# 3. Build the firmware
platformio run -e esp32c3_llcc68
  # or if you skipped adding the PATH
/<user_home>/.platformio/penv/bin/platformio run -e esp32c3_llcc68

# 4. Confirm build is successful with below output from above command
# Building .pio/build/esp32c3_llcc68/firmware.bin
# esptool.py v4.5.1
# Creating esp32c3 image...
# Merged 4 ELF sections
# Successfully created esp32c3 image.

# 5. Get the firmware for flashing from below path
ls -lh .pio/build/esp32c3_llcc68/firmware.factory.bin

Flashing the Firmware

# 1. Get Your firmware
# You can either get your firmware from above build process, or get pre-built bin file from my github repo https://github.com/desaiamogh/esp32c3_llcc68 and download the filename: esp32c3_llcc68_meshtastic_firmware.factory.bin

# 2. Install esptool
pip3 install --upgrade esptool

# 3. Connect the esp32c3 and flash the firmware.
esptool --chip esp32c3 --port COM6 --baud 115200 write_flash -z 0x0 firmware.factory.bin

Caveat Emptor

// SPI interface pins
#define SX126X_MISO    21  // Master In Slave Out
#define SX126X_MOSI    20  // Master Out Slave In
#define SX126X_SCK     7   // SPI Clock
#define SX126X_CS      6   // Chip Select (NSS) for LLCC68

// LLCC68 control pins
#define SX126X_BUSY  2   // BUSY pin
#define SX126X_RESET 10  // RESET pin
#define SX126X_DIO1  4   // DIO1 (interrupt)

I will be happy to help in any way possible and if you are able to build over this config, like adding gps, lcd, other sensors or 3d print enclosers, etc. by keeping costs low and efficient, I would love to collaborate. Do leave a comment if you have any suggestions or question.