Live monitoring · Connect your hardware

Modbus monitoring for farm equipment

The serious equipment on a farm already measures itself. Energy meters, inverters and pump drives all speak the same old, dependable language: Modbus.

In short

Modbus is a simple protocol in which one device asks another for the values in numbered registers. The Urvara gateway acts as the one that asks. It reads the registers you list, over RS-485 or the network, scales them into real units and sends them to Urvara as live readings. It never writes to a device.

The three ways to wire it

TransportWiringTypical equipment
Modbus RTURS-485 pair to a USB adapter on the gateway computerEnergy meters, pump drives, level and pressure transmitters
Modbus TCPEthernet or Wi-FiSolar inverters, controllers
RTU over TCPRS-485 to a serial-to-network converterRS-485 devices far from the gateway

What you tell the gateway

For each value you want, one entry in the gateway’s settings file:

SettingMeaning
TableHolding register, input register, coil or discrete input
AddressThe register number, counted from 0
Type16, 32 or 64-bit whole numbers, signed or unsigned, or 32 and 64-bit floating point
Word orderWhich half of a 32-bit value comes first
Scale and offsetTurns the raw number into real units

Manuals often print addresses with a leading digit. “40011” in a manual is holding register address 10. “30001” is input register address 0.

Details that save an afternoon

  • Serial speed from 1200 to 115200 baud; 9600 with no parity is the default.
  • Readings are taken every 10 seconds unless you set another interval.
  • Registers next to each other are read in one request, up to 120 at a time.
  • A device that answers with an error is reported in plain words in the gateway’s log.
  • Serial ports work on Linux and macOS. On other systems use RTU over TCP.

Read-only, on purpose

The gateway has no code that writes to a Modbus device. It cannot change a drive’s speed or an inverter’s settings. For equipment that costs as much as a pump drive, that is the safe default.

Works today
  • Modbus RTU, Modbus TCP and RTU over TCP.
  • All four register tables and eight number types.
  • Scaling, word order and per-bus timing.

Live farm has been tested with simulated devices on every route except USB. It has not yet been run with physical sensors in the field, so treat pin numbers, calibration values and radio set-ups as things to check on your own hardware.

Questions people ask

What is Modbus?

Modbus is a communication protocol from 1979 that is still the common language of industrial equipment. One device, the client, asks another for the contents of numbered registers, and the other replies. It runs over an RS-485 cable as Modbus RTU or over a network as Modbus TCP.

What do I need to read an energy meter over Modbus?

A meter with an RS-485 or network port, its register list from the manual, a USB to RS-485 adapter for serial meters, and a computer on the farm to run the gateway, such as a Raspberry Pi.

Last checked against the product: .

Design your farm before you build it.

Open Urvara in your browser. Lay out the land, connect the water and the power, and see what the checks say.