DutchMeshCore.nl-MQTT

CLI Commands

This document provides an overview of CLI commands that can be sent to MeshCore Repeaters, Room Servers and Sensors.


Operational

Reboot the node

Usage:


Reset the clock and reboot

Usage:


Sync the clock with the remote device

Usage:


Display current time in UTC

Usage:


Set the time to a specific timestamp

Usage:

Parameters:


Send a flood advert

Usage:


Send a zero-hop advert

Usage:


Start an Over-The-Air (OTA) firmware update

Usage:


Erase/Factory Reset

Usage:

Serial Only: Yes

Warning: This is destructive!


Neighbors (Repeater Only)

List nearby neighbors

Usage:

Note: The output of this command is limited to the 8 most recent adverts.

Note: Each line is encoded as {pubkey-prefix}:{timestamp}:{snr*4}


Remove a neighbor

Usage:

Parameters:


Discover zero hop neighbors

Usage:


Statistics

Clear Stats

Usage: clear stats


System Stats - Battery, Uptime, Queue Length and Debug Flags

Usage:

Serial Only: Yes


Radio Stats - Noise floor, Last RSSI/SNR, Airtime, Receive errors

Usage: stats-radio

Serial Only: Yes


Packet stats - Packet counters: Received, Sent

Usage: stats-packets

Serial Only: Yes


Logging

Begin capture of rx log to node storage

Usage: log start


End capture of rx log to node storage

Usage: log stop


Erase captured log

Usage: log erase


Usage: log

Serial Only: Yes


Info

Get the Version

Usage: ver


Show the hardware name

Usage: board


Configuration

Radio

View or change this node’s radio parameters

Usage:

Parameters:

Set by build flag: LORA_FREQ, LORA_BW, LORA_SF, LORA_CR

Default: 869.525,250,11,5

Note: Requires reboot to apply


View or change this node’s transmit power

Usage:

Parameters:

Set by build flag: LORA_TX_POWER

Default: Varies by board

Notes: This setting only controls the power level of the LoRa chip. Some nodes have an additional power amplifier stage which increases the total output. Refer to the node’s manual for the correct setting to use. Setting a value too high may violate the laws in your country.


Change the radio parameters for a set duration

Usage:

Parameters:

Note: This is not saved to preferences and will clear on reboot


View or change this node’s frequency

Usage:

Parameters:

Default: 869.525

Note: Requires reboot to apply Serial Only: set freq <frequency>


View or change this node’s rx boosted gain mode (SX12xx and LR1110, v1.14.1+)

Usage:

Parameters:

Default: on

Temporary Note: If you upgraded from an older version to 1.14.1 without erasing flash, this setting is off because of #2118


View or change the LoRa FEM receive-path gain state on supported boards

Usage:

Parameters:

Notes:


System

View or change this node’s name

Usage:

Parameters:

Set by build flag: ADVERT_NAME

Default: Varies by board

Note: Max length varies. If a location is set, the max length is 24 bytes; 32 otherwise. Emoji and unicode characters may take more than one byte.


View or change this node’s latitude

Usage:

Set by build flag: ADVERT_LAT

Default: 0

Parameters:


View or change this node’s longitude

Usage:

Set by build flag: ADVERT_LON

Default: 0

Parameters:


View or change this node’s identity (Private Key)

Usage:

Parameters:

Serial Only:

Note: Requires reboot to take effect after setting


Change this node’s admin password

Usage:

Parameters:

Set by build flag: ADMIN_PASSWORD

Default: password

Note: Command reply echoes the updated password for confirmation.

Note: Any node using this password will be added to the admin ACL list.


View or change this node’s guest password

Usage:

Parameters:

Set by build flag: ROOM_PASSWORD (Room Server only)

Default: <blank>


View or change this node’s owner info

Usage:

Parameters:

Default: <blank>

Note: | characters are translated to newlines

Note: Requires firmware 1.12+


Fine-tune the battery reading

Usage:

Parameters:

Default: 0.0 (value defined by board)

Note: Returns “Error: unsupported by this board” if hardware doesn’t support it


View this node’s public key

Usage: get public.key


View this node’s firmware version

Usage: ver


View this node’s configured role

Usage: get role


View or change this node’s power saving flag (Repeater Only)

Usage:

Parameters:

Default: off

Note: When enabled, device enters sleep mode between radio transmissions


Routing

View or change this node’s repeat flag

Usage:

Parameters:

Default: on


View or change this node’s advert path hash size

Usage:

Parameters:

Default: 0

Note: the ‘path.hash.mode’ sets the low-level ID/hash encoding size used when the repeater adverts. This setting has no impact on what packet ID/hash size this repeater forwards, all sizes should be forwarded on firmware >= 1.14. This feature was added in firmware 1.14

Temporary Note: adverts with ID/hash sizes of 2 or 3 bytes may have limited flood propagation in your network while this feature is new as v1.13.0 firmware and older will drop packets with multibyte path ID/hashes as only 1-byte hashes are supported. Consider your install base of firmware >=1.14 has reached a criticality for effective network flooding before implementing higher ID/hash sizes.


View or change this node’s loop detection

Usage:

Parameters:

Default: off

Note: When it is enabled, repeaters will now reject flood packets which look like they are in a loop. This has been happening recently in some meshes when there is just a single ‘bad’ repeater firmware out there (probably some forked or custom firmware). If the payload is messed with, then forwarded, the same packet ends up causing a packet storm, repeated up to the max 64 hops. This feature was added in firmware 1.14

Example: If preference is loop.detect minimal, and a 1-byte path size packet is received, the repeater will see if its own ID/hash is already in the path. If it’s already encoded 4 times, it will reject the packet. If the packet uses 2-byte path size, and repeater’s own ID/hash is already encoded 2 times, it rejects. If the packet uses 3-byte path size, and the repeater’s own ID/hash is already encoded 1 time, it rejects.


View or change the retransmit delay factor for flood traffic

Usage:

Parameters:

Default: 0.5

Note: When multiple nearby repeaters all hear the same flood packet, each waits a random amount of time before retransmitting to avoid simultaneous collisions. This factor scales the size of that random window. Higher values reduce collision risk at the cost of added latency. 0 disables the window entirely.


View or change the retransmit delay factor for direct traffic

Usage:

Parameters:

Default: 0.2

Note: Same collision-avoidance random window as txdelay, but applied to direct (non-flood, routed) traffic. The default is lower because direct packets are addressed to a specific next hop, so far fewer nodes compete to retransmit them.


[Experimental] View or change the processing delay for received traffic

Usage:

Parameters:

Default: 0.0

Note: When enabled, repeaters that received a flood packet with a weak signal are held in a delay queue before processing, while those that received it with a strong signal process it immediately. This gives strong-signal paths forwarding priority. By the time weak-signal nodes process their copy, the packet may have already propagated and will be suppressed as a duplicate, reducing redundant retransmissions.


View or change the duty cycle limit

Usage:

Parameters:

Default: 50% (equivalent to airtime factor 1.0)

Examples:

Note: Added in firmware v1.15.0


View or change the airtime factor (duty cycle limit)

Deprecated as of firmware v1.15.0. Use get/set dutycycle instead.

Usage:

Parameters:

Default: 1.0


View or change the local interference threshold

Usage:

Parameters:

Default: 0.0


Enable or disable hardware Channel Activity Detection (CAD)

Usage:

Description: When enabled, the radio performs a hardware Channel Activity Detection scan before transmitting and defers if the channel is busy. Runs independently of int.thresh — either, both, or none may be active.

Parameters:

Default: off


View or change the AGC Reset Interval

Usage:

Parameters:

Default: 0.0


View or change the radio watchdog interval

Usage:

Parameters:

Default: 5

Note: On quiet meshes, increasing this can reduce false recoveries when no traffic is expected.


Enable or disable Multi-Acks support

Usage:

Parameters:

Default: 0


View or change the flood advert interval

Usage:

Parameters:

Default: 12 (Repeater) - 0 (Sensor)


View or change the zero-hop advert interval

Usage:

Parameters:

Default: 0


Limit the number of hops for a flood message

Usage:

Parameters:

Default: 64


Limit the number of hops for an unscoped flood message

Usage:

Parameters:

Default: 0xFF - indicates it hasn’t been set, will track flood.max until it is.

Note: An alternative to region denyf *, setting flood.max.unscoped to a lower value such as 3 would allow for local unscoped messages to propagate, while preventing noisy neighbors from flooding a local region.


ACL

Add, update or remove permissions for a companion

Usage:

Parameters:

Note: Removes the entry when permissions is omitted


View the current ACL

Usage:

Serial Only: Yes


View or change this room server’s ‘read-only’ flag

Usage:

Parameters:

Default: off


Region Management (v1.10.+)

Bulk-load region lists

Usage:

Parameters:

Note: flood_flag: Optional F to allow flooding

Note: Indentation creates parent-child relationships (max 8 levels)

Note: region load with an empty name will not work remotely (it’s interactive)


Save any changes to regions made since reboot

Usage:


Allow a region

Usage:

Parameters:

Note: Setting on wildcard * allows packets without region transport codes


Block a region

Usage:

Parameters:

Note: Setting on wildcard * drops packets without region transport codes


Show information for a region

Usage:

Parameters:


View or change the home region for this node

Usage:

Parameters:


View or change the default scope region for this node

Usage:

Parameters:


Create a new region

Usage:

Parameters:

Note: In firmware v1.15.0 and later, region put enables flooding for that region by default (you do not need a separate region allowf <name> after each put). On v1.14.0 and earlier, new regions may still require region allowf for flooding—see region allowf.


Define region hierarchy (single line)

Usage:

Parameters (tokens): Space-separated. A logical cursor starts at the wildcard *.

Behavior: Each created region defaults to flood-allowed (same as region put). The reply is the resulting region tree (same format as bare region); review it before running region save to persist. On error, the reply is Err - ... and any regions placed before the failure remain on the node, just like a partial chain of region put.

Existing regions: region def does not clear the existing tree — if a name already exists, its parent is updated to the current cursor; otherwise a new region is created. To start from scratch, region remove the unwanted regions first.

Limits: Repeater serial accepts one line up to 160 characters. For larger trees, split across multiple region def commands; the cursor resets to * between commands, so lead the next command with child|ancestor to reposition. Each token splits at most once on |region def a|b|c|d is not a flat-list shorthand; see the flat-list example below.

Example — linear chain (each token becomes a child of the previous):

region def a b c d e
region save

Example — branched tree (equivalent to region put a, region put b a, region put c b, region put d c, region put e b, region put f e):

region def a b c d|b e f
region save

Example — error and partial state:

region def a b c|nope d

The reply is Err - unknown jump: nope. a, b, and c were placed before the failure; d was not. Run region to inspect, then re-run with a corrected jump or repair with region remove / region put.

Example — flat list (each region a child of *). Use |* after each token to pop the cursor back to the root before the next token:

region def a|* b|* c|* d|* e|* f
region save

Remove a region

Usage:

Parameters:

Note: Must remove all child regions before the region can be removed


View all regions

Usage:

Serial Only: Yes

Parameters:

Note: Requires firmware 1.12+


Dump all defined regions and flood permissions

Usage:

Serial Only: For firmware older than 1.12.0


Region Examples

Example 1: Using F Flag with Named Public Region

region load
#Europe F
<blank line to end region load>
region save

Explanation:


Example 2: Using Wildcard with F Flag

region load 
* F
<blank line to end region load>
region save

Explanation:


Example 3: Using Wildcard Without F Flag

region load 
*
<blank line to end region load>
region save

Explanation:


Example 4: Nested Public Region with F Flag

region load 
#Europe F
  #UK
    #London
    #Manchester
  #France
    #Paris
    #Lyon
<blank line to end region load>
region save

Explanation:


Example 5: Wildcard with Nested Public Regions

region load 
* F
  #NorthAmerica
    #USA
      #NewYork
      #California
    #Canada
      #Ontario
      #Quebec
<blank line to end region load>
region save

Explanation:


GPS (When GPS support is compiled in)

View or change GPS state

Usage:

Parameters:

Default: off

Note: Output format:


Sync this node’s clock with GPS time

Usage:


Set this node’s location based on the GPS coordinates

Usage:


View or change the GPS advert policy

Usage:

Parameters:

Default: prefs


Sensors (When sensor support is compiled in)

View the list of sensors on this node

Usage: sensor list [start]

Parameters:

Note: Output format: <var_name>=<value>\n


View or change the value of a sensor

Usage:

Parameters:


Bridge (When bridge support is compiled in)

View the compiled bridge type

Usage: get bridge.type


View or change the bridge enabled flag

Usage:

Parameters:

Default: off


Add a delay to packets routed through this bridge

Usage:

Parameters:

Default: 500


View or change the source of packets bridged to the external interface

Usage:

Parameters:

Default: logTx

Note: For MQTT bridges, use mqtt.rx and mqtt.tx instead of bridge.source. These provide independent per-direction control and support both RX and TX simultaneously. bridge.source still works as a convenience alias for MQTT (setting bridge.source rx sets mqtt.rx on + mqtt.tx off, and vice versa), but mqtt.rx/mqtt.tx are preferred.


View or change MQTT RX packet uplinking

Usage:

Parameters:

Default: on


View or change MQTT TX packet uplinking

Usage:

Parameters:

Default: advert

Note: mqtt.rx and mqtt.tx take effect immediately — no restart required. Both can be enabled simultaneously.


MQTT Observer Firmware (When MQTT bridge support is compiled in)

MQTT observer builds add WiFi connectivity and MQTT packet uplinking to repeater and room server firmware.

Quick first-time setup

Usage:

set radio 910.525,62.5,7,5
set tx 22
set name MyObserver
set mqtt.iata SEA
set wifi.ssid YourWiFiNetwork
set wifi.pwd YourWiFiPassword
reboot

Optional receive-only observer:

set repeat off

Verify:

get bridge.enabled
get mqtt.rx
get mqtt.tx
get mqtt.origin
get mqtt.iata
get mqtt1.preset
get mqtt2.preset
get mqtt.status
get wifi.status

View available MQTT presets

Usage:

Parameters:

Available presets include: analyzer-us, analyzer-eu, meshmapper, meshrank, waev, meshomatic, cascadiamesh, tennmesh, nashmesh, chimesh, meshat.se, eastidahomesh, dutchmeshcore-1, dutchmeshcore-2, coloradomesh, custom, none


View or change an MQTT slot preset

Usage:

Parameters:

DutchMeshCore presets:

Default for this firmware: Slot 1 and slot 2 are DutchMeshCore presets. Slot 1 is dutchmeshcore-1, slot 2 is dutchmeshcore-2, and slots 3-6 are none.


View or change custom MQTT slot settings

Usage:

Parameters:

Notes:


Configure MeshRank on a slot

Usage:

set mqtt3.preset meshrank
set mqtt3.token <meshrank_token>

Note: MeshRank requires a token and receives packet data only.


Configure a custom broker

Usage:

set mqtt3.preset custom
set mqtt3.server your-broker.example.com
set mqtt3.port 1883
set mqtt3.username your-username
set mqtt3.password your-password

JWT custom broker example:

set mqtt3.preset custom
set mqtt3.server wss://my-broker.example.com:443/mqtt
set mqtt3.port 443
set mqtt3.audience my-broker.example.com

Custom topic example:

set mqtt3.preset custom
set mqtt3.server my-broker.local
set mqtt3.port 1883
set mqtt3.topic mynetwork/{device}/{type}

Topic placeholders:

Default custom topic: meshcore/{iata}/{device}/{type}


View or change MQTT shared settings

Usage:

Parameters:

Serial Only:

Defaults:


View or change WiFi settings

Usage:

Parameters:

Default: none


View or change timezone settings

Usage:

Parameters:


MQTT observer build targets

Usage:

pio run -e Heltec_v3_repeater_observer_mqtt
pio run -e heltec_v4_repeater_observer_mqtt
pio run -e Station_G2_repeater_observer_mqtt
pio run -e LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt
pio run -e LilyGo_TLora_V2_1_1_6_room_server_observer_mqtt

Build flags:


MQTT observer flashing notes

Some MQTT observer builds use larger app partitions for MQTT, TLS, and certificate bundle support. When a board’s partition table changes, flash the merged firmware (*-merged.bin) the first time so the bootloader and partition table are written together.

Environment Partition table Flash size App slot size Notes
LilyGo_T3S3_sx1262_repeater_observer_mqtt min_spiffs.csv 4 MB 1.875 MB Changed from default
LilyGo_T3S3_sx1262_room_server_observer_mqtt min_spiffs.csv 4 MB 1.875 MB Changed from default
LilyGo_TLora_V2_1_1_6_repeater_observer_mqtt min_spiffs.csv 4 MB 1.875 MB TTGO LoRa32 V1.0; observer env omits sensor_base
LilyGo_TLora_V2_1_1_6_room_server_observer_mqtt min_spiffs.csv 4 MB 1.875 MB Same as repeater observer
Station_G2_repeater_observer_mqtt default_16MB.csv 16 MB 6.25 MB 16 MB flash board
Station_G2_room_server_observer_mqtt default_16MB.csv 16 MB 6.25 MB 16 MB flash board

Merged firmware example:

pio run -t mergebin -e LilyGo_T3S3_sx1262_repeater_observer_mqtt
esptool.py write_flash 0x0 .pio/build/LilyGo_T3S3_sx1262_repeater_observer_mqtt/firmware-merged.bin

Note: If the partition layout changes, stored settings in NVS are typically wiped or invalidated. Expect to reconfigure admin preferences, WiFi, MQTT slots, device name, and related settings.


MQTT topics

Type Topic
Status meshcore/{IATA}/{DEVICE_PUBLIC_KEY}/status
Packets meshcore/{IATA}/{DEVICE_PUBLIC_KEY}/packets
Raw meshcore/{IATA}/{DEVICE_PUBLIC_KEY}/raw

Note: {DEVICE_PUBLIC_KEY} is the device public key as 64 hexadecimal characters.


MQTT troubleshooting

WiFi issues:

get wifi.ssid
get wifi.pwd
get wifi.status
set wifi.powersave none
reboot

No MQTT messages appearing:

get bridge.enabled
set bridge.enabled on
get mqtt.rx
set mqtt.rx on
get mqtt.tx
get mqtt.status
get mqtt1.preset
get mqtt2.preset
get mqtt.iata

Timezone issues:

get timezone
set timezone Europe/Amsterdam
set timezone.offset 1

View or change the speed of the bridge (RS-232 only)

Usage:

Parameters:

Default: 115200


View or change the channel used for bridging (ESPNow only)

Usage:

Parameters:


Set the ESP-Now secret

Usage:

Parameters:

Default: Varies by board


View the bootloader version (nRF52 only)

Usage: get bootloader.ver


View power management support

Usage: get pwrmgt.support


View the current power source

Usage: get pwrmgt.source

Note: Returns an error on boards without power management support.


View the boot reset and shutdown reasons

Usage: get pwrmgt.bootreason

Note: Returns an error on boards without power management support.


View the boot voltage

Usage: get pwrmgt.bootmv

Note: Returns an error on boards without power management support.


SNMP (When SNMP support is compiled in)

SNMP observer builds expose read-only SNMP v2c monitoring for radio statistics, MQTT connectivity, memory usage, and WiFi RSSI.

View or change SNMP state

Usage:

Default: off

Note: Restart required after changing.


View or change SNMP community string

Usage:

Default: public

Note: Restart required after changing.


Poll SNMP from a host on the same network

Usage:

snmpwalk -v2c -c public <device-ip> 1.3.6.1.4.1.99999

Note: The SNMP agent listens on UDP port 161 and uses the private enterprise subtree 1.3.6.1.4.1.99999.