Using NetPing Devices to Solve the Issue of Registering Data from Water Flow Meters

  • Published In: Tutorial
  • Created Date: 2015-11-03
  • Hits: 716

Today the issue of automatic registering water flow data for a certain period of time is often topical. Such registering is necessary not only for plants and industrial manufacturers but also for a network of individual households, summer cottages, garages, apartment buildings. Automatic collection of data from water counters guarantees momentary and precise receiving of readings on water consumption from each metering device. A system excludes errors in manual writing readings of meters and makes a staff of walkers, who control a regularity of giving information from counters, unnecessary.

To organize transferring and registering data on water flow from water meters, there is a need to have a corresponding infrastructure of transferring data and a remote system for analysis and registering readings. It is possible to use a NetPing device with input-output lines, which allows to plug in water consumption meters with a pulse output and Ethernet ports for connecting to a local network with the aim to transfer data into the analyzing and metering system as a main element of the data transfer infrastructure.

This article will represent a creation of a system for metering a remote water consumption, built on the basis of the device NetPing IO v2 (it is also possible to use a device UniPing v3 for this task), a water meter with a pulse output and Zabbix monitoring system. This system of a remote metering of water consumption allows to take readings from a pulse output of a meter remotely, which can later be sent to the PC or a server to gather data, statistics, analytics and forming invoices for payment.

NetPing - report on water consumption in Zabbix

Requirements to the System of a Remote Metering of Water Consumption

To organize remote water consumption metering from meters, which is necessary when forming, for example, a monthly water payment, there is a need to have:

  • a device for a remote monitoring NetPing IO v2 or UniPing v3;
  • water consumption meters with a pulse output;
  • a PC or a server to gather and store information with an installed Zabbix monitoring system;
  • a local/global data transfer network

General Operation Principle

Water flow meters equipped with pulse outputs will be used as water flow metering devices in the system. A pulse output of a meter is connected to an IO line of NetPing IO v2 device or UniPing v3 device.Only one meter can be connected to each IO line. As a result, a NetPing IO v2 device supports connecting of up to four water consumption meters, and a UniPing v3 device supports connecting of up to sixteen water consumption meters. NetPing IO v2 (UniPing v3) reads pulses from a pulse output of a meter and saves readings to an embedded nonvolatile flash memory. It is possible to read data for gathering and storing information in metering and monitoring systems from a device NetPing IO v2 (UniPing v3) via TCP/IP network. For example, it can be used to meter a monthly fee for water supply or analyze the data on consumption for different time intervals: a day, a week, a month, a year, etc.

Visual Scheme of Connecting a Water Meter with a Pulse Output to a NetPing Device

Visual Scheme of Connecting a Water Meter with a Pulse Output to a NetPing Device

Configuring a NetPing Device

There is a need to perform a certain configuration to use a NetPing IO v2 (UniPing v3) device in metering water consumption data.

At first, NetPing IO v2 (UniPing v3) needs configuration of network parameters for a device to successfully send data via the network from a meter into Zabbix monitoring system. The information on configuring network parameters can be read in a corresponding section of firmware description for a NetPing IO v2 device.

The second step of configuring is setting parameters of a device, which are written into memory using an SNMP protocol. To do this, the MIB browser «iReasoning MIB browser» will be used. More detailed information on using firmware «iReasoning MIB browser» can be read in the article «What Are MIB Files?» in NetPing company's blog. In this article only a configuration of necessary parameters for describing a metering system of a water consumption is represented.

Let us suppose that «iReasoning MIB browser» is already installed on a PC. Hence, there is a need only to start it and specify settings to connect software to a NetPing IO v2 (UniPing v3) device, which were set at the previous step.

An IP address for connecting to a device is specified in the field «Address:».

Connecting to a NetPing device via the iReasoning MIB browser

SNMP port, Community reads/writes and an SNMP protocol version, which is supported by a NetPing IO v2 (UniPing v3) device, are configured in additional settings of software connection, by clicking the button «Advanced...».

Configuring the iReasoning MIB browser to connect to a NetPing device

where:

Address – is a current IP address, which is specified in a web interface of a NetPing IO v2 (UniPing v3) device at the page «SETUP». An IP address 192.168.0.100 is used in the example.
Port – is a port of an SNMP agent, which is specified in a web interface of a NetPing IO v2 (UniPing v3) device at the page «Setup». The port 161 is used in the example.
Read Community – is a password, which is specified in a web interface of a NetPing IO v2 (UniPing v3) device at the page «Setup». It is used to authorize a user while reading device parameters. In the example, SWITCH is used.
Write Community – is a password, which is specified in a web interface of a NetPing IO v2 (UniPing v3) device at the page «Setup».  It is used to authorize a user while checking device parameters during recording. SWITCH is used in the example.
SNMP Version – is a choice of the SNMP protocol version. A device NetPing IO v2 (UniPing v3) supports SNMP v1.

Now, when the connection parameters are set, there is a need to download a specific MIB file with a description of all OID (object identifier of a device) to «iReasoning MIB browser». It is possible to download the MIB file for NetPing IO v2 in the section «Documentation and Files» at the web page with a description of a device at the NetPing company's website. To do this, there is a need to go to the menu «File» > «Load MIBs» and choose an already downloaded MIB file from a local PC disk:

Download MIB file for NetPing device in iReasoning MIB browser

After the MIB file has been successfully downloaded, a hierarchic (tree) structure with its SNMP OID will be displayed in the software area «SNMP MIdBs»:

View OID for NetPing in iReasoning MIB browser

Now let us describe an internal operation principle of gathering data from a water consumption meter by a device NetPing IO v2 (UniPing v3) to understand what parameters must be configured. Let us suppose a meter with a pulse output is connected to the line IO1 of a device NetPing IO v2 (UniPing v3). While a water consumption meter is working, a pulse counter on the line IO1 (OID «npIoPulseCounter.1») registers a number of pulses in its memory. A pulse counter is stored in a volatile memory hence when switching a power supply off at NetPing IO v2 (UniPing v3) a pulse counter of an IO line resets its value to zero. To eliminate the issue of resetting a number of pulses at an IO line, company's developers implemented a data storage in a nonvolatile memory. I.e. values of a pulse counter, written into SNMP OID «npIoPulseCounter», are saved in SNMP OID «npElecEnergy» once in three minutes, but with a conversion factor for pulses «npElecPulsesPerKwh». And the values of «npElecEnergy» are stored in a nonvolatile memory of a device.

Therefore, to configure NetPing IO v2 (UniPing v3) correctly, there is a need to set a coefficient «npElecPulsesPerKwh» to 1. This means that the values registered by a pulse counter of an IO line «npIoPulseCounter», will be recorded into the variable «npElecEnergy» without being divided by a conversion factor for pulses «npElecPulsesPerKwh».

To set a conversion factor for pulses to 1, there is a need to choose the branch «npElecPulsesPerKwh» in the hierarchic structure and read its current values by sending a command «Get Subtree».

Reading the pulse conversion factor for a NetPing device

As a result, the software will represent conversion factors for pulses of all IO lines. On default, a coefficient is 3600. Choose a coefficient for the line IO1 «npElecPulsesPerKwh.1» out of the list, and click a context menu by a right button of a mouse and click «Set»:

Setting the conversion factor for the NetPing device

The window «SNMP SET» will be opened to fill in the parameters. After setting the parameters in the window represented at a screenshot below, there is a need to click the button «Ok» to save.

The coefficient count pulses NetPing

Conversion factors for pulses of the line IO1 are configured.

The last step of configuring a NetPing IO v2 (UniPing v3) is setting an IO line into the input mode. To do this, there is a need to go to the page «Discrete IO» of a device web interface, and in the section «IO Mode» choose the «input» mode for the line IO1. Save the parameters by clicking the button «Apply changes»:

UniPing v3 - input mode for the line IO1

Configuring Zabbix Monitoring System

Get authorized as an account with administrator's rules in a web interface of Zabbix monitoring system.

Authorization on the Zabbix web-interface

Add a device NetPing IO v2 (UniPing v3) into a monitoring system. To do this, go to the section «Settings» > «Network Nodes» and click the button «Create host».

Create host in Zabbix

In a window that appeared for configuring, enter parameters of a new network node that are necessary to be set, which are indicated at a screenshot. Then click the button «Save».

Create host in Zabbix

where:

Hostname – is a unique name of a network node in Zabbix. Letters and numbers are allowed as well as spaces, dots, and underlining.
Group – is choosing groups of network nodes, which will incorporate a network node. A network node must be of at least the same group.
SNMP Interfaces – is an interface, which allows to request a device via an SNMP 
protocol. There is a need to indicate IP address and an SNMP agent port, which are written in a web interface of a NetPing IO v2 (UniPing v3) device at the page «Issues».

 As a result, the newly created device will appear in the list of network nodes as well as a created device «NetPing IO v2».

Host list in Zabbix

For Zabbix, there is a need to provide data elements to request NetPing IO v2 (UniPing v3) via the Ethernet network and calculate a consumption of water for different periods of time. Data elements are created in the next way: in the list of already created network nodes, click the button «Data elements», corresponding to a device NetPing IO v2.

Items in Zabbix

In a window with a list of data elements, click the button «Create Data Elements» to create a new data element.

Create Data Elements in Zabbix

Fill in the fields as shown at the screenshot:

Item in Zabbix

where:

Name – is a name of a data element in Zabbix.
Type – is a parameter, which determines the method of requesting data elements.
Key – is a unique name of a key data element within the limits of one node.
Host interface – is a dropdown list with network node interfaces, which were previously configured.
SNMP OID – is a numeric identifier of an object. In the example, SNMP OID «.1.3.6.1.4.1.25728.9700.1.1.4.1» («npElecEnergy.1») is indicated. OID  can be browsed at the MIB file in corresponding device NetPing IO v2 (UniPing v3) or in a description of software via the link at a description page of a device in the section «Documentation and files».
SNMP community – is a password, specified in a web interface of a NetPing IO v2 (UniPing v3) device at the page «Settings». It is used to check reading parameters of a device.
Type of information – is a type of storing data in the Zabbix database after performing transformations, if there are any.
Data type – is used for integer data elements to determine a type of expected data. A type «Decimal» determines data in decimal format.
Units – if a character of a measurement unit is set, Zabbix will add post-processing of a received value and will display it with a specified postfix of a measurement unit.
Use custom multiplier – is a number, on which the values received by Zabbix from a device, will be multiplied. In the example, a custom multiplier is set to 0.01, because it was considered appropriate for a counter to close a contact (register a pulse) when a water consumption is 0.01 cubic meters.
Update interval (in sec)  is the update of the data element each N seconds. In the example, an interval is set to 180 seconds because a NetPing IO v2 (UniPing v3) device saves readings of a pulse counter of an IO line into a nonvolatile memory once in three minutes.

As a result, a data element, which receives readings of a water consumption, registered since the beginning of a meter operation, has been configured. I.e. these readings correspond to displayed  readings of water consumption at the dial plate of a meter.

Let us configure a calculated data element, which will determine a water consumption per month. To do this, in a window with a list of data elements, click the button «Create data elements» and fill in the fields as it is shown at the screenshot below:

Item in Zabbix

where:

Name – is a name of a data element in Zabbix.
Type – is a parameter which determines a method of requesting a data element.
Key – is a unique name of a data element key within one node.
Formula – is an arithmetic expression for calculating necessary readings on the basis of other data elements. The formula max("npElecEnergy.1",2678400)-min("npElecEnergy.1",2678400) calculates the difference between a maximum and a minimum values per month (2674400 seconds), received at the data element «Water meter - current readings (NetPing NVRAM)». More detailed information about configuring calculated data elements can be read at the official documentation on Zabbix.

As a result, a calculated data element has been configured, which calculated readings of water consumption per month.

To receive readings of water consumption for other periods of time, (hour, day, week, etc.), there is a need to add calculated data elements similar to already configured data element «Water meter - consumption per month».

A calculated element of data for water consumption per hour:

A calculated element of data for water consumption per hour in Zabbix

where:

Name – is a name of a data element in Zabbix.
Type – is a parameter, which determines a method for requesting a data element.
Key – is a unique name of a key data element within the limits of one node.
Formula – is an arithmetic expression for calculating necessary readings on the basis of other data elements. The formula max("npElecEnergy.1",3600)-min("npElecEnergy.1",3600) calculates the difference between a maximum and a minimum values per hour (3600 seconds), received in the data element «Water meter  - current readings (NetPing NVRAM)». More detailed information on configuring calculated data elements can be read in the official documentation on Zabbix.
Update interval (in seconds) – is updated each N seconds. In the example an interval is set to 3600 seconds, i.e. water consumption will be calculated every hour.

Calculated data element for water consumption per day:

Calculated data element for water consumption per day in Zabbix

where:

Name – is a name of a data element in Zabbix
Type – is a parameter, which determines a method for requesting data.
Key – is a unique name of a key data element  within the limits of one node.
Formula is an arithmetic expression for calculating necessary readings on the basis of other data elements. The formula max("npElecEnergy.1",86400)-min("npElecEnergy.1",86400) calculates the difference between a maximum and a minimum values per day (86400 seconds), received in the data element «Water meter  - current readings (NetPing NVRAM)». More detailed information on configuring calculated data elements can be read in the official documentation on Zabbix.
Update interval (in sec) – 
is updated each N seconds. In the example an interval is set to 86400 seconds, i.e. water consumption will be calculated once a day.

Calculated data element of a water consumption per week:

Calculated data element of a water consumption per week in Zabbix

where:

Name – is a name of a data element in Zabbix.
Type – is a parameter, which determines a method for requesting data element.
Key – is a unique name of a key data element within one node.
Formula – is an arithmetic expression for calculating necessary readings on the basis of other data elements. The formula max("npElecEnergy.1",604800)-min("npElecEnergy.1",604800) calculates the difference between maximum and minimum values per week (604800 seconds), received in the data element «Water meter - current readings (NetPing NVRAM)». More detailed information on configuring calculated data elements can be read at official documentation on Zabbix.
Flexible intervals – this data element is updated in each configured interval d-d,hh:mm-hh:mm, where d-d: day of the week (1 - Monday, 2 - Tuesday ,… , 7 - Sunday), hh: clock (00-24), mm: minutes (00-59). In he example a flexible interval is set to 60 seconds each first day of the week from 00:00 to 00:01, i.e. water consumption will be calculated each Monday from 00:00 to 00:01.

As a result of settings described above, the next data elements have been received:

Items in Zabbix

Now it is possible to add graphs of current readings of meter and water consumption for periods of time. To do this, click the link «Graphs» in the window with a list of data elements.

Graphs in Zabbix

In the window «Configuration of Graphs» create a graph for current readings of a water consumption meter by clicking the button «Create graph».

Configuration of Graphs in Zabbix

In the window for creating a new graph, there is a need to enter the next parameters:

Configuration of Graphs in Zabbix

where:

Name – is a unique name of a graph.
Items – is a choice of data elements, values of which will be displayed in this graph. In the example for representing current readings of a water consumption meter, there is a need a to click the link «Add» and choose the item «Water meter - current readings (NetPing NVRAM)» from the list of items that appeared.
Function – a parameter defines which values will be represented in a graph when there is more than one value for a data element. In the example, there is a need to choose Show maximum values.

Graphs for other data elements, which are designed to display a water consumption per different periods of time are adjusted similarly.

As a result, the next graphs are added to the Zabbix monitoring system:

Graphs are added to the Zabbix monitoring system

Graphs and Reports in Zabbix

As a result of configurations described above, it is possible to browse graphs and reports on water consumption for necessary time intervals in Zabbix monitoring system. For example, there is a need to go to the section «Monitoring» > «Graphs», choose a necessary group of network nodes «Discovered hosts», a network node «NetPing IO v2» and the graph «1. NetPing IO v2: Water meter - current readings», to browse a graph of current readings of water consumption meter.

A graph of current readings of water consumption meter in Zabbix

As a result, a graph of current readings of water consumption meter will appear, which corresponds to readings of water consumption on the dial of the meter.

A graph of current readings of water consumption meter in Zabbix

Other configured graphs are displayed the same.

A graph of current readings of water consumption meter in Zabbix

A graph of current readings of water consumption meter in Zabbix

A graph of current readings of water consumption meter in Zabbix

A graph of current readings of water consumption meter in Zabbix

In addition, Zabbix monitoring system allows building bar reports. To build such report, there is a need to go to the section «Reports» > «Bar reports» and choose a report type «Distribution of values for multiple periods».

Distribution of values for multiple periods in Zabbix

Then it is possible to form a report for water consumption in 2015 by months. To do this, there is a need to fill in parameters of a report the next way:

Fill in parameters of a report in Zabbix

where:

Title – a parameter sets a name of a report.
Period  – indicates a start and an end of the period of showing data in the report.

Items – a set of data elements, which need to be represented in a report. When adding a previously configured items to a report, choose a function of showing only maximum values.

As a result of settings, a bar report on water consumption in 2015 by months will be displayed:

NetPing IO v2 - Water meter - Water Consumption per Month in Zabbix

Other bar reports can be adjusted similarly:

NetPing IO v2 - Water meter - Water Consumption per Week in Zabbix

NetPing IO v2 - Water meter - Water Consumption per Day in Zabbix

NetPing IO v2 - Water meter - Water Consumption per Hour in Zabbix

In addition, it is possible to implement sending e-mail reports on water consumption for required periods of time in Zabbix monitoring system. In this case, gathering data and sending reports is implemented by a written script, which will be executed n a server with an installed Zabbix monitoring system.

Conclusion

A system for a remote registering of water consumption, which is described in the example, is built on the basis of a NetPing IO v2 (UniPing v3) monitoring device, a water consumption meter with a pulse output and Zabbix monitoring system allows to fully organize the collection and storage of data. The system provides a possibility to analyze and estimate received data, allows sending e-mail notifications to necessary staff and form bills for payment for water consumption.


comments powered by Disqus