MeshCore Sensor CLI Reference
Overview
All sensor-specific settings are accessed through the MeshCore CLI over a
USB/serial connection (115200 baud) or via BLE using the MeshCore
mobile app. Commands are case-insensitive. Changes take effect immediately and
persist across reboots.
Setting the Sensor Type
set sensor type <type>
Valid types:
| Value | Sensor | Measurements |
|---|---|---|
bme280 | Bosch BME280 | Temperature, humidity, pressure |
bme680 | Bosch BME680 | Temperature, humidity, pressure, gas/VOC |
ina219 | TI INA219 | Bus voltage, shunt voltage, current, power |
Example: set sensor type bme280
Setting the I2C Address
set sensor addr <hex address>
Default addresses:
- BME280:
0x76(SDO/CSB tied low) or0x77(SDO/CSB tied high) - BME680: same as BME280 —
0x76default - INA219:
0x40default, configurable up to0x4Fvia A0/A1 pins
Example: set sensor addr 0x76
Setting the Broadcast Interval
set sensor interval <seconds>
Controls how often a sensor reading is taken and advertised on the mesh. Lower values increase power consumption significantly.
| Interval | Readings/day | Approx. daily consumption (nRF52840) |
|---|---|---|
| 60 s | 1 440 | ~20 mAh |
| 300 s | 288 | ~7 mAh |
| 600 s | 144 | ~5 mAh |
| 1800 s | 48 | ~3 mAh |
Example: set sensor interval 600
Enabling and Disabling the Sensor
set sensor enabled true
set sensor enabled false
Disabling the sensor stops readings and broadcasts while keeping all other sensor settings intact.
Reading the Current Sensor Value
sensor read
Triggers an immediate sensor reading and prints the result to the console:
BME280 @ 0x76
Temperature : 21.4 °C
Humidity : 58.3 %
Pressure : 1013.2 hPa
This is useful for verifying wiring and sensor function during installation without waiting for the next scheduled broadcast.
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 to RAK4631 (WisBlock)
For the cleanest integration, use the RAK1906 WisBlock Environment Sensor module. 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 I2C automatically.
| RAK1906 connection | Base Board pin | Notes |
|---|---|---|
| VDD | 3.3 V (slot rail) | Supplied by base board |
| GND | GND (slot rail) | |
| SDI (SDA) | I2C_SDA (slot rail) | Shared with other I2C devices |
| SCK (SCL) | I2C_SCL (slot rail) | |
| SDO | GND via slot rail | Sets I2C address to 0x76 |
| CSB | 3.3 V via slot rail | Selects I2C mode |
If wiring a bare BME280 breakout module to the RAK4631 GPIO header instead:
| BME280 pin | RAK4631 pin |
|---|---|
| VCC | 3V3 |
| GND | GND |
| SDA | I2C1_SDA (WB_I2C1_SDA) |
| SCL | I2C1_SCL (WB_I2C1_SCL) |
| SDO | GND (for address 0x76) |
| CSB | 3V3 (I2C mode) |
Keep I2C wires short (under 20 cm on the GPIO header) and use 4.7 kΩ pull-up resistors on SDA and SCL if running the sensor on an extended cable.
No comments to display
No comments to display