MeshCore Sensor CLI Reference
Overview
AllThis sensor-specificpage settingsdescribes MeshCore's actual sensor support, which is
deliberately minimal and differs substantially from the richer Meshtastic
telemetry model. The most important facts to understand up front:
ENV_INCLUDE_* build flags and
example/sensor builds such as simple_sensor / SensorMesh). There is
no separate deployable "SENSOR firmware variant" or role; the firmware roles are
sensor list [start], sensor get <key>, and
sensor set <key> <value>. These are only available when
sensor support is compiled in.
Sensor readings are NOT broadcast in adverts. A MeshCore
advert carries only the node's name, optional position, and signed public key.
Live sensor data is delivered on demand through the binary request/response
protocol (REQ_TYPE_GET_TELEMETRY_DATA, CayenneLPP-encoded and
permission-gated) — a client requests it; the node does not push it to the mesh.
Rich per-sensor runtime configuration is not currently available in MeshCore. There are no commands to select a sensor type, set its I2C address, set a per-sensor read/broadcast interval, enable/disable a sensor, trigger an immediate read, or apply a temperature offset at runtime. If you need those behaviors, they must be handled at compile time in the firmware or in the host application that consumes the telemetry. Always check the current documentation at docs.meshcore.io/cli_commands, because MeshCore is evolving and sensor support is expanding.
Accessing the CLI
MeshCore Repeater, Room Server, and sensor-capable nodes are configured over a
USB/serial connection (using a terminal app, PuTTY, or the Arduino Serial
Monitor) or over BLE via the MeshCore companion app or the
meshcore-cli tool. Serial and BLE access to a node is at
115200 baud). orThere viais BLEno usingdocumented the MeshCore
mobile app. Commands"commands are case-insensitive.insensitive"
Changesbehavior take— use the documented lowercase command names. Whether a given change
takes effect immediately andor persistrequires acrossa reboots.reboot is per-command (for example,
set radio requires a reboot to apply), so do not assume every
setting applies instantly.
SettingThe Sensor CLI (compile-time sensor builds only)
When a build includes sensor support, MeshCore exposes a small generic
key/value store for sensor-related custom variables. These are the Sensor Type
setonly sensor
typecommands <type>that Validexist:
types:
| key=value lines (optionally starting from an index). | |
| ||
|
Example:
The keys available depend on what the compiled-in sensor build defines; this is
a generic custom-variable mechanism, not a fixed set of sensor settings.
The following commands do not exist in MeshCore and will not
work — do not use them (they are Meshtastic-style or invented):
set sensor type bme280
Setting the I2C Address
set sensor addr <hex address>Default addresses:
0x760x770x760x400x4FExample:, set sensor addr,
0x76
Setting the Broadcast Interval
,set sensor interval,<seconds>set sensor enabled
set sensor temp_offset, sensor read,
sensor status, and i2c scan. The sensor (and its I2C
address) is fixed at compile time; there is no runtime sensor-type table,
enable/disable toggle, immediate-read command, status dump, or I2C scanner.
Reading Sensor Data (telemetry protocol)
ControlsThere howis oftenno sensor read command and no human-readable
console-output block. To obtain live sensor values, a sensorclient readingrequests telemetry
over the binary protocol: REQ_TYPE_GET_TELEMETRY_DATA. The node
returns the data encoded as CayenneLPP (channel/type/value
triplets), and access is takenpermission-gated. In the Python library this is the
get_self_telemetry path rather than a CLI command. Decoding the
CayenneLPP response into named values (temperature, humidity, pressure, etc.) is
done by the requesting client, not printed by the node.
MeshCore Device CLI Reference
The real MeshCore node configuration commands (for Repeater / Room Server /
sensor builds) include the following. See
docs.meshcore.io/cli_commands
for the authoritative and advertisedcurrent on the mesh.
Lower values increase power consumption significantly.list.
set | ||
set | ||
set | ||
get |
advertset flood.advert.interval <hours>Set the flood-advert interval, in hours (default 12 for Repeater, 0 for sensor).
gps on / gps offToggle GPS power state.
set powersaving on / set powersaving offChange the power-saving mode (Repeater, persisted to prefs).
rebootReboot the node.
eraseErase stored configuration.
Example:
Advert cadence is controlled by set flood.advert.interval (hours) —
there is no per-second "sensor intervalbroadcast 600interval." Note again that adverts do
not contain sensor readings.
EnablingSensor Hardware and Disabling the SensorWiring
set sensor enabled true
set sensor enabled false
DisablingBecause the sensor stopsdriver readingsis andfixed broadcastsat whilebuild keeping all other
sensor settings intact.
Readingtime, the Currentwiring Sensorbelow Value
is sensorabout
readphysically Triggersconnecting ana immediatesupported I2C sensor reading and prints the result to the console:
BME280not @about 0x76telling
TemperatureMeshCore : 21.4 °C
Humidity : 58.3 %
Pressure : 1013.2 hPa
This is useful for verifying wiring andwhich sensor functionto duringuse. installationThese withoutI2C waitingfacts forare theaccurate nextregardless scheduledof
broadcast.firmware.
Viewing
sensor statusPrints the full sensor configuration and runtime state:
Sensor status
Type : BME280
I2C address : 0x76
Interval : 600 s
Enabled : true
Last reading: 21.4 °C / 58.3 % / 1013.2 hPa (42 s ago)
Error count : 0
A non-zero error count indicates I2C communication failures - check wiring and
address setting. An I2C bus scan (i2c scan) can help identify the
device address if unknown.
Temperature Calibration Offset
set sensor temp_offset <degrees C>
Applies a fixed offset to compensate for self-heating from the MCU or
enclosure. Common values are -1.0 to -3.0 for
sensors mounted close to a running MCU.
Example: set sensor temp_offset -1.5
To determine the correct offset, place the sensor alongside a calibrated
reference thermometer for 30 minutes in still air. The offset is:
reference_temp − reported_temp.
Wiring Reference:
BME280 / BME680 default I2C address: 0x76 when
SDO is tied low (to 0x77 when SDO is tied high (
For the cleanest integration,integration on the RAK4631, use the
RAK1906 WisBlock EnvironmentEnvironmental Sensor module (a Bosch BME680).
It plugs directly into a WisBlock Base Board sensor slot (Slot A, B, C, or D) with no soldering and no
I2C wiring -— the base board routes power and the shared I2C bus automatically.
If wiring a bare BME280BME280/BME680 breakout module to the RAK4631 GPIO header instead:instead, use
the WisBlock I2C1 bus:
| RAK4631 pin | |
|---|---|
| VCC | 3V3 (3.3 V — never 5 V) |
| GND | GND |
| SDA | |
| SCL | |
| SDO | GND ( |
| CSB | 3V3 (selects I2C mode) |
Keep I2C wires shortshort. (underIf 20you cmmust run the sensor on thean GPIOextended header)cable, and useadd
4.7 kΩ pull-up resistors on SDA and SCLSCL.
if
Where to Go Next
For the sensorauthoritative, current CLI command list see
docs.meshcore.io/cli_commands.
Sensor support is a compile-time firmware feature, so which sensors and keys are
available depends on anthe extendedspecific cable.build. For host-side integration, the
meshcore_py library and the MeshCore Home Assistant integration
(github.com/meshcore-dev/meshcore-ha, domain meshcore)
consume telemetry through the binary request/response protocol described above.