However, when they tried to connect to the groov RIO modules through CoDeSys, they discovered the latency was too great for the connection to be maintained. Naturally, there were also some security concerns since communication to two of the modules required opening ports in the fire station’s firewall.
In response, Bates’ team decided to flip their approach. Instead of scanning all the remote I/O at high resolution from the main controller, they connected these three sites to an MQTT broker using the modules’ native MQTT publishing capabilities. They chose to use HiveMQ’s cloud-native MQTT broker, which allows 100 MQTT clients to communicate for free, keeping maintenance costs down for the district.
MQTT clients publish data only when they change, so Pinebrook wouldn’t need a high-speed, always-on connection to get accurate data. And because MQTT connections always originate from the edge device, Rust wouldn’t have to open firewall ports to allow inbound connection requests to the groov RIO modules.
Integrating MQTT data into the main control program was simple using the MQTT client library for CoDeSys. The MQTT functions allowed the groov EPIC controller to subscribe to all the data in the MQTT broker and integrate it directly into the control program like native tags.
“Reliability was more important than performance,” says Bates. “Updates even every 10 minutes would have been acceptable in this case. It gave us some wiggle room to slow down scan rates, so we hit the broker probably only once a minute.”
To accommodate Pinebrook’s budget, Rust opted not to install a full SCADA (supervisory control and data acquisition) system. Instead, Bates’ team built all the control, communication, and visualization into the edge controller. Since the Pinebrook district was managed completely without automation prior to this project, Rust needed to design a visual interface for the new control network. To keep costs down and simplify long-term maintenance, they decided to use the EPIC’s embedded HMI (human-machine interface) server, groov View.
In groov View, designers use a browser based editor with drag-and-drop components to build an HTML5-compliant display that can run on the EPIC’s touchscreen, an external display, connected mobile and desktop browsers, or on the groov View app. The groov View is included with groov EPIC for free, so it didn’t add to the cost of Pinebrook’s project. Development with groov View was quick for Rust to complete and easy for Pinebrook to maintain.
Rust used the Node-Red IoT (Internet of Things) programming environment (also preinstalled on groov EPIC) to format some of the data pulled from CoDeSys so that it displayed properly in the HMI. “The groov View system…uses OPC UA, so we could connect CoDeSys and groov View together pretty seamlessly and just drag and drop a lot of [the controls] on there,” says Bates.
The central edge controller was located within the Pinebrook water treatment plant, so Rust supplied it with additional I/O modules to connect to some of that equipment as well. The main HMI page displays field measurements like storage tank levels alongside raw water measurements from the treatment plant inlet. The middle of the display reflects analytical measurements of trace compounds like chlorine and manganese, along with the levels of the rivers in the community.