Skip to main content

Level Probe — Configuration

Configuration Parameters​

In addition to the GW4 configuration parameters the add-on has the following specific parameters:

Modbus Reading​

KeyTypeDefaultDescription
modbusInternalAddressNumber250Modbus address for internal gateway sensors
addonAccumulateNumber1Readouts to accumulate before upload (1–60) ¹
modbusCmdConfString—Modbus interface parameters and list of commands
loraFormatNumber5LoRaWAN payload format
PowerOnDelayNumber1000Wait time in ms before executing commands (0–60000)
PwrAfterBrownoutDurNumber0Seconds to power Modbus after first power-on (0–3600)

¹ The range 1–60 applies to the Modbus and M-Bus variants. Other variants have different limits: DIN-Rail 15, Gateway V4 + Ethernet 15, Poti 100, 4-20 mA 200.

modbusCmdConf​

Specifies the interface parameters and list of Modbus requests, separated by :. Interface parameters are A (ASCII) or R (RTU), baudrate, and serial settings, separated by ,. See Modbus Config Generator for details.

Set to empty to disable Modbus functionality.

Interface parameters (RS-485):

SettingValues
ModeR (RTU), A (ASCII)
Baudrate1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
Data bits7, 8, 9
ParityN (none), E (even), O (odd)
Stop bits1, 2

Data bits, parity and stop bits are written as one token, e.g. 8N1 or 7E1.

Commands are raw Modbus requests of 12 hex characters without CRC, e.g. 010300020002. Multiple commands are separated by ,.

Supported function codes: 01 Read Coils · 02 Read Discrete Inputs · 03 Read Holding Registers · 04 Read Input Registers. The gateway operates as Modbus master and only reads from the slaves; write commands are not supported.

Example — RTU, 9600 baud, 8N1, two requests to device address 1, one to internal address 250:

R,9600,8N1:010300020002,010300060002,FA0400050001

Multiple UART configurations: several interface groups can be combined in one modbusCmdConf, separated by ;. Each group has its own mode (A/R), baudrate and serial settings, so slaves with different UART settings on the same RS-485 bus can be read in one cycle.

Example: one group in ASCII with 2400 baud 8E1, one group in RTU with 9600 baud 8N1:

A,2400,8E1:080300000001;R,9600,8N1:080300000001

modbusInternalAddress​

Modbus slave address under which the gateway exposes its own internal measurements, so they can be queried with the same modbusCmdConf syntax as external slaves:

  • Internal gateway temperature
  • Supply voltage measurement

This is a virtual address handled inside the gateway: requests to it in modbusCmdConf are answered internally and never sent on the RS-485 bus. The gateway does not respond to this address for other masters on the bus.

The default 250 is chosen because Modbus addresses 248–255 are reserved by the Modbus specification and are therefore never used by real slave devices. This avoids address conflicts with meters and sensors on the bus.

loraFormat​

Specifies the LoRaWAN payload format for Modbus uplinks. Available in app-nrf91-origin since at least v0.10.x.

ValueFormat
1Verbose
4Compact with timestamp
5Compact without timestamp (default)
Not the same as PayloadFormat

loraFormat is specific to Modbus over LoRaWAN. It is unrelated to PayloadFormat, which defines the encoding of wireless M-Bus LoRaWAN uplinks. Both parameters can be present on the same device and are configured independently.