Construction of a VPN System for Remote Programming and Monitoring of Environmental Parameters for Serving Plant Production in Greenhouses

This article introduces a virtual private network (VPN) system deployed in a 70m operator station and greenhouse at Vietnam National University of Agriculture. The VPN system was not limited by geographical distance and allowed for remote monitoring of environmental parameters, viz. light (1016000lux), soil moisture (20-100%), temperature (20-60C), and ambient humidity (30-90%) with tolerances of ± 5% of the set/measured values. The signals from the sensor system were recorded with a sampling time of 6 seconds. The designed interface made it easy for Vietnamese users. The system was initially established, and tested successfully with Gerbera in the greenhouse. The VPN system allowed for remote programming, stable operation, and no loss of data during the signal collecting process, and allowed users to fully and quickly react when the system crashed or when the user needed to upgrade or maintain the greenhouse system.


Introduction
The application of high technology in agricultural production is of great interest in countries with harsh climates and scarce resources. There have been many studies that offer wireless solutions for sensor networks to exchange data or to provide control requests for remote systems such as Li et al. (2010) who introduced a monitoring system for plants in a greenhouse based on a wireless sensor network and the launching of an automated control system in a greenhouse based on wireless sensor networks using Zigbee (Park et al., 2011). Those studies have been applied in practice but have not been yet connected to generate a large network. There have also been several popular PLC (programmable logic controller) applications such as Martin et al. (2016) who managed a blueberry farm and monitoring system using a PLC based on a wireless sensor network; and Sindhu et al. (2016) who used a PLC for the purpose of designing, selecting, controlling, updating, and upgrading greenhouses. The biggest downside of those systems, however, is that they must have direct professional support from the manufacturer when the system commits errors. The direct support can increase the initial investment cost for the user as well as the time it takes to get professional assistance when the system is in operation.
Since 2010, the research and application of hi-tech systems in domestic crop production have been implemented but still on a small scale. An automatic control model was applied to a plant growth house in the area of Ho Chi Minh City in a study by Lam et al. (2012). In addition, research and development of automated monitoring systems for the growth and development processes of greenhouse crops, and applications in the production of high-tech flowers have also been studied (Duong et al., 2016). The above research articles have supported users by using a PLC-SIMATIC to control, monitor, and collect information of the systems through a screen interface in the greenhouse. Even so, users must frequently visit the greenhouse to control the systems, especially since if a problem occurs it will not be detected or treated in time if there is no one at the greenhouse. Quy et al. (2016) built an automatic smartphone model that automatically controls and monitors the greenhouse environment through a wireless transmit/receive module and STM microcontroller. The research team just released this model but it has not been applied in practice. In addition, with the use of microcontrollers in practice, the stability and reliability are not high, the rate of damage is high, replacement and program editing are complex, and the ability to upgrade peripheral equipment is limited.
According to the report of Vinh et al. (2014), they developed several multimedia services and monitored production environment parameters on the WIMAX telecommunications network in the Central Highlands. Then, Minh et al. (2015) improved the model and introduced a method for controlling and monitoring environmental parameters on a cloud computing platform via a wireless WIMAX telecommunication network. However, the system is susceptible to bad weather, and nearby radio waves can cause interference, data depletion, or disconnection of the transmission line leading to disruption of services to users. The Northern Electricity Corporation made a plan in 2015 to build a 110kV TBA electrical substation without human monitoring and a remote controller center by 2020. The scheme uses the IPsec VPN peers protocol as an internal network but it is still undergoing testing. Because of the outstanding advantages of VPNs, in the near future, it is going to become a popular technology.

Installation of the VPN system
The layout of the whole system is shown in Figure 1.
Here, the VPN technology required the IP address to be in the 2 LAN (local area network site) which was not the same as the network layer. Two Vigor modems were connected via the internet through the tunnel of the VPN.
The operator station was located at the Vietnam National University of Agriculture.
The computer at the operator station was connected to the Vigor 2910 modem (dial-in) and had to be attached to 1 network layer that the Vigor 2910 modem (dial-in) created. The modem (dial-in) was configured with the FTP network.
The greenhouse was located at the Vietnam National University of Agriculture. The PLC was connected to the Vigor 2910 modem (dialout) with the IP address belonging to the same network layer as the Vigor 2910 modem (dialout). The modem (dial-out) was configured with USB 3G.
The VPN system could connect the LAN to LAN directly through the FPT network or could connect HOST to LAN via an external network to monitor the test environmental parameters in the greenhouse. Figure 2 reveals information on the selection and installation of the sensor types to the CPU and expansion module to help collect the parameters of soil moisture, light intensity, temperature, and environment humidity. The signals received were processed through the CPU and then sent to the operator station via the VPN.

Web server application of the PLC for monitoring environmental parameters
Users could access the webserver interface of the PLC via the name domain. The design and construction of the environmental parameter monitoring interface was based on appropriate requirements that were convenient for Vietnamese people to use. On the basis of the parameters measured from the sensors, the data were pushed onto the PLC's webserver interface for remote monitoring by the user.

Running tests and adjustment of the monitoring system
Implementation of installation, running tests, monitoring, and remote programming of the system were conducted at the greenhouse and the operator station of the Vietnam National University of Agriculture. The tests were completed in order to check and adjust the quality of the system to ensure accuracy and stability at the experimental site. The goals of the tests were to evaluate and analyze the growth environment of crops based on the data of the parameters to improve the system and to develop the best ecosystem for greenhouse crops.

Selection of system installation
Sensor system DHT11 sensors were used to measure the environmental temperature and humidity. The DHT11 sensors had a structure of 4 legs. It used digital interface/serial communication with a 1wire standard. The DHT11 parameters included the tolerances of 1% RH and 1 o C. The accuracy of the air humidity measurement at 25 o C was ± 4% RH, at 0-50 o C ± 5% RH, and the maximum temperature was ± 2 o C.
The humidity sensor consisted of a soil humidity sensor and a sensor module. The probe was plugged into the ground to detect moisture; and when the soil moisture reached the set threshold, the DO output moved the status from a low to a high level. When the humidity sensor module was activated, there was a voltage change at the input of the IC LM393.
The light intensive sensor had high accuracy using optical resistors and IC LM393. Optical or photodiode resistors, also known as LDR (light-dependent resistor) or photoresistors, are photoelectric elements made from a polycrystalline semi-conductor material but without a p-n junction semiconductor. As light rays fall onto the photoresistors, they release valuable electrons from the crystal lattice of the semiconductor and cause them to travel like free electrons and increase electrical conductivity, reducing the electrical resistance of the irradiation of light (Dieu, 2008). The LDR fabrication material was a CdS (cadmium sulphide) semiconductor, and very sensitive to the visible light spectrum. In the dark, the LDR photoresistor had an electrical resistance of some MΩ. When there was light, the electrical resistance decreased to a few hundred Ω. This was a nonlinear electrical resistance. With a measurement range of 10-15000lux, the electrical resistor in the dark was 1MΩ. The PLC S7-1200 CPU 1214C AC/DC/RLY (Code 214-1BG31-0XB0) consisted of four basic components: processor, memory, power supply, and interface in-output. The CPU 1214C AC/DC/RELAY was integrated locally with the 14DI/10DO/2AI. The CPU 1214C had a physical size of 110 x 100 x 75mm.
The Vigor 2910 had 4 LAN ports, one WAN port, and one USB port for the 3G modem. The Vigor 2910 can load from 20 to 30 devices and at the same time support the transmission line up to 35Mbps and support the USB modem with HSDPA standard that can reach up to 1Mbps of a 3G mobile phone network system. The main WAN port of 10/100BaseT Ethernet connected to the Internet via an ADSL modem.

Connection of the VPN system VPN LAN to LAN
Here, the authors group performed a ping to the Vigor modem (dial-out) via the LAN to LAN. The sending of several ICMP information packets from the computer connected to the Vigor (dial-in) at the operator station via a VPN transmission line to a Vigor (dial-out) modem that received and responded to the signal indicated that the connection of the VPN LAN to LAN through two Vigor modems was successful ( Figure 6A). Figure 6B shows the receipt and response from the PLC in the greenhouse to the operator station via the VPN. The Ping to the IP PLC was successful ( Figure  6B).

VPN Host to LAN
The Host to LAN connection test was set up on a 3G enabled smartphone named "Green House 1". The connection system was quite stable, and the test was held for about 20 minutes, providing the user enough time to monitor the entire operation of the environment in the greenhouse (Figures 7A and 7B).

Connect TIA to PLC
The TIA connection on the computer at the operator station with the PLC at the greenhouse was performed in the form of the LAN to LAN. When using TIA software on a LAN we could go online to a PLC on another LAN. The successful connection is shown in Figure 8.

Remote programming
When connecting, going online or otherwise connecting successfully to the PLC via the VPN, the programming proceeded as normal. Figure 9 shows how to successfully load the TIA program onto the PLC via the VPN. The program loading time was stable, and there were no data loss or errors during program loading.

Monitoring results from sensors
Below are some pictures of the signals measured from the sensors on April 28, 2018 in the greenhouse at Vietnam National University of Agriculture. With a 6s sampling time, the system received continuous signals from the sensors. The red line represents the signal of sensor 1, and the green line is the signal received by sensor 2.
TIA program display allowing for the management of the PLC from the operating station Optimization of chlorogenic acid extraction from green coffee beans using response surface methodology

350
Vietnam Journal of Agricultural Sciences Soil moisture monitoring signals (Figures 10 A-D): oil moisture monitoring signal at oil moisture monitoring signal oil moisture monitoring signal oil moisture monitoring signal

Light intensity monitoring signals (Figures 11 A-D):
Light intensity monitoring signal ight intensity monitoring signal ight intensity monitoring signal Light intensity monitoring signal Environmental humidity monitoring signals (Figures 12 A-D): Environmental humidity monitoring signal at Environmental humidity monitoring signal nvironmental humidity monitoring signal nvironmental humidity monitoring signal Environmental temperature monitoring signals (Figures 13 A-D The environmental parameters in a covered greenhouse at Vietnam National University of Agriculture (April 28, 2018) show that the signals measured from the sensors sent to the operator station were relatively stable and had errors within the allowed range (Tables 1-4). The standard sampling devices used here were similar to the study by Duong et al. (2016).
The results received from the sensors through the VPN show a reliable signal, which allowed the user to master the system as desired. Signal transmission through the VPN was stable, and no signs of loss of transmission or weak signals due to external factors at the greenhouse of Vietnam National University of Agriculture were detected.

Conclusions
The sensor parameters were recorded with a sampling time of 6 seconds, and the visual expression interface made it easy for the Vietnamese users to safely and quickly monitor the wireless parameters at the limits allowed for light (10-16000lux), soil moisture (20-100%), temperature (20-60 o C), and ambient humidity (30-90%) with tolerances of ± 5% of the measured values.
Improving the system and fixing random incidents is essential to deal with the everchanging complexity of the environment. In particular, dealing with unusual situations or upgrading changes to the system need to be strengthened. Therefore, the development of remote monitoring features and remote programming applying VPN technology allows users to react completely and quickly when the system crashes or users need help from the outside.