Solaton

Introduction

This software is used to extract operational data from the EPEVER Triron solar-PV controller, including its PV power output, battery voltage, load current, device temperature, etc.

Data collection is done in two halves: a client (solatonclient) that talks to the controller via a serial port and RS-485 adapter, and a server (solatonserver) that stores the information in files. The solatonclient sends information to the solatonserver over the network, and because it does not need to write to the file-system itself it can be run on a small computer such as a Raspberry Pi.

The program solatontool is used to extract the stored information and create graphs, and those graphs can be served up to a web browser by the solatonweb web server on port 8181.

The client/server messaging is designed to be compatible with collectd so it is possible to use the solatonclient on its own, as part of an existing collectd system.

Download Solaton

The software runs on Linux and released under the GPL v3 Open Source license.

Getting started

To build from source:

    $ sudo apt install g++ make [libpng][]-dev # deb, or
    $ sudo dnf install gcc-c++ make [libpng][]-devel # rpm
    $ ./configure.sh
    $ make

Then as root, install with:

    $ make install

Or start by installing from a package (as root):

    $ dpkg -i solaton_*.deb

Configure by editing config files:

    $ nano /etc/solatonclient.conf
    $ nano /etc/solatonserver.conf
    $ nano /etc/solatonweb.conf

Run with:

    $ service solatonclient restart
    $ service solatonserver restart
    $ service solatonweb restart

Monitor activity:

    $ tail -f /var/log/syslog /var/log/messages | grep solaton
    $ journalctl -f
    $ watch -n 1 ls -lt /var/lib/solaton

View graphs with your favourite web-browser:

    $ firefox http://127.0.0.1:8181

Hardware

Use a RS-485 USB dongle to connect a USB port to the Triron controller. The dongle will have an A and a B wire that should be connected to pins 6 and 3 of the RJ45 plug. Try swapping A and B if necessary and keep the wires short, at least until you have something working.

Plugging in the the dongle should automatically create a serial port device like /dev/ttyUSB0. Look for new devices appearing in the /dev directory and monitor the system log to watch the USB plug-in events.

The solatonclient program must be configured with the correct serial device name. It will wait for this device to appear and once it is present the program will configure the port to 115200 baud and start sending out modbus register read requests to the PV controller.

Management

There are 25 readable registers in the Triron PV controller. The solatonclient reads these registers every 10 seconds and sends their values to the solatonserver for storage as time-series.

The solatonserver creates a separate time-series file for each hardware register, so for example there will be a file pv_power.ts containing the PV power values. One record is added to a time-series file every 10 seconds so data accumulates within the /var/lib/solaton directory at a rate of about 2MB per day, or 630MB per year.

Individual files grow until they reach a certain configurable size limit and then they are automatically renamed and a new file begun. Old files can be deleted when the data is of no further interest.

In principle data files can be collapsed in the time domain by replacing, say, sixty actual values covering a ten minute period with one average value and a maximum value and a minimum. Graphs that are generated from this compressed information will look much the same as before, only loosing detail when zoomed right in.

Other software

The core client/server code has no build-time dependencies other than the standard c++ run-time. However, the solatontool program needs to be built with libpng so that it can produce graphs in the PNG format. If there is no libpng available then graphs will be created in the PNM format, and that will confuse most web browsers resulting in little broken-picture icons on the web pages.

If collectd and a front-end such as collectd-web are installed then solatonclient can be configured to send data to the collectd server, in addition to, or instead of, to solatonserver. (Point the collectd configuration at the solatontypes.db file, and patch the collectd-web code with the collectd-web.p1 patch file.)

Time-series data can be exported to rrdtool files by running "solartontool export" and that allows for the creation of more complex and better-looking graphs using rrdtool graph.

Troubleshooting

Pay close attention to log files while getting things connected for the first time and be sure to add the verbose option to all the configuration files in order to get the most helpful logging output.

Alternatively, stop the services and run the components individually from the command-line while logged in as root. Add the --verbose or -v command- line option (twice for good measure) to get better diagnostic messages. The netcat utility (nc) can be used to listen for the client/server messages being sent out by the client, as shown here:

    $ sudo bash
    $ service solatonclient stop
    $ solatonclient -v -v --tty=/dev/ttyUSB0 --output=127.0.0.1:10010
    $ nc -l -u -p 10010 | xxd -g -1

Please contact the author via sourceforge, https://sf.net/p/solaton/tickets or mailto:graeme_walker@users.sourceforge.net.