Skip to main content

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:

    Sensor support is a compile-time feature. Which sensor (if any) a node uses is selected when the firmware is built — there is no runtime command to pick or configure a sensor driver. A build only has sensor support if it was compiled with it (e.g. the 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 accessedCompanion, Repeater, and Room Server. The entire sensor CLI is three commands: a generic key/value store — 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:

    ValueCommandSensorMeasurementsWhat it does
    bme280sensor list [start]BoschLists BME280Temperature,the humidity,sensor pressurecustom variables as key=value lines (optionally starting from an index).
    bme680sensor get <key>BoschPrints BME680Temperature,the humidity,current pressure,value gas/VOCof one sensor variable.
    ina219sensor set <key> <value>TISets INA219Busthe voltage,value shuntof voltage,a current,sensor powervariable.

    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:

      BME280: 0x76 (SDO/CSB tied low) or 0x77 (SDO/CSB tied high) BME680: same as BME280 - 0x76 default INA219: 0x40 default, configurable up to 0x4F via A0/A1 pins

      Example:, 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.

      IntervalCommandReadings/dayApprox. daily consumption (nRF52840)Purpose
      60set sname <name>1Set 440~20the mAhnode name.
      300set stx <dbm>288~7Set mAhtransmit power in dBm.
      600set sradio <freq>,<bw>,<sf>,<cr>144~5Set mAhradio parameters. Requires a reboot to apply.
      1800get s<key>48Read a device setting.
      advert~3Send mAhan advert immediately. set 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
       read
      physically

      Triggersconnecting ana immediatesupported I2C sensor reading and prints the result to the console:

      board,
      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 Status
      sensor status

      Prints 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 RAK4631GND), or 0x77 when SDO is tied high (WisBlock)to VCC). The BME680 uses the same addressing as the BME280. BME280 measures temperature, humidity, and pressure only (no gas / air quality). The BME680 adds a VOC gas / IAQ sensor. Power the sensor from 3.3 V, not 5 V. The BME280/BME680 and the nRF52/ESP32 I2C pins are 3.3 V devices; applying 5 V (or driving 5 V logic onto the 3.3 V SDA/SCL lines) can permanently damage the sensor or the MCU.

      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.

      The
      RAK1906 connectionBaseis Board pinNotes VDD3.3 V (slot rail)Supplied by base board GNDGND (slot rail) SDI (SDA)I2C_SDA (slot rail)Shared with otheran I2C devicesmodule SCKand (SCL)I2C_SCLcan (slotgo rail)in SDOGNDany viaof the I2C sensor slots; slot railSetsA I2Cis addressjust toa 0x76convenient CSB3.3default. V via slot railSelects I2C mode

      If wiring a bare BME280BME280/BME680 breakout module to the RAK4631 GPIO header instead:instead, use the WisBlock I2C1 bus:

      BME280Sensor pinRAK4631 pin
      VCC3V3 (3.3 V — never 5 V)
      GNDGND
      SDAI2C1_SDA (WB_I2C1_SDA)WB_I2C1_SDA
      SCLI2C1_SCL (WB_I2C1_SCL)WB_I2C1_SCL
      SDOGND (forselects I2C address 0x76)0x76; tie to 3.3 V for 0x77)
      CSB3V3 (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

      running

      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.