A Modularized IoT Monitoring System with Edge-Computing for Aquaponics

Aquaponics is a green and efficient agricultural production model that combines aquaculture and vegetable cultivation. It is worth looking into optimizing the proportion of fish and plants to improve the quality and yield. However, there is little non-destructive monitoring of plant growth in aquaponics monitoring systems currently. In this paper, based on the Internet of Things technologies, a monitoring system is designed with miniaturization, modularization, and low-cost features for cultivation-breeding ratio research. The system can realize remote monitoring and intelligent control of parameters needed to keep fish and plants under optimal conditions. First, a 32-bit chip is used as the Microcontroller Unit to develop the intelligent sensing unit, which can realize 16 different data acquisitions as stand-alone extensible modules. Second, to achieve plant data acquisition and upload, the Raspberry Pi embedded with image processing algorithms is introduced to realize edge-computing. Finally, all the collected data is stored in the Ali-cloud through Wi-Fi and a WeChat Mini Program is designed to display data and control devices. The results show that there is no packet loss within 90 m for wireless transmission, and the error rate of environment parameters is limited to 5%. It was proven that the system is intelligent, flexible, low-cost, and stable which is suitable for small-scale aquaponics well.


Introduction
The prototype of aquaponics came from fish farming in rice paddies which happened in ancient China [1]. Modern aquaponics systems integrate aquaculture, soilless cultivation, and modern agricultural information technology [2]. Ibtissame E. et al. [3] compared aquaponics with the hydroponic and the traditional method, pointing out the advantages of aquaponics systems in agricultural production. Aquaponics provides high-quality agricultural products while reducing the ecological impact. With the rapid development of science and technology, agricultural informatization has moved from traditional agriculture to smart agriculture mainly supported by Internet of Things technology [4]. The smart factory of aquaponics was proposed in recent years, which uses smart sensing, information control, and other Internet of Things (IoT) technology to achieve a low-cost, green cycle production model.
While aquaponic farming is an alternative agricultural method [5], the varying adaptability of species to the environment poses significant challenges for research in both academic and commercial sectors. To improve production efficiency as much as possible, it becomes indispensable to monitor and regulate the growth environment of fish and vegetables by using IoT technology. This technology when used alongside innovative agricultural techniques such as aquaponics can lead to new dimensions of food production [6]. Numerous technological studies have been undertaken in an effort to better handle this type of

•
We propose a modularized IoT monitoring system with edge-computing for aquaponics, which overcomes many problems of traditional handheld aquaponics systems, such as high latency, labor-intensive, low efficiency, and poor scalability.

•
We build an end-edge-cloud system architecture. Using Raspberry PI as an edge sensor, an edge image processing module is implemented, which enables the system to monitor plant growth conditions by deep learning without destruction.

•
We develop a WeChat Mini Program for the monitoring system, improving system management efficiency, and reducing cost. With the software platform, users can easily realize remote monitoring and control of the aquaponics system by smart cell phone.
This paper has the following structure and organization: First, in this section, cases and work related to traditional and modern aquaponics systems are discussed. Section 2 describes the overall architecture and functions of the monitoring system that we designed. The main hardware modules include intelligent sensing unit design, edge image processing module design, and so on are shown in Section 3. Section 4 presents the system software design. The tests and results are listed in Section 5. In Section 6, we summarize our research results, clarify the significance of the work, and analyze the prospects for future work.

System Architecture
When it involves high yields and quality, designing and managing a system for aquaponic is a difficult task. Due to a combination of a greenhouse and a symbiotic environment, the parameters and factors that must be controlled are diverse. [19]. Therefore, in light of the investigation and analysis of current research related to the aquaponics system, the aquaponics monitoring system is built based on embedded edge-computing and IoT technology to reach the full supervision and abnormal monitoring of water quality (temperature, pH, DO, etc.), planting environment (temperature, humidity, light intensity, etc.), and plant growth conditions (plant height, plant stem, leaf area, etc.). The general framework of the system was presented in Figure 1. planting environment, and plant growth conditions based on intelligent embedded technology and edge-computing. To overcome the impact of uploading speed and delay during processing a large amount of image data, an image edge-computing unit is introduced to the aquaponics system for monitoring growth conditions, such as plant height, plant stem, etc., which can improve the data transmission efficiency rapidly.
The contributions of our work are three-fold:  We propose a modularized IoT monitoring system with edge-computing for aquaponics, which overcomes many problems of traditional handheld aquaponics systems, such as high latency, labor-intensive, low efficiency, and poor scalability.  We build an end-edge-cloud system architecture. Using Raspberry PI as an edge sensor, an edge image processing module is implemented, which enables the system to monitor plant growth conditions by deep learning without destruction.  We develop a WeChat Mini Program for the monitoring system, improving system management efficiency, and reducing cost. With the software platform, users can easily realize remote monitoring and control of the aquaponics system by smart cell phone.
This paper has the following structure and organization: First, in this section, cases and work related to traditional and modern aquaponics systems are discussed. Section 2 describes the overall architecture and functions of the monitoring system that we designed. The main hardware modules include intelligent sensing unit design, edge image processing module design, and so on are shown in Section 3. Section 4 presents the system software design. The tests and results are listed in Section5. In Section 6, we summarize our research results, clarify the significance of the work, and analyze the prospects for future work.

System Architecture
When it involves high yields and quality, designing and managing a system for aquaponic is a difficult task. Due to a combination of a greenhouse and a symbiotic environment, the parameters and factors that must be controlled are diverse. [19]. Therefore, in light of the investigation and analysis of current research related to the aquaponics system, the aquaponics monitoring system is built based on embedded edge-computing and IoT technology to reach the full supervision and abnormal monitoring of water quality (temperature, pH, DO, etc.), planting environment (temperature, humidity, light intensity, etc.), and plant growth conditions (plant height, plant stem, leaf area, etc.). The general framework of the system was presented in Figure 1.  The IoT can empower systems and machines to communicate with each other and make decisions based on data without human intervention. In general, the architecture of IoT consists of three layers: Perception Layer (sensing), Network Layer (data transmission), and Application Layer (data storage and manipulation) [20]. In this paper, the perception layer mainly contains three parts: the environment sensing unit, the plant growth conditions sensing unit, and the intelligent control unit. The environment sensing unit used Wireless Sensor Network (WSN) technology to realize the collection of water quality and planting environment in the aquaponics system. The edge-computing module with image processing algorithms is introduced to the plant growth sensing unit, which can quickly obtain and upload the indicator data of plant growth and alleviate the network transmission load. Intelligent control unit enables remote control of equipment in aquaponics systems. The network layer uses Wireless Fidelity technology (Wi-Fi) to transmit the processed data to the server for storage via TCP-based Message Queuing Telemetry Transport (MQTT) protocol. The application layer includes the Ali-cloud server and WeChat Mini Program. MySQL database is deployed in the server for cloud storage, sending, and receiving of IoT data. The Mini Program can realize the functions of real-time monitoring, history data display, abnormal alarm, and remote control with the collected data.

Intelligent Sensing Unit Design
The overall framework of the hardware is shown in Figure 2. The perception layer uses the STMicroelectronics 32-bit family of microcontroller chip (STM32) as the MCU, whose periphery includes five major parts: fishpond water-quality monitoring module, planting environment monitoring module, plant growth conditions monitoring module, intelligent control module, and edge-computing module unit; the network layer uses ESP8266 for Wi-Fi wireless communication.
sion), and Application Layer (data storage and manipulation) [20]. In this paper, the perception layer mainly contains three parts: the environment sensing unit, the plant growth conditions sensing unit, and the intelligent control unit. The environment sensing unit used Wireless Sensor Network (WSN) technology to realize the collection of water quality and planting environment in the aquaponics system. The edge-computing module with image processing algorithms is introduced to the plant growth sensing unit, which can quickly obtain and upload the indicator data of plant growth and alleviate the network transmission load. Intelligent control unit enables remote control of equipment in aquaponics systems. The network layer uses Wireless Fidelity technology (Wi-Fi) to transmit the processed data to the server for storage via TCP-based Message Queuing Telemetry Transport (MQTT) protocol. The application layer includes the Ali-cloud server and WeChat Mini Program. MySQL database is deployed in the server for cloud storage, sending, and receiving of IoT data. The Mini Program can realize the functions of real-time monitoring, history data display, abnormal alarm, and remote control with the collected data.

Intelligent Sensing Unit Design
The overall framework of the hardware is shown in Figure 2. The perception layer uses the STMicroelectronics 32-bit family of microcontroller chip (STM32) as the MCU, whose periphery includes five major parts: fishpond water-quality monitoring module, planting environment monitoring module, plant growth conditions monitoring module, intelligent control module, and edge-computing module unit; the network layer uses ESP8266 for Wi-Fi wireless communication.  In Figure 2, the water-quality monitoring module includes pH sensors, water temperature sensors, DO sensors, signal amplification, and peripheral signal conversion circuits. The planting environment monitoring module includes temperature-humidity sensors, CO 2 sensors, light intensity sensors, and peripheral signal conversion circuits. The intelligent control module can remotely start/stop the pump, light, and alarm to accomplish the intelligent regulation of the system. The edge-computing unit is designed to perform localized calculations on image data for efficient acquisition of growth conditions data, realizing the continuous monitoring of the plant stem and plant height.

Sensor Selection
The small-scale aquaponics system mainly demonstrates the intelligent monitoring of three key indicators of aquaponics: DO, light intensity, and plant height. For other needs, users can also connect the required sensors to Input/Output (I/O) ports for real-time monitoring of more indicators.
Two types of DO measurement principles are commonly used: electrochemical electrodes and polarographic electrodes. In this paper, electrochemical electrodes were chosen because of their fast start-up and low-maintenance features. Moreover, the XC6206 voltage regulator and TP5551 zero-drift operational amplifier are used to design the signal conditioning module peripherally. The BH1750 is a digital light intensity sensor integrated chip with an input light range of 1-65535lx and a minimum error variation of ±20%. It mainly uses the photovoltaic effect generated by the internal photodiode to convert the light signal into an electrical signal for calculation. The Raspberry Pi camera module (Pi Cam) was released in May 2013 and is equipped with a 5 Mpixel sensor that can be connected to the Camera Serial Interface (CSI) on the Raspberry Pi easily. Considering that the small-scale aquaponics system is currently under exploration, part of sensing devices in the multi-sensing process, such as DO, light intensity, and CO 2 , are selected for system verification in this paper. The specific sensor selection results are listed in Table 1.

Edge Image Processing Module Design
Due to the limitation of serial port speed and data processing capability of the STM32, it is difficult to transmit and process image data remotely in an instant. Therefore, to deal with this problem, this paper integrated the image processing module based on Raspberry Pi for collecting growth conditions into the perception layer as the edge-computing device. Thus, the end-edge-cloud system architecture is constructed, and the edge image processing module is extended with flexible image data. A lightweight training model is installed on Raspberry Pi with the Pytorch framework. The deep learning algorithm is integrated to capture plant growth conditions within 10 s by performing target detection, target cropping, image enhancement, and binarization calculations on image data. In other words, the extraction of plant growth condition data can be done quickly, precisely, and nondestructively by shooting on site. The above processing results will be transmitted to the cloud storage through wireless communication. The structure of the edge image processing module is shown in Figure 3.
In this paper, the edge image processing architecture is based on the concept of edgecomputing. According to the Edge-computing Reference Architecture 3.0 (2018) [21], its basic architecture is shown in Figure 4. Edge-computing refers to processing the data on the device and very close to the device [22], which has better real-time monitoring, stability, and security compared to traditional cloud computing and can be proposed to surmount the problems caused by high latency and low bandwidth. The edge image processing module will complete the image data acquisition and analysis calculations in advance. STM32 is responsible for the automatic transfer of packaged data to the cloud. Accordingly, not only is the pressure of data explosion and stream relieved greatly but also the efficiency of information transmission is improved [23].  In this paper, the edge image processing architecture is based on the concept of edgecomputing. According to the Edge-computing Reference Architecture 3.0 (2018) [21], its basic architecture is shown in Figure 4. Edge-computing refers to processing the data on the device and very close to the device [22], which has better real-time monitoring, stability, and security compared to traditional cloud computing and can be proposed to surmount the problems caused by high latency and low bandwidth. The edge image processing module will complete the image data acquisition and analysis calculations in advance. STM32 is responsible for the automatic transfer of packaged data to the cloud. Accordingly, not only is the pressure of data explosion and stream relieved greatly but also the efficiency of information transmission is improved [23].

Data Acquisition Circuit Design
The sensor detection module consists of four parts: voltage stabilization, signal amplification, voltage following, and temperature compensation. The internal resistance of some composite electrodes is extremely high, for example, up to 10 12 Ω for glass electrodes. Since a high impedance input is required, the correct voltage signal can be obtained only when the input impedance of the op-amp is higher than the internal resistance of the sensor. The design uses a TLC4502 dual Operational Amplifier (Op-Amp) with an  In this paper, the edge image processing architecture is based on the concept of edgecomputing. According to the Edge-computing Reference Architecture 3.0 (2018) [21], its basic architecture is shown in Figure 4. Edge-computing refers to processing the data on the device and very close to the device [22], which has better real-time monitoring, stability, and security compared to traditional cloud computing and can be proposed to surmount the problems caused by high latency and low bandwidth. The edge image processing module will complete the image data acquisition and analysis calculations in advance. STM32 is responsible for the automatic transfer of packaged data to the cloud. Accordingly, not only is the pressure of data explosion and stream relieved greatly but also the efficiency of information transmission is improved [23].

Data Acquisition Circuit Design
The sensor detection module consists of four parts: voltage stabilization, signal amplification, voltage following, and temperature compensation. The internal resistance of some composite electrodes is extremely high, for example, up to 10 12 Ω for glass electrodes. Since a high impedance input is required, the correct voltage signal can be obtained only when the input impedance of the op-amp is higher than the internal resistance of the sensor. The design uses a TLC4502 dual Operational Amplifier (Op-Amp) with an

Data Acquisition Circuit Design
The sensor detection module consists of four parts: voltage stabilization, signal amplification, voltage following, and temperature compensation. The internal resistance of some composite electrodes is extremely high, for example, up to 10 12 Ω for glass electrodes. Since a high impedance input is required, the correct voltage signal can be obtained only when the input impedance of the op-amp is higher than the internal resistance of the sensor. The design uses a TLC4502 dual Operational Amplifier (Op-Amp) with an input impedance of 10 12 Ω at room temperature to realize the function of signal amplification and convert microvolts to voltages in the range of 0 to 5 V, which can be sent to the main control chip for data processing. In addition, the temperature is an important factor that affects the sensor output voltage, so DS18B20 is used as a temperature compensation sub-module to improve the data accuracy. The analog to digital converter (ADC) circuit is mainly used to convert the analog signals collected in real-time into digital signals that can be processed by the MCU to support its processing of the signals collected in real-time. The schematic diagram of the data acquisition circuit is shown in Figure 5.
cation and convert microvolts to voltages in the range of 0 to 5 V, which can be sent to the main control chip for data processing. In addition, the temperature is an important factor that affects the sensor output voltage, so DS18B20 is used as a temperature compensation sub-module to improve the data accuracy. The analog to digital converter (ADC) circuit is mainly used to convert the analog signals collected in real-time into digital signals that can be processed by the MCU to support its processing of the signals collected in realtime. The schematic diagram of the data acquisition circuit is shown in Figure 5.

Main Control Circuit and Peripheral Circuit Design
The main control circuit and peripheral interaction circuit are presented in Figure 6. To match low power and multi-signal scenarios, the MCU uses STM32F103C8T6 as the main control chip, which is used to provide control signals for data monitoring and transmission circuit. It is a 32-bit microcontroller based on the Cortex-M3 core introduced by STMicroelectronics (ST), with high performance, low cost, and low power consumption. In addition, it integrates various communication serial ports, with two Inter-Integrated Circuit Bus (IIC) interfaces, two Serial Peripheral Interfaces (SPI), three Universal Synchronous/Asynchronous Receiver/Transmitter (USART), and one Controller Area Network (CAN), and a total of twelve channels of ADC, which facilitates easy development of different data requirements. Peripheral circuit includes screen display circuit, alarm circuit, and power switching circuit, which are connected through the I/O port for realtime display of data monitoring and chirp alarm when the data is abnormal. Organic Light-Emitting Diode (OLED) driven by SSD1306; buzzer driven by S8050.

Main Control Circuit and Peripheral Circuit Design
The main control circuit and peripheral interaction circuit are presented in Figure 6. To match low power and multi-signal scenarios, the MCU uses STM32F103C8T6 as the main control chip, which is used to provide control signals for data monitoring and transmission circuit. It is a 32-bit microcontroller based on the Cortex-M3 core introduced by STMicroelectronics (ST), with high performance, low cost, and low power consumption. In addition, it integrates various communication serial ports, with two Inter-Integrated Circuit Bus (IIC) interfaces, two Serial Peripheral Interfaces (SPI), three Universal Synchronous/Asynchronous Receiver/Transmitter (USART), and one Controller Area Network (CAN), and a total of twelve channels of ADC, which facilitates easy development of different data requirements. Peripheral circuit includes screen display circuit, alarm circuit, and power switching circuit, which are connected through the I/O port for real-time display of data monitoring and chirp alarm when the data is abnormal. Organic Light-Emitting Diode (OLED) driven by SSD1306; buzzer driven by S8050.

Wireless Transmission Network Design
The network layer is one of the key layers in the system, as a bridge between the

Wireless Transmission Network Design
The network layer is one of the key layers in the system, as a bridge between the perception layer and the application layer, whose main task is to accomplish the interconnection of the information collected by the underlying sensors and the upper layer applications. The wireless transmission unit adopts ESP8266 for Wi-Fi transmission, which is a low-power, cost-effective embedded wireless network module. The complete TCP/IP protocol stack has been embedded in the module, so it can send data from traditional serial devices to the Internet. It supports three working modes: serial to STA, serial to AP, and STA + AP, and supports the standard IEEE802.11 b/g/n protocol. The features of the module cover no new wires, easy to use, quick start, etc. The serial port rate can reach up to 4 Mbp. Figure 7 shows the material object of the data acquisition node and transceiver.

Wireless Transmission Network Design
The network layer is one of the key layers in the system, as a bridge between the perception layer and the application layer, whose main task is to accomplish the interconnection of the information collected by the underlying sensors and the upper layer applications. The wireless transmission unit adopts ESP8266 for Wi-Fi transmission, which is a low-power, cost-effective embedded wireless network module. The complete TCP/IP protocol stack has been embedded in the module, so it can send data from traditional serial devices to the Internet. It supports three working modes: serial to STA, serial to AP, and STA + AP, and supports the standard IEEE802.11 b/g/n protocol. The features of the module cover no new wires, easy to use, quick start, etc. The serial port rate can reach up to 4 Mbp. Figure 7 shows the material object of the data acquisition node and transceiver.

Intelligent Sensing Unit Program Design
The hardware part was developed in Keil and programmed in C, which mainly implements the sensing data acquisition and Wi-Fi wireless transmission functions. The intelligent sensing unit mainly has three major states: initialization, status judgment, and data reading. The block program diagram of the intelligent sensing unit is shown in Figure 8.
After each module is initialized in turn, the STM32-ESP8266 connection request will be sent out. Wait for 10 s for the server reply after a successful connection, the buzzer will beep to indicate successful access. Otherwise, it will reset the ESP8266 for reconnection.
With the PB6 pin going high, the IIC is started during the falling of edge PB7 pin. Then the MCU sends power-on and measurement commands to the IIC device. The measurement ends when the ACK signal of BH1750 is detected, and the calculation of light intensity is performed after reading the register data. Similarly, when the PB10 pin goes high, the PB11 pin shows a falling of edge to indicate the IIC is woken up, and SGP30 reads and writes CO 2 data in sequence.
After ADC initialization, ADC conversion is triggered using software to calibrate the voltage and data conversion, then the DO value is calculated by formula. After the data measurement, the data display work is performed by timer TIM2. The status of the PA0 pin is read as a flag to determine whether there is data abnormality and alarm action.
The program for the edge-computing module was developed in Raspberry Pi using Pycharm and programmed in Python. The main function is to provide acquisition commands for pictures of plants during growth and integrate segmentation and detection algorithms to achieve segmentation of plant targets and calculation of growth indicators and transfer the result data to the main control module for cloud storage.

Wireless Transmission Network Program Design
The network layer uses Wi-Fi. The ESP8266 modules supporting the three modes are used to send the data measured by the smart sensing unit to the cloud server for database storage via TCP-based MQTT protocol, which is convenient for historical data queries and later relationship analysis. In this design, the communication module is set to STA mode using the AT command, when the device is connected to the AP hotspot as the station. Table 2 represents the specific configuration of part of the command. The hardware part was developed in Keil and programmed in C, which mainly implements the sensing data acquisition and Wi-Fi wireless transmission functions. The intelligent sensing unit mainly has three major states: initialization, status judgment, and data reading. The block program diagram of the intelligent sensing unit is shown in Figure  8. After each module is initialized in turn, the STM32-ESP8266 connection request will be sent out. Wait for 10 s for the server reply after a successful connection, the buzzer will beep to indicate successful access. Otherwise, it will reset the ESP8266 for reconnection.
With the PB6 pin going high, the IIC is started during the falling of edge PB7 pin. Then the MCU sends power-on and measurement commands to the IIC device. The measurement ends when the ACK signal of BH1750 is detected, and the calculation of light intensity is performed after reading the register data. Similarly, when the PB10 pin goes high, the PB11 pin shows a falling of edge to indicate the IIC is woken up, and SGP30 reads and writes CO2 data in sequence.
After ADC initialization, ADC conversion is triggered using software to calibrate the voltage and data conversion, then the DO value is calculated by formula. After the data measurement, the data display work is performed by timer TIM2. The status of the PA0 pin is read as a flag to determine whether there is data abnormality and alarm action.
The program for the edge-computing module was developed in Raspberry Pi using Pycharm and programmed in Python. The main function is to provide acquisition commands for pictures of plants during growth and integrate segmentation and detection algorithms to achieve segmentation of plant targets and calculation of growth indicators and transfer the result data to the main control module for cloud storage.  UART2 is configured as a communication serial port, with TXD pin connected to the PA2 pin and RXD pin connected to the PA3 pin. Turn on timer TIM3, set 10 ms interruption, and the program will determine whether the data is continuous by calculating whether the time difference between 2 consecutive characters is greater than 10 ms. The circular queue is used as the buffer for data reception, which is used to save the data received in the UART2 interrupt function. Signal REV_OK indicates that the reception is complete, and the data can be sent out. The block diagram of the wireless transmission network program is shown in Figure 9.

Establishing a TCP connection XXXX OK
Transmission of data AT + CIPSEND OK UART2 is configured as a communication serial port, with TXD pin connected to the PA2 pin and RXD pin connected to the PA3 pin. Turn on timer TIM3, set 10 ms interruption, and the program will determine whether the data is continuous by calculating whether the time difference between 2 consecutive characters is greater than 10 ms. The circular queue is used as the buffer for data reception, which is used to save the data received in the UART2 interrupt function. Signal REV_OK indicates that the reception is complete, and the data can be sent out. The block diagram of the wireless transmission network program is shown in Figure 9.

IoT Gateway Design
Elastic compute service (ECS) is a simple, efficient, safe, and reliable computing service with elastic and scalable processing capacity. At present, the larger domestic cloud service platforms include Ali-cloud, Baidu Cloud, Tencent Cloud, WeChat hardware platform, Giz Cloud, OneNET, etc. Among them, Ali-cloud has the characteristics of high stability, full functionality, and flexible development, which is an infrastructure as a service (IaaS) cloud server with superior performance. In this paper, we choose Ali-cloud as the storage and processing center of cloud data and use Community Enterprise Operating System (CentOS) 7.2.1 to build and configure the server. The overall architecture of the application layer platform is shown in Figure 10.
The server mainly includes two parts: remote data reception and database management. The water-quality data and environmental data collected by the intelligent sensing unit use JavaScript Object Notation (JSON) format to communicate with the remote server, and the server will subscribe to a topic for port listening. The design uses MySQL, which is fast and flexible, as the database for cloud storage and management. Through the programming interface it provides, the master control module is able to upload the collected data to Ali-cloud through Wi-Fi and able to receive cloud server commands to achieve interconnection between services and devices.

Mini Program Design
In this paper, Visual Studio with the mpVue framework was used for WeChat Mini Program development, including four parts: user login, real-time monitoring, history display, and remote control. Figure 11 represents the framework of the Mini Program. The most important feature is that it can be accessed without downloading. The Mini Program realizes the user experience of "come and use", which is one of the best alternatives to mobile client apps. form, Giz Cloud, OneNET, etc. Among them, Ali-cloud has the characteristics of high stability, full functionality, and flexible development, which is an infrastructure as a service (IaaS) cloud server with superior performance. In this paper, we choose Ali-cloud as the storage and processing center of cloud data and use Community Enterprise Operating System (CentOS) 7.2.1 to build and configure the server. The overall architecture of the application layer platform is shown in Figure 10. The server mainly includes two parts: remote data reception and database management. The water-quality data and environmental data collected by the intelligent sensing unit use JavaScript Object Notation (JSON) format to communicate with the remote server, and the server will subscribe to a topic for port listening. The design uses MySQL, which is fast and flexible, as the database for cloud storage and management. Through the programming interface it provides, the master control module is able to upload the collected data to Ali-cloud through Wi-Fi and able to receive cloud server commands to achieve interconnection between services and devices.

Mini Program Design
In this paper, Visual Studio with the mpVue framework was used for WeChat Mini Program development, including four parts: user login, real-time monitoring, history display, and remote control. Figure 11 represents the framework of the Mini Program. The most important feature is that it can be accessed without downloading. The Mini Program realizes the user experience of "come and use", which is one of the best alternatives to mobile client apps. According to the registration information, users can log in to check the real-time data of the aquaponics system. The Mini Program will automatically send a server connection request. With a successful connection, the Mini Program gets real-time data through the subscribed "PubTopic" and sends control commands through "SubTopic". Finally, it realizes the display of weather overview, water quality, planting environment, and plant growth conditions on the monitoring page and the switch on and off control of water pump, light, and alarm on the remote-control page, which can assist to complete planting evaluation with the mature model deployed in the cloud.

Experiments Setting and Evaluation Indices
Three experiments were conducted in this paper, which correspond to verifying the transmission reliability, system stability, and measurement accuracy respectively. In the data packet loss rate test, the packet loss rate (PLR) at different distances (DIS) was used as the evaluation index. The calculation method is shown in Equation (1), NOP stands for the number of packages and NORP stands for the number of receiving packages. Low PLR means system transmission is reliable. The stability test is primarily concerned with whether the system can be online for a sustained period without going offline. The field tests mainly verified the accuracy of the system measurements by comparing the manual sampling (actual values) with the system recording values. Mean absolute error (MAE), According to the registration information, users can log in to check the real-time data of the aquaponics system. The Mini Program will automatically send a server connection request. With a successful connection, the Mini Program gets real-time data through the subscribed "PubTopic" and sends control commands through "SubTopic". Finally, it realizes the display of weather overview, water quality, planting environment, and plant growth conditions on the monitoring page and the switch on and off control of water pump, light, and alarm on the remote-control page, which can assist to complete planting evaluation with the mature model deployed in the cloud.

Experiments Setting and Evaluation Indices
Three experiments were conducted in this paper, which correspond to verifying the transmission reliability, system stability, and measurement accuracy respectively. In the data packet loss rate test, the packet loss rate (PLR) at different distances (DIS) was used as the evaluation index. The calculation method is shown in Equation (1), NOP stands for the number of packages and NORP stands for the number of receiving packages. Low PLR means system transmission is reliable. The stability test is primarily concerned with whether the system can be online for a sustained period without going offline. The field tests mainly verified the accuracy of the system measurements by comparing the manual sampling (actual values) with the system recording values. Mean absolute error (MAE), mean squared error (MSE), and root mean square error (RMSE) were used as evaluation indices in this paper. The calculation method is shown in Equations (2)-(4), y i is the actual value measured manually, andŷ i is the predicted value recorded by the system. Similarly, the lower these indices are, the smaller error of the system measurement is.

Data Packet Loss Rate Test
To verify the reliability of the network layer of the system, the packet loss rate of the wireless transmission network is tested at different communication distances. With the IoT intelligent monitoring system connected to the server and router, the mobile collection nodes send 500 data packets at intervals of 50 m, 70 m, 90 m, 110 m, 130 m, and 150 m for testing the packet loss rate. From Table 3, it can be concluded that this system can achieve reliable data communication within the communication distance of 90 m and can meet the application requirements.

System Stability Test
To verify the stability of this system, the water quality, environment, and plant growth conditions of the aquaponics system were monitored for 24 h of continuous operation. The real-time monitoring and historical data page of the Mini Program are shown in Figure 12. Figure 12 represents the system that can collect lots of key indicators of the aquaponics system stably, without disconnection during the monitoring process. Meanwhile, it can accomplish functions of data wireless transmission, trend curve drawing, and database storage, which indicates that the system is stable and reliable in operation.

Field Test
Field testing began on 20 July 2022 and lasted for two months. The site was located in an aquaponics system within the College of Information and Electrical Engineering building at the China Agricultural University. The monitoring system was powered up and calibrated prior to the test, and the monitoring interval was set to 1 min. The system was set to take average data every 1 h and upload it to the cloud for historical storage. During the test period, the three test indicators were manually sampled at 9:00, 12:00, 15:00, 18:00, and 21:00 each day using a handheld photometer, DO detection device, and a scale respectively. The field test environment is shown in Figure 13.

System Stability Test
To verify the stability of this system, the water quality, environment, and growth conditions of the aquaponics system were monitored for 24 h of continuous ation. The real-time monitoring and historical data page of the Mini Program are sh in Figure 12.   Figure 12 represents the system that can collect lots of key indicators of the aquapon ics system stably, without disconnection during the monitoring process. Meanwhile, it ca accomplish functions of data wireless transmission, trend curve drawing, and databas storage, which indicates that the system is stable and reliable in operation.

Field Test
Field testing began on 20 July 2022 and lasted for two months. The site was locate in an aquaponics system within the College of Information and Electrical Engineerin building at the China Agricultural University. The monitoring system was powered u and calibrated prior to the test, and the monitoring interval was set to 1 min. The system was set to take average data every 1 h and upload it to the cloud for historical storage During the test period, the three test indicators were manually sampled at 9:00, 12:00 15:00, 18:00, and 21:00 each day using a handheld photometer, DO detection device, an a scale respectively. The field test environment is shown in Figure 13.  Figure 14 shows the changes in DO over 3 days. Since the system is equipped wit an oxygenation pump that can be intelligently controlled, the DO data as shown oscillate between 7 and 8, providing a good growing environment for the fish. Table 4 compare the indicators obtained by manual sampling with those obtained by system monitoring The results show that the MAE of the DO value is 0.093. The MSE and RMSE is 0.012, an 0.111, respectively.  Figure 14 shows the changes in DO over 3 days. Since the system is equipped with an oxygenation pump that can be intelligently controlled, the DO data as shown oscillates between 7 and 8, providing a good growing environment for the fish. Table 4 compares the indicators obtained by manual sampling with those obtained by system monitoring. The results show that the MAE of the DO value is 0.093. The MSE and RMSE is 0.012, and 0.111, respectively. Figure 14 shows the changes in DO over 3 days. Since the system is equipped wit an oxygenation pump that can be intelligently controlled, the DO data as shown oscillate between 7 and 8, providing a good growing environment for the fish. Table 4 compare the indicators obtained by manual sampling with those obtained by system monitoring The results show that the MAE of the DO value is 0.093. The MSE and RMSE is 0.012, an 0.111, respectively.   Figure 15 shows the variation of lightness over 3 days, with data cycling from large to small, consistent with the daily regular pattern. Due to the additional fill light during 2:00-5:00, the period of the graph shows a boost of data. Table 5 compares the indicators obtained by manual sampling with those obtained by systematic monitoring. The results show that the MAE of light intensity is 0.045. The MSE and RMSE is 0.007 and 0.082, respectively.
The validation of the growth monitoring module lasted for one month due to the slow growth rate of the plants. Figure 16 shows the change in plant height during this period with an increasing trend. Table 6 compares the indicators obtained by manual sampling with those obtained by systematic monitoring using edge-computing. The results show that the MAE of plant height value is 0.758. The MSE and RMSE is 0.583 and 0.763, respectively. Though, it is clear that there is a uniform bias due to image acquisition calibration. Thus, the result is helpful to evaluate plant growth with tiny data transmission. Figure 15 shows the variation of lightness over 3 days, with data cycling from larg to small, consistent with the daily regular pattern. Due to the additional fill light durin 2:00-5:00, the period of the graph shows a boost of data. Table 5 compares the indicator obtained by manual sampling with those obtained by systematic monitoring. The result show that the MAE of light intensity is 0.045. The MSE and RMSE is 0.007 and 0.082, re spectively.    slow growth rate of the plants. Figure 16 shows the change in plant height during this period with an increasing trend. Table 6 compares the indicators obtained by manual sampling with those obtained by systematic monitoring using edge-computing. The results show that the MAE of plant height value is 0.758. The MSE and RMSE is 0.583 and 0.763, respectively. Though, it is clear that there is a uniform bias due to image acquisition calibration. Thus, the result is helpful to evaluate plant growth with tiny data transmission.   In summary, the embedded edge-computing-based aquaponics network monitoring system can effectively monitor various key indicators in the aquaponics system and provide valuable references for agricultural production. Especially for plant growth monitoring, the use of edge sensors for image processing makes the transmission efficiency much higher.

Conclusions
As this study has demonstrated, we focused on the integrity of monitoring parameters in the aquaponics system and realized the possibility of simultaneous remote monitoring and intelligent control of the environment, water quality, and plant growth conditions. The proposed system ensures the quality operation of aquaponics system and lays a foundation for the research of cultivation-breeding ratio to a certain extent.
As for the environment and water-quality parameters, the system overcomes many problems of the traditional handheld aquaponics system, such as high latency, laborintensive, low efficiency, and poor scalability. Furthermore, in order to monitor the growth conditions of plants in the aquaponics system and improve the intelligence of the system, edge computing was introduced to build an end-edge-cloud system architecture. Thus, deep learning algorithms can be used for image processing. In this way, the computing tasks of the traditional system are transferred from the data center to the edge sensor, realizing the diversion of high energy-consuming image data and low energy-consuming sensing data. It proves that the edge sensor can improve the timeliness of data calculation, reduce the flow pressure, improve the efficiency of data transmission and enhance the scalability of the system. Using the WeChat Mini Program as the software platform, users can easily access remote monitoring and control of the aquaponics system by using a smart cell phone. The test results show that the system can provide stable local data collection and remote transmission, trend curve plotting, and database storage services for aquaponics systems effectively. The packet loss rate of the wireless transmission network is 0% within 90 m and 3.2% at 110 m. The system measurement data is proven to reflect the system condition well.
Due to the limited site, the research object of this paper is set in the miniaturized aquaponics system. In theory, a larger site can be covered by more monitoring nodes. This paper provides a good basis for further discussion and study. In the future, further research can make the system more efficient and intelligent by strengthening the computing power at the edge, such as further pruning and compression of the model or connecting the accelerator for deep learning in the periphery of the microcontroller.

Conflicts of Interest:
The authors declare no conflict of interest.