23 febbraio 2013

Aurora Inverter, Raspberry Pi, 123solar: photovoltaic solar monitor and logger

In this post I will explain how build a solar monitor and logger with


1. Update and Upgrade system
1.1 Update the Package Index:

To update the local package index with the latest changes made in repositories, type the following:

$ sudo apt-get update 
 
1.2 Upgrade Packages:
To upgrade your system type:

$ sudo apt-get upgrade

2. Install Apache webserver

2.1  Install package

$ sudo apt-get install apache2 apache2-doc

2.2  Enable and Configure Apache2 Userdir Module
Apache2 userdir module is used to create a webroot in the user’s home directory. By using userdir module each user that is in the system will have the Apache2 root directory with the folder name public_html  in the home directory, If you using any web browser to access the webroot folder in the user directory you should use the “~” afterwards username. So, the url address to be http://[hostname]/~username/

$ a2enmod userdir 

2.3 Edit the file  userdir.conf 
with nano:


$ sudo nano /etc/apache2/mods-enabled/userdir.conf

and make it so:

userdir.conf


2.4 Create public directory "public_html" and provide grants

$ mkdir /home/youruser/public_html        
where youruser for example is pi

$ chgrp www-data /home/youruser/public_html
$ chmod -v 755 /home/youruser

2.5 Restart Apache service


$ service apache2 restart

3 Install PHP
3.1  Install package

$ apt-get install php5 libapache2-mod-php5 php5-curl

3.2 Configure php.ini

$ sudo nano /etc/php5/apache2/php.ini

add to "Module Settings" section the below string:

date.timezone = "Europe/Rome"
choose your timezone

add to "Dynamic Extensions" section the below string:

extension=calendar.so

4 Install others packages

4.1 RRDtool
A useful open source tool for storage and retrieval of time series data.

$ sudo apt-get install rrdtool

4.2  systemd
It is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and D-Bus activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux cgroups, supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic. It can work as a drop-in replacement for sysvinit.  
 

$ sudo apt-get install systemd

5. Install AURORA 1.8.3

5.1 Download package

$ cd /home 
$ wget http://www.curtronics.com/Solar/ftp/aurora-1.8.3.tar.gz

5.2 Unzip package

$ tar -xzvf aurora-1.8.3.tar.gz
$ rm aurora-1.8.3.tar.gz

5.3 make and install

$ cd aurora-1.8.3
$ make
$ make install
$ cd /..

6. Install 123Solar
123Solar is a set of PHP/JS files that will create a web solar logger to monitor Power One Aurora and SMA Inverters.

6.1 Download package

$ cd /var/www
$ wget http://123Solar.googlecode.com/files/123solar1.5.3.2.tar.gz
$ tar -xzvf 123solar1.5.3.2.tar.gz
$ rm 123solar1.5.3.2.tar.gz 

6.2 Install service

$ cd /etc/systemd/system
$ wget http://123solar.googlecode.com/files/123solar.service
$ systemctl enable 123solar.service

6.3 Install 123solar

$ cd /var/www/123solar
$ ./install.sh


at the end you will see something such as:

now, in your local browser, you can open the administration page at address:
http://xxx.xxx.xxx.xxx/123solar/config/index.php

6.4 Configure 123solar configuration page



123Solar Administration page - General Section
123Solar Administration page - Inverter, Front page, Info details, Dashboard


123Solar Administration page -Expected Production, Notification and report, Alarms and Warnings, PVoutput.org

in the future if you will want come back in administration page, you must type:
$ 123solar admin

7 Change usb-serial speed and autostart 123solar

$ sudo nano /etc/rc.local

edit file and add 2 rows before the "exit 0":
stty -F /dev/ttyUSB0 19200
sudo 123solar start


8 Update RPI firmware

$ sudo -s
$ cd /..
$ wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
$ apt-get install git-core
$ rpi-update
$ shutdown -r now


9 Change boot config information

$ sudo nano /boot/cmdline.txt



make sure retain all informations in just one row


The end