It has been a while since I have posted anything. So I thought I would go through the setup of my Solar monitoring.

When I got my solar system I noticed that the Inverter had a RS232 connector on it. While it was being installed I was talking with the installers about it and they mentioned that you could monitor the system with it so I set out to learn how to. I had to end up getting in touch with the manufacturer about it. They were very helpful which was nice.

I have just recently moved this from a full Linux install to a Raspberry Pi so hang on while we go through all that is required to set it up.

The script uses Perl to query the serial adaptor (USB in this case) then writes the values to a CSV file, sends it to pvoutput.org and writes it to a RRD file.

First up was to install all of the Perl requirements, I was having some trouble with CPAN so I ended up installing CPanMinus

Once that was installed I needed to install a few dependencies for the script to run correctly.

Now that all of the scripts dependencies have been installed the next step was to find out where the USB serial adaptor was

Great, it is attached to /dev/ttyUSB0

Now the script. I cant take credit for this script. I found it years ago on a forum that was all about solar systems. (Solarfreaks) However after some searching I have found that the script has been added to GitHub and can be found here – https://github.com/trollkarlen/inverter_monitor

The readme.txt file has a great run through of how to setup the scripts – https://github.com/trollkarlen/inverter_monitor/blob/master/README.txt

Once the script is setup we need to test it.

Excellent, that is all working. The next (and last) thing to do is to get it to run automatically. You could just run a cron job which calls the perl script, however the issue is that what was found was that it would just start heaps and heaps of the same script which would eventually bring the system to a halt.

So to get around that I found the following script which creates a solar.lock file when it is running. The script checks for this file and if it exists, exits.

Give that file +x rights and then setup a cron job to call it between certain hours of the day (in my case 4am and 8pm)

That’s it.

If you would like to see my outputs on pvoutput.org check out my system at http://pvoutput.org/list.jsp?userid=2401