Design and Implementation of a Distributed Solar Inverters Monitoring System Based on Linux

1. Introduction and Motivation

In the context of global efforts toward carbon neutrality, solar energy has emerged as one of the most promising renewable sources. Distributed photovoltaic generation systems, particularly those employed in small- and medium-sized industrial and commercial settings, rely heavily on solar inverters to convert the direct current from photovoltaic panels into grid-compatible alternating current. The reliable operation of these solar inverters is essential for maximizing energy yield and ensuring grid stability. Consequently, monitoring the operational status of every solar inverter in a distributed installation becomes a critical task. Traditional monitoring approaches often involve manual inspection, which is neither efficient nor scalable. Many existing commercial monitoring products suffer from limitations such as difficult wiring, short wireless transmission distances, and over-centralized data storage that can become unavailable if the server fails. Motivated by these challenges, I have designed and implemented a comprehensive distributed solar inverters data monitoring system based on Linux. The system leverages LoRa wireless communication to overcome cabling and distance constraints, employs a field gateway with local database storage plus a cloud server to avoid single points of failure, and provides rich visualization interfaces for both local and remote users.

2. System Design Requirements

The system was developed to address the following specific requirements:

  • Accurate acquisition of key parameters such as input voltage, input current, output voltage, output current, and output frequency for each solar inverter.
  • A monitoring node capable of displaying data on an LCD for single-inverter scenarios, thereby replacing the traditional segment-code displays.
  • Wireless transmission over a long range to avoid the need for extensive cabling in spatially distributed installations.
  • A field gateway that can aggregate, store, display, and upload data to the cloud, thus enabling offline data storage and query even if the cloud server becomes unavailable.
  • A cloud server that provides long-term data storage and a web-based interface for remote monitoring and querying.
  • Support for direct connection to existing solar inverters via industrial communication interfaces, such as RS485, RS232, and CAN, in addition to dedicated monitoring nodes.

3. Overall System Architecture

The distributed solar inverters data monitoring system is composed of three main layers: monitoring and RF nodes, field gateways, and a cloud server. The monitoring nodes are responsible for data acquisition, while the RF nodes handle wireless communication via LoRa. These nodes form a star topology network with the field gateway. The field gateway processes, stores locally, and uploads the data to the cloud server using Ethernet or 4G communication. The cloud server stores all data centrally and offers web-based visualization. This architecture ensures that even if the cloud server experiences a failure, the field gateway continues to store and allow local queries of the data, thereby significantly improving system reliability compared with conventional cluster-based storage schemes.

4. Key Technology Selection

4.1 Wireless Communication Technology

To solve the problems of complex wiring and limited wireless distance, I compared several wireless technologies including LoRa, Bluetooth, ZigBee, NB-IoT, and NFC. The comparison is summarized in the following table:

Technology Transmission Distance Data Rate Frequency Band Cost Application Scenario
LoRa Several kilometers to more than ten kilometers Low (a few kbps) Sub-1GHz Medium Long-range wide area network
Bluetooth Less than 100 m Medium (1-3 Mbps) 2.4 GHz Low Short-range personal device connection
ZigBee Decades to hundreds of meters Low (250 kbps) 2.4 GHz Low Sensor networks
NB-IoT Decades to hundreds of kilometers Low (tens of kbps) Cellular dedicated frequency Medium-high Wide area IoT
NFC Less than 1 m Low (hundreds of kbps) 13.56 MHz Low Near field communication

Given that distributed solar inverters are often deployed over a wide geographical area, LoRa was chosen because it provides long-range, low-power, and robust communication without requiring a licensed spectrum. For the link between the field gateway and the cloud server, I selected Ethernet for sites with fiber access and a 4G module for sites without such infrastructure. The TCP protocol was chosen for reliable data transmission over the network.

4.2 Database Selection

For local storage at the field gateway, SQLite was selected because of its lightweight nature, low resource consumption, and ease of embedding. For the cloud server, MySQL was selected because of its robustness, scalability, and support for concurrent access. This combination mitigates the risk of data loss and unavailability in the event of a server outage.

4.3 Graphical Framework Selection

For the monitoring node, I selected LVGL, a light and versatile graphics library, because it can run on microcontrollers with limited memory. For the field gateway, I selected Qt, a cross-platform framework that provides a rich set of widgets and a powerful signal-and-slot mechanism, which simplifies the development of a dynamic human-machine interface.

5. Hardware Design

5.1 Monitoring Node

The monitoring node is responsible for measuring the input and output parameters of solar inverters. It is built around an ESP32-WROOM-32U-N4 microcontroller. The ESP32 provides dual-core processing, multiple communication interfaces, and sufficient performance for LVGL-based graphical rendering. The node includes several key circuits: a power supply circuit, an LCD human-machine interface, RS232 communication, and data acquisition circuits using the BL0942 and HLW8110 metering chips.

The power supply circuit accepts either a 12 V adapter or 5 V from a Type-C connector. For the 12 V input, I used a buck converter to generate 5 V and subsequently a low-dropout regulator to provide 3.3 V for the MCU. The output voltage of the 5 V buck converter is determined by the resistor divider network. The formula used is:

$$
V_{DC\_5V} = \frac{R_5 + R_4}{R_5} \cdot V_{FB}
$$

With $V_{FB} = 0.768\,V$, $R_5 = 16\,k\Omega$, and $R_4 = 91\,k\Omega$, the nominal 5 V output is obtained. The 3.3 V supply is similarly generated using a buck converter with:

$$
V_{VCC\_3V3} = \frac{R_{10} + R_{11}}{R_{11}} \cdot V_{FB}
$$

where $V_{FB} = 0.588\,V$, $R_{11} = 110\,k\Omega$, and $R_{10} = 510\,k\Omega$.

The data acquisition circuits are designed to measure both alternating current (AC) on the output side of the solar inverter and direct current (DC) on the input side. For the AC measurement, a voltage divider scales the output voltage down to the input range of the BL0942 chip. The voltage across the sensing resistor $R_9$ is:

$$
V_{R9} = \frac{R_9}{R_4 + R_5 + R_6 + R_7 + R_8 + R_9} \cdot V_{INL}
$$

For a maximum input voltage of 267 V, I selected $R_4$ through $R_8$ as 390 kΩ and $R_9$ as 510 Ω. The current channel uses a 1 mΩ shunt resistor, allowing measurement up to 30 A. Optical isolators are employed to protect the main controller from high-voltage transients.

For the DC input side, a similar approach is used with the HLW8110 chip. The maximum measurable DC voltage is 113 V, and the voltage sensing formula is:

$$
V < \frac{800\,mV}{1.414 \cdot PGA} \cdot \frac{R_9}{R_4 + R_5 + R_6 + R_7 + R_8}
$$

In this design, $PGA = 1$, $R_4$ to $R_8$ are 20 kΩ, and $R_9$ is 2 kΩ. The current channel is designed to measure up to 34 A using a 1 mΩ shunt and a current gain of 16.

The RS232 interface allows the monitoring node to communicate with the RF node or directly with solar inverters. An SP3232 transceiver performs the level conversion. For user interaction, the monitoring node includes an LCD display driven by the ESP32 and a rotary encoder for menu navigation. The interface was designed with LVGL and consists of a boot screen, main menu, DC parameter page, AC parameter page, and a settings page. This design inherently improves the user experience compared with the traditional segment-code LCD screens often used on solar inverters.

5.2 RF Node

The RF node is designed to bridge the monitoring node or a solar inverter with the field gateway. It is based on the STM32F103C8T6 microcontroller. Because many solar inverters already provide communication interfaces, the RF node incorporates RS232, RS485, and CAN transceivers to connect directly to a wide variety of solar inverters. The RS485 circuit uses an SSP3485 transceiver, while the CAN interface uses an XL1050 chip with a 120 Ω termination resistor. The LoRa module is an ATK-MW1268S based on the SX1268 transceiver, operating in the 410–493 MHz band with a maximum output power of 22 dBm. The RF node reads data from the monitoring node or the solar inverter via the appropriate industrial interface, assembles the data frame, and transmits it to the field gateway over the LoRa link.

5.3 Field Gateway Hardware

The field gateway is the core of the system. It must run a Linux operating system, employ a local database, and provide a Qt-based display. For this purpose, I selected the NXP I.MX6ULL processor, specifically the MCIMX6Y2CVM05AB. This processor is based on a single-core ARM Cortex-A7 running at up to 792 MHz and includes a hardware floating-point unit. It has ample performance for Linux and Qt. The field gateway hardware is divided into a core board and a base board. The core board contains the processor, DDR3L memory, eMMC storage, and power management circuits. The base board provides Ethernet, 4G, LoRa, LCD, and buzzer circuits.

The power architecture for the field gateway is carefully designed to satisfy the I.MX6ULL power-up sequence. The sequence requires $VDD_{SNVS\_IN}$ to be powered first, followed by $VDD_{HIGH\_IN}$ and then $VDD_{SOC\_IN}$. The voltage conversion stages are implemented using JW5060T buck converters and MT3420B converters. For example, the core voltage for the processor is generated by an MT3420B with an output voltage given by:

$$
V_{out} = 0.6 \cdot \left(1 + \frac{R_{32}}{R_{33}}\right)
$$

With $R_{33} = 100\,k\Omega$ and $R_{32} = 124\,k\Omega$, the output is approximately 1.35 V, which is suitable for $VDD_{SOC\_IN}$. The DDR3L memory also requires 1.35 V and 0.67 V reference voltages, which are generated using a similar buck converter and a resistor divider network.

The core board was designed as a six-layer PCB to maintain signal integrity for high-speed interfaces. I performed impedance-controlled routing with 50 Ω single-ended and 100 Ω differential traces for the DDR3L bus. The eMMC circuit uses a Samsung KLM8G1GET 8 GB flash memory. The base board includes an Ethernet port based on the LAN8720A PHY with an HR911105A connector, a 7-inch LCD with a capacitive touch screen based on the FT5426 controller, and a ME3630 4G module. A buzzer alarm circuit was also integrated to alert operators when abnormal conditions are detected.

6. Software Design

6.1 Monitoring Node Software

The monitoring node software initializes the BL0942 and HLW8110 chips, starts a timer, and reads the relevant registers every second. The acquired values are converted to engineering units and stored in a temporary buffer. When the RF node sends a request, the monitoring node responds with the buffered data. The data acquisition flow is shown conceptually in a simplified state machine: initialization, periodic reading, parsing, and temporary storage.

The LVGL-based user interface was developed to display the measured data. The interface includes a boot screen, a main menu, a DC input page, an AC output page, and a settings page. The settings page allows the user to adjust brightness, view warning and fault codes, and perform a system shutdown. This design provides a modern alternative to the traditional segment-code LCD and enhances the suitability of the monitoring node for single solar inverter applications.

6.2 LoRa Networking and Data Frame Design

The LoRa network uses a polling-based directed transmission scheme. The field gateway sends request frames to each RF node in sequence, and the RF nodes respond with their data frames. This approach minimizes collisions and reduces the error rate. A custom data frame format is defined to ensure reliable transmission. The format is shown below:

Field Header Length Device Type Node Info Message Type Data Checksum
Length (bytes) 1 1 1 4 1 N 1

The header indicates the start of the frame. The length field specifies the total frame length. The device type distinguishes between the field gateway and an RF node. The node information field contains the unique node ID. The message type indicates whether the frame is a data report, an acknowledgment, or a request. The data field carries the payload, such as input voltage, input current, output voltage, output current, frequency, energy, warning codes, and fault codes. Finally, a CRC checksum is appended to detect transmission errors.

6.3 Field Gateway Software

6.3.1 Embedded Linux Porting

The field gateway requires a complete Linux environment. I used U-Boot as the bootloader, ported the Linux kernel version 4.1.15, and built the root file system using Buildroot. The kernel was configured with the necessary drivers for the I.MX6ULL hardware. Buildroot was configured to include SQLite and other essential libraries. The entire boot process was tested successfully.

6.3.2 Device Driver Development

I developed and ported several device drivers. The Ethernet driver is provided by the Linux kernel, and the 4G module uses a PPP driver. The most complex driver developed for this project was the capacitive touch screen driver for the FT5426 based on the I2C and input subsystems. The driver registers an I2C driver and an input device, reads touch coordinates, and reports them to the Linux input subsystem. The probe function resets the chip, initializes interrupts, and performs register configuration. The device tree was modified to include the FT5426 node with the correct GPIO pins and I2C configuration.

6.3.3 Thread Pool and Main Application

To handle concurrent tasks such as LoRa communication, data parsing, database storage, and cloud uploads, I implemented a thread pool. The thread pool consists of a manager thread, a set of worker threads, and a task queue. The manager dynamically adjusts the number of worker threads based on the load. The main application uses the thread pool to process incoming LoRa frames, parse the data, perform safety checks, and store data in SQLite. The safety check verifies that input and output voltages and frequencies are within the acceptable range defined by the national standard. For example, the output voltage of a single-phase inverter should be within $220\,V \pm 10\%$ and the frequency within 49–51 Hz.

The database schema for the field gateway includes a table for solar inverter data with fields such as node ID, input voltage, input current, output voltage, output current, frequency, daily energy, warning code, fault code, and timestamp. The software periodically inserts data into this table. If abnormal conditions are detected, the buzzer is triggered, and the data is immediately stored and uploaded to the cloud server.

6.3.4 Network Communication

The field gateway communicates with the cloud server using TCP sockets. The server side uses a multi-threaded model to handle multiple connected field gateways. Each time a field gateway connects, the server creates a new thread to communicate with it and maintains a list of sockets protected by a mutex. The field gateway actively connects to the cloud server and sends data packets in a defined format. This design ensures reliable and ordered data delivery.

6.3.5 User Interface Design

The Qt-based user interface for the field gateway was designed with Qt Designer. The main window uses a stacked widget to switch between different views. The first view displays the system title and the node deployment overview. The second view shows the real-time data of each solar inverter, including input voltage, current, and output voltage. The third view provides a detailed breakdown of each node’s parameters and fault codes. The interface also includes a page for plotting historical data curves. Using the SQL module of Qt, the application reads data from the local SQLite database and periodically updates the display. This gives maintenance personnel an intuitive and responsive interface to monitor the health of every connected solar inverter.

6.4 Cloud Server Software

The cloud server software is responsible for receiving data from multiple field gateways, storing it in a centralized MySQL database, and providing web-based access for users. I created four database tables: user information, inverter node information, inverter historical data, and inverter real-time data. The table structures are summarized below.

User information table:

Field Data Type Description
Id int User account (primary key)
user_name varchar User full name
user_passwd varchar User password

Inverter node information table:

Field Data Type Description
Id int Node ID
node_location_id varchar Location identifier
input_range_vol varchar Input voltage range
max_input_cur varchar Maximum input current
default_output_vol varchar Default output voltage
max_output_cur varchar Maximum output current
default_out_frq varchar Default output frequency

Historical data table:

Field Data Type Description
Id int Node ID
input_vol varchar Input voltage
input_cur varchar Input current
output_vol varchar Output voltage
output_cur varchar Output current
output_frq varchar Output frequency
Energy varchar Daily energy
warning_code varchar Warning code
fault_code varchar Fault code
Time datetime Timestamp

The web application was built using Node.js with the Express framework and the MySQL module. EJS templates were used to render dynamic web pages. Users first log in with their credentials. After authentication, they can view a list of all solar inverter nodes with their system parameters and online status, query real-time data, and browse historical data. The web pages are responsive and provide a clear representation of the monitored data.

7. System Testing

7.1 Monitoring and RF Node Testing

I conducted comprehensive tests on the monitoring and RF nodes. First, I measured all power supply voltages and ripples. The results are shown in the following table:

Power Supply Nominal Voltage (V) Measured Voltage (V) Ripple (mV)
DC_5V (monitoring node) 5.00 4.99 29.4
VCC_3V3 (monitoring node) 3.30 3.21 22.5
VCC_3V3 (RF node) 3.30 3.19 15.6

All measured voltages were within acceptable limits, and the ripples were below 5% of the nominal voltage, ensuring reliable operation.

The data acquisition accuracy was tested by comparing the monitoring node readings with a standard multimeter. The following tables summarize the measurement results:

Actual DC Voltage (V) Measured Voltage (V) Error (V)
0.00 0.03 0.03
0.75 0.70 0.05
5.00 5.15 0.15
15.00 15.12 0.12
25.00 25.03 0.03
35.00 34.90 0.10
45.00 45.07 0.07
55.00 55.03 0.03
Actual DC Current (A) Measured Current (A) Error (A)
0.000 0.0001 0.0001
0.001 0.0012 0.0002
0.010 0.0104 0.0004
0.100 0.0983 0.0017
3.000 2.9618 0.0382
4.900 4.8643 0.0357
Actual AC Voltage (V) Measured Voltage (V) Error (V)
220.0 220.10 0.10
220.1 220.29 0.19
220.3 220.37 0.07
219.9 220.15 0.25
220.0 220.11 0.11
219.8 220.07 0.27

Although the harmonic content was not measured due to instrument limitations, the errors were sufficiently small for monitoring purposes. The system successfully collected the DC input and AC output parameters of solar inverters and displayed them on the LCD screen.

7.2 Communication Functions and Performance

I verified the communication functions by using a serial debugging assistant to capture the request and feedback frames exchanged between the field gateway and the RF nodes. The request frame from the field gateway began with the header 0xAA, followed by the length, device type, node ID, and message type. The feedback frame from the gateway indicated successful or failed reception of the data frame. The custom protocol worked correctly.

Communication performance was evaluated by measuring the received signal strength indicator (RSSI) at different distances, both with and without obstacles. The results are shown below:

Distance (m) RSSI (dBm) without obstacles RSSI (dBm) with obstacles
100 -20 -22
200 -33 -36
400 -41 -45
600 -56 -58
800 -68 -89
1000 -74 -95

Without obstacles, the RSSI decreased smoothly as the distance increased. In the presence of obstacles, a significant drop was observed at 800 m, mainly due to the shadowing effect of buildings. The communication distance of 400 m was selected as a reliable range for practical deployments, which is more than sufficient for most distributed solar inverter installations.

I also performed a packet loss and garbled code test using three nodes placed 400 m away from the gateway. The gateway polled each node every five seconds. The test results are summarized in the following table:

Node Number of Packets Packet Loss Rate Garbled Rate
1 500 0% 0%
2 498 0.04% 0%
3 499 0.02% 0%

The average packet loss rate was only 0.02%, and no garbled data was observed. The directed transmission scheme effectively prevented collisions because only one node communicated with the gateway at a time.

7.3 Field Gateway Testing

The field gateway hardware was tested for voltages, ripples, and power-up sequencing. The measurements are shown below:

Power Supply Nominal Voltage (V) Measured Voltage (V) Ripple (mV)
DCDC_5V (base board) 5 4.97 70.0
VCC_3V3 (base board) 3.3 3.34 62.2
SYS_3V3 (core board) 3.3 3.34 60.5
DCDC_3V3 (core board) 3.3 3.20 52.0
VDD_ARM_SOC_IN (core) 1.35 1.36 58.8
DRAM_1V35 (core board) 1.35 1.34 51.0

The power-up sequence was validated using an oscilloscope. The sequence $SYS\_3V3 \rightarrow DCDC\_3V3 \rightarrow VDD\_ARM\_SOC\_IN$ was correctly followed, preventing any latch-up issues in the processor.

The Linux operating system booted correctly. The Ethernet and 4G interfaces were tested using the ping command. Both interfaces successfully communicated with an external server without packet loss, confirming that the network drivers were functioning properly. The LCD and touch screen were tested using the tslib utility. The touch accuracy and display output were correct.

To verify the end-to-end function, I connected the RF node directly to a solar inverter via its RS232 interface. The solar inverter was supplied with 48 V DC from an adjustable power supply, and its AC output was left unloaded. The field gateway received the data frame and printed it in hexadecimal format. The frame was correctly parsed: the input voltage was 48.0 V, the input current was 1.2 A, the output voltage was 220.0 V, the output current was 0.0 A, and the frequency was 50.0 Hz. The data was also stored in the SQLite database. An inspection of the database file using a database management tool confirmed the new records were correctly inserted.

The Qt user interface was then launched. It read the data from the local database and displayed the real-time values of the connected solar inverter. The curve page was also tested and rendered the data correctly. The gateway successfully fulfilled its local storage, display, and reporting functions.

7.4 Cloud Server Testing

I deployed the MySQL database and the Node.js web application on a cloud server. Using a database visualization tool, I confirmed that the four database tables were present. Data from the field gateway was received and inserted into the historical data table at five-second intervals. This verified that the cloud server correctly accepted TCP data from the field gateway and stored it in the database.

The web interface was tested with a browser. After logging in with a valid account, I could view the list of solar inverter nodes, their system parameters, and online status. The real-time data page displayed the current input/output values of two solar inverters in a table format. The historical data page allowed me to select a node and retrieve its historical records. All pages rendered correctly and provided an intuitive view of the monitored data. The cloud server successfully enabled remote supervision of distributed solar inverters.

8. Conclusion and Future Work

In this work, I designed and implemented a distributed solar inverters data monitoring system based on Linux. The monitoring nodes and RF nodes reliably acquire and transmit the operational parameters of solar inverters. The LoRa wireless communication provides reliable long-distance data transmission, solving the problems of complex cabling and limited wireless range that are common in existing systems. The field gateway adds local data storage and visualization, which mitigates the risk of data loss when the cloud server becomes unavailable. The cloud server offers centralized storage and remote web access, providing a convenient platform for operators to monitor a fleet of solar inverters.

The test results confirmed that the system meets the design requirements: the measurement accuracy is sufficient for monitoring purposes, the LoRa communication distance reaches at least 400 m with a low packet loss rate, the field gateway correctly stores and displays data, and the cloud server reliably uploads and presents the data through a web interface. This system has practical value for small- and medium-sized distributed photovoltaic applications.

There are several areas for future improvement. The field gateway processor could be replaced with a lower-cost domestic chip to reduce overall cost while maintaining performance. The core board and base board could be integrated into a single board, reducing the physical size of the hardware. The cloud server web interface could be enhanced with more interactive charts and real-time graphs to provide even better data visualization. Additionally, the system could be extended to support remote control of solar inverters, allowing operators to adjust parameters or disconnect a faulty inverter to prevent further damage. With the continued growth of distributed photovoltaic generation, the monitoring of solar inverters will remain an essential part of efficient and reliable renewable energy systems.

Scroll to Top