Wow, me too just stumbled across this topic.
I have quite similar needs. I have a remote cabin where I would like to monitor Solar PV and Wind turbine, battery pack, temperatures etc..
At the moment I have:
-MPP Solar PCM-6048 MPPT charge regulator (has RS232 and came with Windows software, would be nice to read it from Rpi)
-400W PV array, to be added another 400W, so it will be 800W
-400W Wind turbine and its simple charge regulator
-930Ah 12V battery pack
-One 2KW Inverter for house electricity (lights, coffeemaker etc, usually switched off when I am not there)
-One 600W Inverter for Rpi, cameras and such
-One combo meter measuring battery voltage and wind mill amps (http://www.ebay.com/itm/DC-120V-10A-Vol ... 1142316463) <-- does not have any interface for computer, but maybe could be tinkered?
Anyway, I am really interested on this project. Is it progressing?
Other related Rpi-stuff that I have but are not yet at the cabin and I just got them yesterday:
-1-wire Master with RS232
-Piface for controlling wirelessly controlled 230v sockets by using relays with the original remote controller
-Some 1-wire 1820 temp-sensors
Re: Photovoltaic/solar systems monitoring
Hi
I have a online grid connected Samil 2200 inverter connected via RS232, currently monitored using a Windows PC running PVBeanCounter which uploads to PVoutput.org. Unfortunately the latest BeanCounter development requires Windows 7 or later. Seems pointless to me, my Windows XP does fine, except for the power use and need to schedule reboots through the day to ensure stability and reliability of recordings (on edge of my WiFi coverage).
I also have a 1Kw SMA which isn't currently connected (no serial card in Inverter).
Hoping to get a Raspberry Pi soon as I would like to retire the Wundozs PC.
So keen to see development and will assist where I can
Tony
I have a online grid connected Samil 2200 inverter connected via RS232, currently monitored using a Windows PC running PVBeanCounter which uploads to PVoutput.org. Unfortunately the latest BeanCounter development requires Windows 7 or later. Seems pointless to me, my Windows XP does fine, except for the power use and need to schedule reboots through the day to ensure stability and reliability of recordings (on edge of my WiFi coverage).
I also have a 1Kw SMA which isn't currently connected (no serial card in Inverter).
Hoping to get a Raspberry Pi soon as I would like to retire the Wundozs PC.
So keen to see development and will assist where I can
Tony
Re: Photovoltaic/solar systems monitoring
Well, regarding reading the PCM-6048 solar charge regulator, I have the protocol specs:
https://www.dropbox.com/s/funk3gpyf36qk ... harger.pdf
However, I am not skilled enough to make a software or other means to read it.
I have now RS232 and cable between the PCM-6048 and Rpi.
All help and suggestions are welcome. I believe this same protocol is used by other charge regulators and inverters as well.
https://www.dropbox.com/s/funk3gpyf36qk ... harger.pdf
However, I am not skilled enough to make a software or other means to read it.
I have now RS232 and cable between the PCM-6048 and Rpi.
All help and suggestions are welcome. I believe this same protocol is used by other charge regulators and inverters as well.
-
- Posts: 4
- Joined: Mon Nov 18, 2013 6:33 pm
Re: Photovoltaic/solar systems monitoring
I just bought a Raspberry Pi, and am going to use some open source python scripts to collect data from the Mate3. I then plan on using that data to control home automation tasks, mostly to turn certain outlets on/off based on the charge state...
I haven't decided on all the components and technologies yet. So far I just bought the Pi and know that python will be used since that's what's popular these days for this sort of thing.
I haven't decided on all the components and technologies yet. So far I just bought the Pi and know that python will be used since that's what's popular these days for this sort of thing.
Re: Photovoltaic/solar systems monitoring
Well, I found this page:
http://www.fieldlines.com/index.php/topic,147639.0.html
The OP of that topic is successfully monitoring Morningstar Tristar by using PyModbus and Python. And I believe my MPP Solar PCM-6048 just might be compatible.
Here is the pymodbus:
https://github.com/bashwork/pymodbus
And I have this RS232-add-on card (with 1-wire master):
http://www.abelectronics.co.uk/products ... and-1-Wire
I had some trouble installing the pymodbus, as I did not have the setuptools, so git cloned the pymodbus, but "python setup.py install" did not succeed and finished with 404 error. So I then directly downloaded the ez_setup.py-file by "wget https://bitbucket.org/pypa/setuptools/r ... z_setup.py" and replaced the original ez_setup.py that came with pymodbus, then it installed fine.
Then I took the code that is used by "Simen" at http://www.fieldlines.com/index.php/topic,147639.0.html.
Here is the code I am trying to use (his code directly), but I have problems (see below):
Only thing i have changed in the code is ttyUSB0 to ttyAMA0, ttyAMA0 is my serial port and the "Simen" has apparently a USB-RS232-adapter.
http://www.fieldlines.com/index.php/topic,147639.0.html
The OP of that topic is successfully monitoring Morningstar Tristar by using PyModbus and Python. And I believe my MPP Solar PCM-6048 just might be compatible.
Here is the pymodbus:
https://github.com/bashwork/pymodbus
And I have this RS232-add-on card (with 1-wire master):
http://www.abelectronics.co.uk/products ... and-1-Wire
I had some trouble installing the pymodbus, as I did not have the setuptools, so git cloned the pymodbus, but "python setup.py install" did not succeed and finished with 404 error. So I then directly downloaded the ez_setup.py-file by "wget https://bitbucket.org/pypa/setuptools/r ... z_setup.py" and replaced the original ez_setup.py that came with pymodbus, then it installed fine.
Then I took the code that is used by "Simen" at http://www.fieldlines.com/index.php/topic,147639.0.html.
Here is the code I am trying to use (his code directly), but I have problems (see below):
When I run it, I get:#!/usr/bin/env python
import time
a = 2
counter = 0
# import the server implementation
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
# configure the client logging
import logging
logging.basicConfig()
log = logging.getLogger('./modbus.error')
log.setLevel(logging.ERROR)
# choose the serial client
client = ModbusClient(method='rtu', port='/dev/ttyAMA0', baudrate=9600, timeout=1)
client.connect()
# Define the State list
state = ['Start', 'Night Check', 'Disconnected', 'Night', 'Fault!', 'BulkCharge', 'Absorption', 'FloatCharge', 'Equalizing']
while a > 1:
#read the registers from logical address 0 to 30.
rr = client.read_holding_registers(0,30,1)
#scaling
batt_scale = 96.667
i_scale = 66.667
array_scale = 139.15
#the stuff we want
battsV = ( rr.registers[9] * 96.667) / 32768
chargeI = ( rr.registers[11] * float(i_scale )) / (2**15)
arrayV = ( rr.registers[10] * float(array_scale )) / (2**15)
statenum = rr.registers[27]
pwmDuty = rr.registers[28] /2.55
regTemp = rr.registers[14]
powerIn = battsV * chargeI
ampH = ( rr.registers[17] + rr.registers[18] ) * 0.1
#debug
# print "Battery Voltage: %.2f" % battsV
# print "Battery Charge Current: %.2f" % chargeI
# print "Array Voltage: %.2f" % arrayV
# print "PWM Duty: %.2f" % pwmDuty
# print "Control State: %.2f" % state
# print "Controller Temp: %.2f" % regTemp
# print "Power in: %.2f" % powerIn
# print "Ah: %.2f" % ampH
out = "V:%.2f" % battsV + " A:%.3f" % chargeI + " AV:%.2f" % arrayV + " D:%.2f" % pwmDuty + " S:" + state[statenum] + " CT:%.2f" % regTemp + " P:%.2f" % powerIn + " AH:%.2f" % ampH + "\n"
fil = open('/mnt/dumpdata.txt', 'w')
fil.write(out)
fil.close()
counter += 1
if counter == 24:
tid = time.ctime()
out = str(tid) + ",%.2f" % battsV + ",%.3f" % chargeI + ",%.2f" % arrayV + ",%.2f" % pwmDuty + "," + state[statenum] + ",%.2f" % regTemp + ",%.2f" % powerIn + ",%.2f" % ampH + "\n"
fil = open('/mnt/dumplog.csv', 'a')
fil.write(out)
fil.close()
counter = 0
time.sleep(5)
# close the client
client.close()
print "done"
As I am not a code genius or coder at all. I have no idea what is wrong (although, I think the line 26 is right, start from 0, go to thirty and us slave 1?). However, it might be that I am trying running it "dry" so that the solar charge regulator is actually OFF, as the sun does not shine (PCM-6048 switches completely off unless it gets at least 40V from the PV array). Maybe it is that? Any advice would be nice.root@xxxxxxxxx:~/solarcheck# ./solarcheck.py
Traceback (most recent call last):
File "./solarcheck.py", line 26, in <module>
rr = client.read_holding_registers(0,30,1)
TypeError: read_holding_registers() takes at most 3 arguments (4 given)
Only thing i have changed in the code is ttyUSB0 to ttyAMA0, ttyAMA0 is my serial port and the "Simen" has apparently a USB-RS232-adapter.
Re: Photovoltaic/solar systems monitoring
Some update. I changed this:
https://groups.google.com/forum/#!msg/p ... fYgOGjmlAJ
Where it is stated:
Though, it looks like next sun will be available on Sunday.. hope it wakes up sooner by scattered light through the clouds.
In to this:rr = client.read_holding_registers(0,30,1)
As per this:rr = client.read_holding_registers(0,30,unit=1)
https://groups.google.com/forum/#!msg/p ... fYgOGjmlAJ
Where it is stated:
Now I get:Right,
So in the latest version I added a breaking change where the unit I'd needs to be specified by key,
client.read_holding_registers(regIndex, numRegisters, unit=slaveUnit)
This was done so I could add more parameters in the future. The previous line should work fine for the old and new version.
Galen
Which would indicate that as the device is off, it will give no data and thus maybe will work if we get some sunshineroot@xxxxxxx:~/solarcheck# ./solarcheck.py
Traceback (most recent call last):
File "./solarcheck.py", line 26, in <module>
rr = client.read_holding_registers(0,30,unit=1)
File "build/bdist.linux-armv6l/egg/pymodbus/client/common.py", line 109, in read_holding_registers
File "build/bdist.linux-armv6l/egg/pymodbus/client/sync.py", line 83, in execute
File "build/bdist.linux-armv6l/egg/pymodbus/transaction.py", line 68, in execute
File "build/bdist.linux-armv6l/egg/pymodbus/client/sync.py", line 360, in _recv
File "build/bdist.linux-armv6l/egg/serial/serialposix.py", line 475, in read
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

Though, it looks like next sun will be available on Sunday.. hope it wakes up sooner by scattered light through the clouds.
-
- Posts: 1
- Joined: Sun Nov 24, 2013 5:03 pm
Re: Photovoltaic/solar systems monitoring
I have 8.5KW grid-tie solar system and would like to monitor the rs485 outputs on its two KACO inverters, a 2502xi and a 5002xi. I have a RaspBerry Pi plus an rs485 add-on board (modbus, with auto direction). Would anwmalos's software work with this system? If so, how do I obtain it. The link for the mailing list at https://www.solarspy.net/solardev doesn't function.
-
- Posts: 4
- Joined: Mon Nov 18, 2013 6:33 pm
Re: Photovoltaic/solar systems monitoring
As a follow-up to my previous post. I have been using the Raspberry Pi to collect a data stream from Outback Power equipment (specifically a Mate3). I got the original project from Jesus Perez, but I've been making a lot of changes and I pushed it up to github: https://github.com/instanttim/monitormate
The 0.4 release is just bug fixes to Jesus's distribution. And I don't think I even got them all. But the master branch (if you download the latest) has a lot of changes...
Oh, you can see the current unstable version of it running on my system: http://finleyridge.com/power/monitormate.html
The 0.4 release is just bug fixes to Jesus's distribution. And I don't think I even got them all. But the master branch (if you download the latest) has a lot of changes...
- Custom labels for your devices and shunts
- Page layout re-design (HTML/CSS updates)
- Updated Flot for high-res (retina screen) charts
- Colored thresholds on the SOC chart Red, Yellow, and Green to match FNDC and Mate3 color-coding.
- Staggered bar charts (instead of overlapping them)
- Refactored some of the code, cleanup, etc.
Oh, you can see the current unstable version of it running on my system: http://finleyridge.com/power/monitormate.html
Re: Photovoltaic/solar systems monitoring
Hey Instattim, looks like a great work! However, I am using different brand, but hope to utilize your work. Does the Outback use MODBUS/JBUS?
My MPPT PCM-6048 uses JBUS, which I think is pretty much equivalent to MODBUS.
What speeds are you using? Are you connecting by RS232 or something else?
My MPPT PCM-6048 uses JBUS, which I think is pretty much equivalent to MODBUS.
What speeds are you using? Are you connecting by RS232 or something else?
Re: Photovoltaic/solar systems monitoring
I stumbled across this forum in my search for details on the Tracer MT-5 board. I've managed to get it working with an Arduino and am in the process of writing Python code that will be running on my Raspberry Pi. I put my work-in-progress on my Tracer Github repository. I'll be posting more commits in a bit.
Re: Photovoltaic/solar systems monitoring
Hi Instatim and all. I also am interested in your monitoring project. I am currently using a Windows machine to monitor my Outback 4.4kw grid-tie system as you can see at http://bbbrown.mysolarlog.com/ . I have a new Raspberry Pi and since the only Windows machine I have is the one I am using for monitoring I would love to ditch it and use my RP to do the job. Your website looks nice. I'm interested in how you interface the Pi with the Mate. Any info appreciated.
-
- Posts: 4
- Joined: Mon Nov 18, 2013 6:33 pm
Re: Photovoltaic/solar systems monitoring
The entire project is up on github, (link is in my previous post). The Pi is running a python script which is consuming the UDP data stream from the MATE3. It then formats that as json and sends it on to a web server and SQL database. That could be the same computer (Pi) or it could be a hosted web server anywhere on the internet.rbrown3rd wrote:I'm interested in how you interface the Pi with the Mate. Any info appreciated.
Re: Photovoltaic/solar systems monitoring
Please email me khaupt@vas-x.com
Re: Photovoltaic/solar systems monitoring
Hello Anwmalos, are you still on this project?anwmalos wrote:Hi,
You are lucky because fronius inverters are already supported very well. Right now the probe extracts the following info:
power, currentAC, currentDC, voltageAC, voltageDC, frequencyAC, Phase1Current, Phase2Current, Phase3Current, Phase1Voltage, Phase2Voltage, Phase3Voltage, DailyEnergy, TotalEnergy
(these are actually the names of the db columns...)
They are sampled every 5-10secs and an average value is commited in the db every 1 minute.
If you are interested in using/contributing please pm me for more information.
Does this support Modbus/Jbus?
I really would like to test and make this working with PCM-6048 MPP Solar's charge controller, which communicates via RS232.
Xantrex 3.0 and Rainforest Raven to PVOutput.org!
I finally got my RPi to push data to pvoutput.org! I have a Xantrex 3 grid tie inverter and a Zigbee dongle (Rainforest Raven) for communication with the smart meter on the house.
http://www.pvoutput.org/intraday.jsp?id=28821&sid=26410
The Perl code is based on solar.js.cx code. The site is gone but I found an example here: http://blog.our-files.com/2012/10/solar ... ing-stuff/
I added another serial port to the code to monitor both inputs.
http://www.pvoutput.org/intraday.jsp?id=28821&sid=26410
The Perl code is based on solar.js.cx code. The site is gone but I found an example here: http://blog.our-files.com/2012/10/solar ... ing-stuff/
I added another serial port to the code to monitor both inputs.
-
- Posts: 1
- Joined: Sat Mar 08, 2014 5:24 pm
Re: Photovoltaic/solar systems monitoring
Hi,
I have a Steca 2000 inverter with an rs485 port would your setup work for me?

I have a Steca 2000 inverter with an rs485 port would your setup work for me?

Re: Photovoltaic/solar systems monitoring
I am willing to try anything, so far nothing has worked with my MPP Solar PCM-6048 Solar Charge Controller, the interface is RS232
Apparently it uses "Helios Inverter Protocol" and protocol specs also mention J-BUS, which again maybe is pretty much same as MODBUS..
All help would be highly appreciated.

All help would be highly appreciated.
Re: Photovoltaic/solar systems monitoring
Code: Select all
$serial_port->write("INV?\r");
($count, $xantrex_status) = $serial_port->read(255);
$serial_port->write("KWHTODAY?\r");
($count, $xantrex_kwhtoday) = $serial_port->read(255);
$serial_port->write("TIME?\r");
($count, $xantrex_time) = $serial_port->read(255);
$serial_port->write("POUT?\r");
($count, $xantrex_pout) = $serial_port->read(255);
Re: Photovoltaic/solar systems monitoring
Not much info out there on the MPP other than using their own software. There are JBUS docs but that protocol requires a lot of parsing to get meaningful data out of it.
Have you hooked up a terminal emulator to see what the output looks like? I wonder if there's a way to 'sniff' the serial port while the charger is talking to a PC.
Have you hooked up a terminal emulator to see what the output looks like? I wonder if there's a way to 'sniff' the serial port while the charger is talking to a PC.
Re: Photovoltaic/solar systems monitoring
I have connected to this controller via cu-command from command line. I do not get anything out of it. I think I have minicom or some other terminal emulator, but what should I try with it?N3tguru wrote:Not much info out there on the MPP other than using their own software. There are JBUS docs but that protocol requires a lot of parsing to get meaningful data out of it.
Have you hooked up a terminal emulator to see what the output looks like? I wonder if there's a way to 'sniff' the serial port while the charger is talking to a PC.
I have the software for Windows XP and it works, but it does not help in this case of course. I did get the specs for baudrate though from the XP software, it is 9600,n,8,1

Re: Photovoltaic/solar systems monitoring
Hmm. Even though this is more going towards off-topic..
I suspect that my /dev/ttyAMA0 is not working properly.
As if I do: python -m serial.tools.list_ports
It lists only ttyUSB0 and ttyUSB1
I have 3g dongle there, which the ttyUSB's are related, I guess.
How do I make sure my ttyAMA0 is working properly? I am not onsite right now, but I left the cable in place between the charge controller and Raspberry Pi.
I think I should see something if I access the ttyAMA0 via terminal emulator or simply by cat-command or so..
I suspect that my /dev/ttyAMA0 is not working properly.
As if I do: python -m serial.tools.list_ports
It lists only ttyUSB0 and ttyUSB1
I have 3g dongle there, which the ttyUSB's are related, I guess.
How do I make sure my ttyAMA0 is working properly? I am not onsite right now, but I left the cable in place between the charge controller and Raspberry Pi.
I think I should see something if I access the ttyAMA0 via terminal emulator or simply by cat-command or so..
Re: Photovoltaic/solar systems monitoring
I am going somewhere with this. The SunnyRoo device's protocol looks almost identical. I just go the libpowercom that should work with it, but so far no luck. I have not yet found any other software to work with Sunny Roo. And looks like PV Bean Counter is no longer available for Linux.. Maybe someone knows where to get old version of PVBC that would run on Linux?
Now I think I must somehow make sure my Raspi's ttyAMA0 works as it should be working.
Now I think I must somehow make sure my Raspi's ttyAMA0 works as it should be working.
Re: Photovoltaic/solar systems monitoring
Yes, minicom will do the trick. minicom -b 9600 -o -D /dev/ttyAMA0. Try it also with sudo.
If its RS232 I have only had luck using a USB to RS232 adapter with the RasPi. It would then obviously show up on ttyUSB0 or ttyUSB1.
I had issues with acces to the /dev/ttyusb0 device until I followed the first part of this guide: http://elinux.org/RPi_Serial_Connection
My cron job to export info to pvoutput runs as root.
If its RS232 I have only had luck using a USB to RS232 adapter with the RasPi. It would then obviously show up on ttyUSB0 or ttyUSB1.
I had issues with acces to the /dev/ttyusb0 device until I followed the first part of this guide: http://elinux.org/RPi_Serial_Connection
My cron job to export info to pvoutput runs as root.
Re: Photovoltaic/solar systems monitoring
Sorry.. more goodies. Im looking for a way to do TDS monitoring of a RO unit... found this doc on using the ttyAMA0 port. https://www.atlas-scientific.com/_files ... e_code.pdf
Re: Photovoltaic/solar systems monitoring
I have run all my tests as root.N3tguru wrote:Yes, minicom will do the trick. minicom -b 9600 -o -D /dev/ttyAMA0. Try it also with sudo.
If its RS232 I have only had luck using a USB to RS232 adapter with the RasPi. It would then obviously show up on ttyUSB0 or ttyUSB1.
I had issues with acces to the /dev/ttyusb0 device until I followed the first part of this guide: http://elinux.org/RPi_Serial_Connection
My cron job to export info to pvoutput runs as root.
Well, I did not get anything from terminal connection. I think my RS232 does not work

I have done everything that is needed to take ttyAMA0 into use. That is to disable getty to ttyAMA0 from inittab and then remove references for ttyAMA0 console from cmdline.txt.
This is what I have: http://www.abelectronics.co.uk/products ... and-1-Wire
Then I have this: http://cgi.ebay.co.uk/ws/eBayISAPI.dll? ... 1038612257 (only the transmitter)
And then this RTC: http://cgi.ebay.co.uk/ws/eBayISAPI.dll? ... 1210428446
So maybe those interfere with the RS232 communications?
I did get proper information when I connected to the ttyUSB1 with minicom, which gives information from the USB-3g-dongle.
I better get a USB-RS232 adapter for this.. I guess.
And I did get the libpowercom installed and also tested with the libpowercom-testfile that comes with it. I guess the libpowercom is the correct way to go with my controller.