PL60 Solar panel controller Linux driver

Our recently installed solar system required a solar panel charge controller if it were to get approval and government rebate. The model installed by our excellent electrician (Steven Cook - email me if you want his number) is the PL60 system. It is a nice controller, in an anodised box with a little display and considerable flexibility.

Insert inside photo here :)

Being the tinkering sort I wanted to find out exactly how much energy the system has generated over a long period of time. At first we got the data out of the system using the history buttons, but this process is slow and uncomfortable as the PL60 is mounted in the underfloor cavity and requires a trip outside. So I emailed the company asking for a protocol specification or a some linux software to talk to it - to find out how much power has gone through each day. They were extremely unhelpful, so I suggest you look elsewhere if you want to support linux friendly companies.

I reverse engineered their system and this page is for the code to talk to the pl60. I haven't tried it on any of their other models - please email me with any sucesses. The code currently gives:

Instantaneous data

How I did it

I started out with the standard plan of putting 'sniffer lines' into an existing cable. However, sniffer lines don't work very well with any information encoded in the DTR or CTS lines, which toggled when the DOS program was downloading data.

To get around this I instead found program called sersniff which allows two serial ports to act like an electrical connection. The advantage of this approach is I know that if the device works correctly then replaying the signals should produce the same result. I then ran through all the menus that interested me on the DOS interface and recorded the timings of all the actions.

It was then a simple matter to chop up the sersniff program to output from a program rather than just forwarding information from the DOS machine. With a bit of guessing and experimenting I've worked out all the fields of interest to me, if other people want other stuff, and can work out how to change them, then I'll work out those fields too.

The code pushes the timing a little out of spec(to increase download speed), but the PL60 can handle it, and the code will retry on any request that fails.

30 day log

I've worked out all but one of the fields in the 30 day log - possibly the last is an extra 8 bits or pair of 4bits for the Ah field - I've never got more than 180Ah in a day so I don't know what happens when you exceed 256Ah (Hmm, 60A*24hours = 1440 = 11 bits, probably could use an extra nibble) If someone lends me an extra few solar panels I should be able to find out :)

The included python program daydata.py decodes the registers and outputs in a table

Web generation

Also intended to be included is a python program to generate a web page for the solar data (both instantaneous and 30 day). I use a cron job to pull the 30 day data out once a day when there is no load on the system. The web generator will be in 1.0.

Source