Skip to content

ESP32 SX1262: Offline Mesh Messaging | ShillehTek

May 06, 2025

Video Tutorial (Optional)

Watch first if you want the full setup and flashing process in real time.

Project Overview

Set Up Two ESP32 LoRa Boards with Meshtastic (ESP32 SX1262): learn how to flash Meshtastic firmware to ESP32 LoRa boards using the SX1262 radio, configure a private channel with a PSK, and send offline mesh messages between nodes for off-grid communication.

  • Time: 30 to 60 minutes
  • Skill level: Beginner to Intermediate
  • What you will build: A secure, private LoRa mesh between two ESP32 SX1262 nodes for offline messaging
Two ESP32 LoRa SX1262 boards and accessories laid out for setup including USB cables and antennas
ESP32 LoRa V3 boards (SX1262) and required accessories.

Parts List

From ShillehTek

External

  • 2x ESP32 LoRa V3 boards (SX1262, OLED, CP2102) - these are the boards flashed with Meshtastic (example: https://www.amazon.com/dp/B0DZN87DJX)
  • USB-C data cables - must support data transfer, not just charging
  • Antennas for SX1262 modules - attach before testing radio range
  • Python 3.9+ and pip - used to install the Meshtastic CLI

Note: Port names differ between macOS, Linux, and Windows. On macOS use /dev/cu.* instead of /dev/tty*. Set lora.region to your local region (for example US) to enable transmission.

Step-by-Step Guide

Step 1 - Install the Meshtastic CLI

Goal: Create an isolated Python environment and install the Meshtastic command-line tool.

What to do: Run these commands in a terminal to create a virtual environment, activate it, and install meshtastic.

python3 -m venv meshtastic-env
source meshtastic-env/bin/activate
pip install -U meshtastic

Expected result: The meshtastic CLI is available in the activated environment as the meshtastic command.

Step 2 - Flash Meshtastic Firmware

Goal: Install Meshtastic firmware on each ESP32 LoRa board so they run Meshtastic instead of the factory sketch.

What to do: Use the Meshtastic Web Installer for the easiest flashing experience.

  1. Open https://flasher.meshtastic.org in Chrome or Edge.
  2. Plug one board into USB-C on your computer.
  3. Click Connect and choose the serial port the board uses (on macOS look for /dev/cu.*).
  4. Select Heltec v3 as the device type when prompted.
  5. Flash and wait for completion, then unplug and repeat for the second board.
Meshtastic web flasher interface showing device connect dialog for Heltec v3
Meshtastic Web Installer in Chrome.
Meshtastic flashing progress dialog on the web installer
Flash progress and completion screen.

Expected result: Both ESP32 LoRa boards run Meshtastic and are ready for configuration.

Step 3 - Set a Private Channel

Goal: Create a private channel name and PSK on one node, then replicate that config to the other node so only your nodes can join the mesh.

What to do: Run the meshtastic edit commands on the first board, get the Primary channel URL, and apply it on the second board. Replace the serial port paths as needed for your OS.

On the first board (replace port accordingly):

meshtastic --port /dev/cu.usbserial-0001 --begin-edit
meshtastic --port /dev/cu.usbserial-0001 --ch-index 0 --ch-set name shillehtek
meshtastic --port /dev/cu.usbserial-0001 --ch-index 0 --ch-set psk random
meshtastic --port /dev/cu.usbserial-0001 --set lora.region US
meshtastic --port /dev/cu.usbserial-0001 --commit-edit

Get the generated channel URL:

meshtastic --port /dev/cu.usbserial-0001 --info | grep "Primary channel URL"

On the second board:

meshtastic --port /dev/cu.usbserial-0002 --ch-set-url "https://meshtastic.org/e/#..."
meshtastic --port /dev/cu.usbserial-0002 --set lora.region US
meshtastic --port /dev/cu.usbserial-0002 --reboot

Finally restart the first board:

meshtastic --port /dev/cu.usbserial-0001 --reboot

Expected result: Both nodes share the same private channel and PSK and will be able to exchange messages securely.

Step 4 - Test Mesh Communication

Goal: Confirm messages can be sent and nodes recognize each other on the new private channel.

What to do: Separate the boards by a few feet and use the meshtastic send and nodes commands to send and list messages and nodes.

meshtastic --port /dev/cu.usbserial-0001 --sendtext "Hello from Node 1"
meshtastic --port /dev/cu.usbserial-0001 --nodes

Expected result: The receiving board shows the message and the nodes list returns the other node on the mesh.

Step 5 - Quick tips and common fixes

Goal: Resolve frequent issues encountered during setup.

What to do: Use these quick checks if something is not working:

  • On macOS use /dev/cu.* ports rather than /dev/tty.* to find your board.
  • If lora.region is UNSET set it (for example US) so radios will transmit.
  • If nodes are too close they may interfere; move them a few feet apart or use longer USB cables.
  • If the PSK is wrong replicate the channel URL from the first node with --ch-set-url to ensure exact config.
Two ESP32 LoRa SX1262 nodes placed a few feet apart for range testing
Field test: separated nodes communicating over Meshtastic.

Expected result: Stable messaging between nodes and predictable range testing behavior.

Conclusion

You built a private LoRa mesh using ESP32 LoRa boards with the SX1262 radio and Meshtastic firmware, enabling offline, secure messaging between nodes without Wi-Fi or cellular networks.

Want the exact parts used or help deploying a LoRa solution? Grab parts from ShillehTek.com. For custom work, consulting, or help designing a production LoRa system hire us on UpWork.