LoRa Commands

Command reference for GhostESP LoRa: Meshtastic, MeshCore and boot auto-start

On this page

Reference for the lora, mesh and meshcore commands. Setting up for the first time? Start with First run. Run lora help or help all for the live list on the device.

Start, Stop, Status

CommandWhat it does
lora statusRadio state, region, frequency, modem, TX power, companion mode, last error
lora start / lora onPower Vext (Heltec), init the SX1262, join LongFast, begin RX/TX
lora stop / lora offStop RX, release the radio and Vext
lora setupPrint first-run guidance (fixed text): region is required, current defaults, then lora start
meshShow what owns the radio, and the remembered boot choice
mesh offStop the active protocol

Protocol Switching

One radio, one protocol at a time.

CommandWhat it does
mesh switch meshtasticStop MeshCore, start Meshtastic, remember it
mesh switch meshcoreStop Meshtastic, start MeshCore, remember it
mesh on [protocol]Start the remembered protocol, or the one you name

The remembered choice only changes after a protocol starts successfully, so a failed switch never leaves boot pointed at a dead radio.

Boot Auto-Start

Auto-start is opt-in and remembers whether to start and which protocol.

CommandWhat it does
lora autostartShow the setting and the boot protocol
lora autostart meshtasticBoot Meshtastic (needs a saved region)
lora autostart meshcoreBoot MeshCore (no region needed)
lora autostart on / offToggle auto-start, keep the current protocol
mesh autostart <meshtastic|meshcore|off>Same thing from mesh
meshcore autostart on|offMeshCore shortcut; on also selects MeshCore

The radio starts late in boot, after the display and storage init, so it never starves system memory. Confirm what came up with mesh after a reboot.

Messages and Peers

CommandWhat it does
lora chat <text>Broadcast on the LongFast channel (default-key encrypted)
lora chatList recent messages (aliases: lora send, lora messages)
lora nodesList known nodes as !node short rssi snr [pki][+] (no hops or last-heard fields)
lora nodeinfo [node]Advertise our name/key and request a reply
lora dm <node> <text>Encrypted direct message; the peer key must be known
lora pkinfo <node>Show the stored peer key and our own key
lora channelsShow the 8 channel slots, their roles and hashes

Radio Settings

Changes apply on the next lora start unless noted.

CommandWhat it does
lora set region <code>Legal band plan; see Regions for all 24 codes
lora region <code>Shorthand for lora set region
lora set sf <5..12>Spreading factor; higher means longer range, lower rate. SF6 is rejected (it needs an implicit header) and BW500 needs SF7 or higher
lora set bw <125|250|500>Bandwidth in kHz; must match peers
lora set cr <5..8>Coding rate, CR4/5 to CR4/8
lora set tx <dBm>TX power; minimum 2 dBm, values above the board/region cap are rejected
lora set preset <0..16>Use a named Meshtastic preset instead of a custom modem
lora set hop <1..7>Hop limit: how many relays a packet may cross
lora set role <0..12>Device role: 0 client, 1 client mute, 2 router, 5 tracker, 6 sensor, 8 client hidden, 10 TAK tracker, 11 router late, 12 client base
lora set offset <MHz>Frequency offset correction for a drifting crystal (±2.0 MHz)
lora set ovrfreq <MHz>Hard frequency override, ignoring the region plan
lora set chnum <n>Select the region frequency slot directly (0 uses the channel hash, 1..512)
lora set txen <n>Enable or disable transmit (listen-only): a nonzero number enables TX, 0 disables. The argument is numeric - on parses as 0 and disables TX
lora set owner <long> <short>Advertised names (long under 40 chars, short under 8 chars), then send NodeInfo again
lora set companion <wifi|ble>Transport for the companion app bridge

Phone App and Companion

CommandWhat it does
lora ble on / offStart or stop the Meshtastic BLE service (Ghost-XXXX)
lora ble statusAdvertising/connected/linked flags only
lora appApp FIFO push/pop/drop counters, linked state and pending-data flag
lora companion wifiBridge over Wi-Fi (keeps BLE free for scans)
lora companion bleBridge over BLE (shares the radio)

Pairing steps are in BLE App Link.

Diagnostics

CommandWhat it does
lora diagIRQ counters, TX queue, app FIFO, last RX metadata
lora cadFive channel-activity trials with instantaneous RSSI
lora reg <hex> [count]Read SX1262 registers; lora reg 0740 2 should show sync word 24 B4
lora pubkeyOur Curve25519 public key
lora pkselftestX25519, SHA-256 and AES-CCM known-answer tests
lora pkitest <node>PKI encrypt and decrypt loopback against a peer (no TX)
lora pktry <hex>Probe a captured frame against the PKI decrypt variants
lora pki-regenGenerate a new identity keypair

Avoid lora pki-regen in normal troubleshooting: it replaces the identity key peers already stored, and they need a fresh NodeInfo before direct messages work again.

Active Mesh Verbs

The same actions without naming a protocol, applied to whichever one is running:

CommandWhat it does
mesh send <text>Send on channel 0
mesh messagesRead received messages
mesh dm <peer> <text>Direct message
mesh peersNodes (Meshtastic) or contacts (MeshCore)
mesh channelsList channels
mesh app [on|off]BLE app link
mesh selftestCrypto self test for MeshCore; under Meshtastic it points you to lora pkselftest
mesh meshtastic <args> / mesh meshcore <args>Run a protocol-specific command

Regions

All 24 region codes lora set region accepts, with the band they cover and the duty-cycle limit applied to transmits. The exact centre frequency also depends on the preset and channel slot, so two nodes on the same region and preset always land on the same frequency.

CodeBand (MHz)Duty
us915902.0 - 928.0100%
eu868869.400 - 869.6510%
eu433433.0 - 434.010%
cn470.0 - 510.0100%
jp920.5 - 923.5100%
anz915.0 - 928.0100%
kr920.0 - 923.0100%
tw920.0 - 925.0100%
ru868.7 - 869.2100%
in865.0 - 867.0100%
nz865864.0 - 868.0100%
th920.0 - 925.010%
ua433433.0 - 434.710%
my433433.0 - 435.0100%
my919919.0 - 924.0100%
sg923917.0 - 925.0100%
ph433433.0 - 434.7100%
ph868868.0 - 869.4100%
ph915915.0 - 918.0100%
anz433433.05 - 434.79100%
kz433433.075 - 434.775100%
kz863863.0 - 868.0100%
np865865.0 - 868.0100%
br902902.0 - 907.5100%

Pick the region legal for where you are. The duty guard throttles transmits when the band’s airtime budget is used up, and lora status shows the remaining budget.

See MeshCore mode for the meshcore commands, and Mesh details for the wire format.