N3tguru
Posts: 20
Joined: Thu Mar 06, 2014 5:31 am

Re: Photovoltaic/solar systems monitoring

Wed Mar 12, 2014 3:43 pm

Let us know how it goes. Hopefully the USB adapter clears it up for you.

jets
Posts: 58
Joined: Mon May 06, 2013 9:40 am

Re: Photovoltaic/solar systems monitoring

Wed Mar 12, 2014 6:07 pm

N3tguru wrote:Let us know how it goes. Hopefully the USB adapter clears it up for you.
I will get back here when I know. I hope I can install the USB-RS232 adapter tomorrow, as I need to visit my cabin. I tested the adapter at home with another Raspberry Pi and it works fine.

One thing is that my controller might require some sort of handshake to occur. And in Raspi, there are apparently only three pins associated, so it does not really do proper "full handshaking". I hope the USB-RS232 adapter will do.

I have a strong feeling, that now I will get it to work :) I also hope that I will have some time to test it on Friday. I cannot test it tomorrow, as there won't be enough sunlight to power up the controller when I get home.

jets
Posts: 58
Joined: Mon May 06, 2013 9:40 am

Re: Photovoltaic/solar systems monitoring

Fri Mar 14, 2014 12:17 pm

Well, I got to test it yesterday shortly, but I did not have much luck. With USB-RS232 adapter with two ports, which did come to be either ttyUSB0 and ttyUSB1 OR ttyUSB2 and ttyUSB3 depending on how the Linux decided to have them. The USB 3g Dongle apparently became also ttyUSBsomething :)

Ok, I was able to figure out which ttyUSBx was which, and I think it pretty much consistently will put the RS232 adapter to ttyUSB0/1 after a reboot, I think.

Anyway, I DID get something out from the controller, but it was either garbage or just something libpowercom did not understand. It looked like the controller did not respond to all requests and there were CRC errors and so on. Also, this could be a power issue with the USB, maybe.

Unfortunately, I have been unable to continue testing today as the remote connection is down. It has been sunny, so there would have been enough power to turn on the controller. Would have been good day to dig into this problem.

So, I think I am going somewhere here.

I will try to sniff what the XP client is doing with the controller. But even though I find some good data, I am not much of a coder.

Ruthdm
Posts: 4
Joined: Sat Oct 20, 2012 2:34 am

Re: Photovoltaic/solar systems monitoring

Fri Mar 14, 2014 9:07 pm

Especially to N3tguru:
how well is your Zigbee staying connected to your Raspberry Pi? We are using a Pi to collect data from wind turbines that talk via Zigbee radios (proprietary programming; we have to use the Mfger-supplied driver). The Pi rarely works flawlessly; it may lose communication with the Zigbee, or somehow refuse to talk to us, for a few minutes to hours. One way to fix it is to reboot, but we can't go writing a reboot in every 5 minutes! We have put in a check-then-clear on the USB buffer and this has improved things, but not enough to make it reliable.

Caveat here: I'm not the one doing the programming, so please be patient with me. I can pass on your suggestions, but I may not be able to implement them myself.
The system in action may be seen here: wind.ece.ksu.edu.
The turbines KSU, HopeStreet, Washburn, Concordia and Eudora are running Pis.

Ruth

N3tguru
Posts: 20
Joined: Thu Mar 06, 2014 5:31 am

Re: Photovoltaic/solar systems monitoring

Fri Mar 14, 2014 10:20 pm

I have had issues with the Pi since I implemented the Zigbee adapter, but a little more than just not connecting. Its connected flawlessly, but the Pi does get warm and it locks after about 36 hours of continuous operation. Ive taken the cover off the enclosure to see if it improves. I do not overclock this Pi at all, and I use a powered USB hub with the Zigbee radio. I need to connect a console cable and see if its an ethernet issue or a processor lockup.

On the USB front, the Zigbee radio I have (Rainforest Raven) has been reported to not like USB 2.0 configurations in the OS. There's a note out there to modify /boot/cmdline.txt to include dwc_otg.speed=1 to slow the USB port to 1.1 speeds and compatibility. I did this to help with the lock ups but they continue to happen but it may work with your disconnection issues.

My radio is about 6 feet from the meter with an exterior wall in the way, so I dont have issues with disconnects. Check for interference as these radios can operate anywhere from 868mhz, 915mhz or 2.4Ghz depending on region (see http://en.wikipedia.org/wiki/ZigBee#ZigBee_PRO)

N3tguru
Posts: 20
Joined: Thu Mar 06, 2014 5:31 am

Re: Photovoltaic/solar systems monitoring

Fri Mar 14, 2014 10:27 pm

jets wrote:Anyway, I DID get something out from the controller, but it was either garbage or just something libpowercom did not understand. It looked like the controller did not respond to all requests and there were CRC errors and so on. Also, this could be a power issue with the USB, maybe.

Unfortunately, I have been unable to continue testing today as the remote connection is down. It has been sunny, so there would have been enough power to turn on the controller. Would have been good day to dig into this problem.

So, I think I am going somewhere here.

I will try to sniff what the XP client is doing with the controller. But even though I find some good data, I am not much of a coder.
Power issues are very possible. With a sniffer you should see the raw hex code flying by with request and received data. Problem is how to parse and interpret that data as it comes in.

Assuming your rs232 is setup correctly for baud, bits etc the data should at least be human readable characters and not symbols.

I was very lucky that pvoutput had a built in interpreter for the XML code coming from the Raven. All values are represented in hex and encased in XML. PVoutput does all the calculation from hex to decimal and parses XML to put the data in the proper places. Maybe email them to see if they have any experience interpreting the stream from your gear.

Ruthdm
Posts: 4
Joined: Sat Oct 20, 2012 2:34 am

Re: Photovoltaic/solar systems monitoring

Sat Mar 15, 2014 4:52 pm

Thanks for the quick answer. Your problems do not sound greatly different from ours, though I am not at all sure heat is the culprit. We do have a powered USB hub on our Pi (though that may not be practical for the full implementation, all 150 turbines). I am sure the Zigbees, which are not new, won't work at USB2.0 well. I'll check on controlling that.

Have you tried an auto-reboot daily?

Ruth

N3tguru
Posts: 20
Joined: Thu Mar 06, 2014 5:31 am

Re: Photovoltaic/solar systems monitoring

Mon Mar 17, 2014 5:39 pm

Ruth,

After removing the cover the Pi it still locked up so I doubt its heat. As far as I know the Ethernet and USB controller are the same chip on the Pi so it could be a driver or buffer issue. I have not tried swapping hardware yet.

I have not tried an auto reboot yet. I went ahead and put a timer on the power input to give the Pi a break every day at midnight for 10 minutes. It's more abrupt than a nice 'sudo reboot' command but it should get the job done. And if the Pi locks up prior to the timer I have a guaranteed reboot at midnight.

The Rainforest Raven is constantly giving data to /dev/ttyUSB0 in the form of a XML power status update. Maybe if I turn this off somehow it will help. Does anyone know if there's a buffer for these tty ports?

N3tguru
Posts: 20
Joined: Thu Mar 06, 2014 5:31 am

Re: Photovoltaic/solar systems monitoring

Wed Mar 26, 2014 5:05 am

Ok... I added a script to my Pi so it will reboot itself upon losing network connectivity. I don't think the Pi is locking up, just deciding to stop talking to the world. If anyone is interested I can share the code in another post. I used the code on another project where my fleet of Pi digital signage boxes would lose network connectivity every now and then.

One side effect of this is the auto assignment of ttyUSB0 and ttyUSB1 ports when the Pi comes back up. Its relatively random and I wanted a way to statically assign it. Built into linux are symbolic links already defined for USB ports when hardware is added. Kinda neat and you don't need to mess with udev rules.

This code was added to my xantrex.pl script so i don't have to care which tty port the usb devices are assigned to:

Code: Select all

$serial_port = "/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0"; #Xantrex Inverter
$serial_port2 = "/dev/serial/by-id/usb-Rainforest_RFA-Z106-RA-PC_RAVEn_v2.3.21-if00-port0"; #RAVEn USB Stick

Ruthdm
Posts: 4
Joined: Sat Oct 20, 2012 2:34 am

Re: Photovoltaic/solar systems monitoring

Thu Mar 27, 2014 4:28 pm

Thanks, N3tguru! I am not quite sure whether we lose the network or just lose the Zigbee, but a reboot does fix it. But we have not tried, "reboot when you lose network"; we have "reboot every day at midnight" and "clear USB buffer when it fails to change". But the latter is not foolproof: witness right now, with my Pi locked up at 00:52 hours this morning and not clearing its buffer, or not knowing it ought to: I can't tell which. Do please share the reboot code, and for this novice Linux user, advice as to where to put it?

N3tguru
Posts: 20
Joined: Thu Mar 06, 2014 5:31 am

Re: Photovoltaic/solar systems monitoring

Fri Mar 28, 2014 11:08 pm

Ok here's what I did. I modified an example I found on the web. Wish I knew where I found it to give credit (probably this forum somewhere).

First set of commands:

Code: Select all

cd /opt
sudo mkdir check_lan
sudo nano check_lan.sh
Insert this code in the nano text editor. Ctrl-X to save and exit:

Code: Select all

#!/bin/sh
# cron script for checking wlan connectivity
# change 192.168.1.1 to whatever IP you want to check.
IP_FOR_TEST="192.168.1.1"
PING_COUNT=1

PING="/bin/ping"
IFUP="/sbin/ifup"
IFDOWN="/sbin/ifdown --force"

INTERFACE="eth0"

FFLAG="/opt/check_lan/stuck.fflg"
echo "Running network check"
# ping test
$PING -c $PING_COUNT $IP_FOR_TEST > /dev/null 2> /dev/null
if [ $? -ge 1 ]
then
echo "Rebooting now!!!"
sudo reboot
else
logger "$INTERFACE is up"
rm -f $FFLAG 2>/dev/null
fi

Then these commands:

Code: Select all

sudo chmod 777 check_lan
sudo chmod 777 check_lan.sh
Last, we add an entry in crontab under root to run this script every 2 minutes:

Code: Select all

sudo crontab -e

*/2 * * * * /opt/check_lan.sh >/dev/null
That's it. You can change INTERFACE="eth0" to "wlan0" if its wireless. I have not tested it with a WiFi adapter yet.

Good luck!

ruperthowton
Posts: 1
Joined: Tue Apr 22, 2014 9:16 pm

Re: Photovoltaic/solar systems monitoring

Tue Apr 22, 2014 9:29 pm

Hi, Have a Pi and a home made 18 volt - 60 watt Panel connected to a gel deep cycle hobby battery via a charge controller - It has survived a wet winter and is still producing good results powering 2 x 12v halogen lamps in our garage. Id like to monitor its efficiency. Presumably I would need some sort of a module interface to connect the panel to the pi?

bazofias
Posts: 1
Joined: Thu Jun 12, 2014 9:33 pm

Re: Photovoltaic/solar systems monitoring

Thu Jun 12, 2014 9:49 pm

Found this thread yesterday, and today I found this http://whirlpool.net.au/wiki/solar_software , remembered you guys, and registered only to leave the info. Hope it can help!

Me myself, I've been trying to develop a cheap way to make inverters reduce their efficiency ("defasing" the MPPT U/I ratio) when the grid tension rises too close to the legal limit (253V in Portugal), so the inverter won't go into security shutdown. I've been thinking of Arduino, but R-pi would also be a great option (with the perk of integrating this monitoring feature).
I know this type of "defasing" can be done in some inverter brands. I know a device - quite expensive btw - that can do it, but only depending on the measured consumption of the "building"(determined by clamp metering). Im having a hard time finding the protocols for the inverters i'm most interested in: Kako and Kostal grid-tie inverters. I know it's off topic, so no need to really bother, but I could use some advice.

Thank you, and keep up the good work!

CharlesGodwin
Posts: 85
Joined: Wed Aug 22, 2012 9:57 pm
Location: Ottawa Canada

Re: Photovoltaic/solar systems monitoring

Thu Jun 19, 2014 3:01 pm

I am about to publish an article on using a Pi to log all the data on the Magnum Energy network. I will not be doing anything about your charge controller.

Charles Godwin

tlankford01
Posts: 4
Joined: Mon Aug 18, 2014 4:28 am

Re: Photovoltaic/solar systems monitoring

Mon Aug 18, 2014 5:17 am

Hello,

I have a complete off grid house that my family has lived in for over three years. I am just now getting to where I can log the data and would like to use my Raspberry Pi to send data to a LAMP server I have in my lab. We have solar electric, solar water heat and rainwater catchment for all of our domestic water. We have not had problems with our system at all in this time. I would like to log data so that we can begin to quantify just how successful this has been. My system is as follows:

[10] 230 watt SolarWorld Panels (5 strings of 2 for 60V output)
Outback Power Systems FlexMax 80
Outback Power Systems VFX3524 Inverter
Outback HUB-4 Communication Manager
Outback MATE Remote Monitor & control
12 Trojan L16RE Batteries for 1210 Ah at 24 Volts

I have an Rapsberry Pi and a USB to Serial Adapter. I was hoping to use the Rpi to communicate with the Mate and then have it send the data to my server through the wireless LAN. I would be interested in helping to log data and to assist with adapting the software if necessary. My email is [email protected]. Thank you for the work you all have put into this.

CharlesGodwin
Posts: 85
Joined: Wed Aug 22, 2012 9:57 pm
Location: Ottawa Canada

Re: Photovoltaic/solar systems monitoring

Mon Aug 18, 2014 8:14 pm

Thanks for your interest. My brother has a very similar system except for only 6 batteries but also has a FlexNetDC. We just became aware of Outback's new AXS Port which make data gathering straight forward. (not necessarily easy, but straight forward) . We plan to check with outback about support for the Flexnet DC module. It is discussed at these links
http://www.outbackpower.com/outback-pro ... ory_id=440
http://legacy.outbackpower.com/products ... tions/axs/

Also, I did publish a short article on my progress http://www.raspberrypi.org/forums/viewt ... 55#p566255.

I will write you separately in a few days about what I have done and how you can use it for your system.

tlankford01
Posts: 4
Joined: Mon Aug 18, 2014 4:28 am

Re: Photovoltaic/solar systems monitoring

Tue Aug 19, 2014 12:18 am

Thank you for the quick reply. I will go through your tutorials this evening.

sunmetrix
Posts: 2
Joined: Fri Sep 05, 2014 3:14 pm
Contact: Website

Re: Photovoltaic/solar systems monitoring

Fri Sep 05, 2014 3:18 pm

Very cool project! We developed a software that uses satellite data to monitor solar panel installations ( http://sunmetrix.com/track-landing ). I wonder if our data may be of use to this effort.

N3tguru
Posts: 20
Joined: Thu Mar 06, 2014 5:31 am

Re: Photovoltaic/solar systems monitoring

Sat Sep 06, 2014 6:51 am

I don't get the point of Sunmetrix. Yes it's a predictive engine based on weather data at my location. What else does it do? I hope you took into account the actual impacts of environment on a solar array such as:

- Mountains affecting actual sunrise / sunset along seasonal slope variations.
- Partly cloudy and foggy / hazy days which present widely variable sunlight exposure.
- System efficiency (I own a 2.8kw system but I will only ever generate 2.2kw at a maximum under optimal conditions).
- System health (Are my panels muddy? Did something crack a panel today?)
- System age - the average array can loose 20% of it's generating power over its lifespan.

If I could get your data and import it into pvoutput.org as "optimal theoretical" data I can see some merit in your site. But would I believe any of your numbers without real data from the actual system... Nope. Would I spend $5/mo on it? Probably not.

Sorry if I don't fully understand the concept, but if I can't have real numbers to look at then what's the point?

sunmetrix
Posts: 2
Joined: Fri Sep 05, 2014 3:14 pm
Contact: Website

Re: Photovoltaic/solar systems monitoring

Mon Sep 08, 2014 12:42 pm

Thanks so much for trying Sunmetrix. We do keep track of some of the variables you mentioned (e.g., cloudy days), however since the sensors we use are very far away (1/10th the distance to the Moon), it's not possible for us to monitor things like mud on a solar panel. The main point of using Sunmetrix would be to compare the expected output levels (based on the cloud conditions, seasonal effects, etc.) with your actual production and making sure that all systems are OK. Also, for people who do not currently have any solar panels, it enables a quick way to "test drive" them for their location.

I just thought an in-situ sensor based on Raspberry Pi and a remote "virtual" sensor based on Sunmetrix would nicely complement each other and provide a very cost-effective way to monitor system performance. Just knowing the system output (without any link to the weather conditions of that day) may not give the full picture, but perhaps I'm missing something.

N3tguru
Posts: 20
Joined: Thu Mar 06, 2014 5:31 am

Re: Photovoltaic/solar systems monitoring

Mon Sep 15, 2014 4:12 am

If there was a way to import your data on a daily basis to pvoutput.org or other monitoring site as another data point it might get interesting. Pvoutput does do some predictive calc based on location and other factors. Placing regional expected data on the graph would be neat I think.

nrobin06
Posts: 1
Joined: Fri Oct 17, 2014 2:00 pm

Re: Photovoltaic/solar systems monitoring

Fri Oct 17, 2014 2:14 pm

hi,

i have faced similar modbus coneection issue with a raspPi connected to tristar mppt45 through a linksprite RS232 shield.
(tristar doesn't answer to a read register request form the pi)
but RaspPi connected to tristar with USB to RS232 the connection works fine.
My Pi/RS232 connected to a PC using Modbus_slave emulator works fine.

My issue is maybe between tristar to linksrpite RS232 shield. i'll raise ther question to Morning star.

regards,
nico

Tafkas
Posts: 49
Joined: Sun Sep 16, 2012 11:15 pm
Contact: Website

Re: Photovoltaic/solar systems monitoring

Sun Oct 19, 2014 4:08 pm

I put a photovoltaic/solar systems monitoring together myself. So far I can just provide a little sneak peak though: http://pi.tafkas.net/photovoltaic/

rbrown3rd
Posts: 6
Joined: Fri Feb 14, 2014 12:47 pm

Re: Photovoltaic/solar systems monitoring

Sun Oct 19, 2014 4:14 pm

That looks very nice. Would you mind sharing some more details about your setup?

Tafkas
Posts: 49
Joined: Sun Sep 16, 2012 11:15 pm
Contact: Website

Re: Photovoltaic/solar systems monitoring

Sat Oct 25, 2014 3:51 pm

Sure. The goal is to have a Raspberry Pi photovoltaic monitoring solution. The idea is to frequently fetch data from an inverter and store it in a little database on the Raspberry Pi. Therefor I have written a library that provides a clean interface for accessing the inverter (Pikopy).

The next step is a little application that provides a dashboard with all interesting metrics. The image I have linked shows its current state. Once it reaches a certain quality I will share the code on GitHub.

Furthermore I am planning on reading the data from the meter, which lets me analyze how much energy is fed into and how much is drawn from the network.

Return to “Automation, sensing and robotics”