Difference between revisions of "Instructions and HOWTO page"

From wiki.breedveld.net
Jump to: navigation, search
(485solar-get Installation:)
(Output Examples:)
Line 205: Line 205:
  
 
==Output Examples:==
 
==Output Examples:==
#output examples for 485solar-get
+
output examples for 485solar-get<br>
 
+
<br>
 
485solar-get -d (request data)
 
485solar-get -d (request data)
20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK
+
20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK
  
 
485solar-get -d -c (request data in column format)
 
485solar-get -d -c (request data in column format)
Date 20130712-15:39:04
+
Date 20130712-15:39:04
Upv-Ist V 172.000000  
+
Upv-Ist V 172.000000  
Ipv A 3.494000  
+
Ipv A 3.494000  
Pdc 600.968000  
+
Pdc 600.968000  
dummy 0.000000  
+
dummy 0.000000  
dummy 0.000000  
+
dummy 0.000000  
dummy 0.000000  
+
dummy 0.000000  
Uac V 234.000003  
+
Uac V 234.000003  
Iac-Ist A 2.346000  
+
Iac-Ist A 2.346000  
Pac W 549.000000  
+
Pac W 549.000000  
Fac Hz 49.989999  
+
Fac Hz 49.989999  
Effcy 91.346629  
+
Effcy 91.346629  
dummy 0.000000  
+
dummy 0.000000  
dummy 0.000000  
+
dummy 0.000000  
dummy 0.000000  
+
dummy 0.000000  
dummy 0.000000  
+
dummy 0.000000  
dummy 0.000000  
+
dummy 0.000000  
dummy 0.000000  
+
dummy 0.000000  
dummy 0.000000  
+
dummy 0.000000  
E-Total kWh 889.537042  
+
E-Total kWh 889.537042  
dummy 0.000000  
+
dummy 0.000000  
State OK
+
State OK
  
 
485solar-get -e (events)
 
485solar-get -e (events)
169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK
+
169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK
  
 
485solar-get -c -e (events in column format)
 
485solar-get -c -e (events in column format)
Upv-Ist 172.000000
+
Upv-Ist 172.000000
Upv-Ist 172.000000
+
Upv-Ist 172.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
Upv-Ist 172.000000
+
Upv-Ist 172.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
Riso 3.000000
+
Riso 3.000000
Uac 234.000003
+
Uac 234.000003
Uac 234.000003
+
Uac 234.000003
Uac 234.000003
+
Uac 234.000003
Fac 49.959999
+
Fac 49.959999
Plimit 1200.000000
+
Plimit 1200.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
Pac 582.000000
+
Pac 582.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
dummy 0.000000
+
dummy 0.000000
State OK
+
State OK
  
 
485solar-get -i (info)
 
485solar-get -i (info)
1 WR12-061 SN:2002116358
+
1 WR12-061 SN:2002116358
Software-BFR 4.090000  
+
Software-BFR 4.090000  
SMA-SN 2002116358.000000  
+
SMA-SN 2002116358.000000  
Default 8.000000 BE/C10/11
+
Default 8.000000 BE/C10/11
Status Mpp
+
Status Mpp
Betriebsart Mpp-Betrieb
+
Betriebsart Mpp-Betrieb
485solar-get v1.000 daemon: Running
+
485solar-get v1.000 daemon: Running
485solar-get -a (alarms)
+
485solar-get -a (alarms)
Fehler -------
+
Fehler -------
  
 
485solar-get -s (possible status fields)
 
485solar-get -s (possible status fields)
All possible status texts for Status:
+
All possible status texts for Status:
( 0): 'Offset'
+
( 0): 'Offset'
( 1): 'Stop'
+
( 1): 'Stop'
( 2): 'Netzueb.'
+
( 2): 'Netzueb.'
( 3): 'Warten'
+
( 3): 'Warten'
( 4): 'U-Konst'
+
( 4): 'U-Konst'
( 5): 'Turbine'
+
( 5): 'Turbine'
( 6): 'Mpp-Such'
+
( 6): 'Mpp-Such'
( 7): 'Mpp'
+
( 7): 'Mpp'
( 8): 'Stoer.'
+
( 8): 'Stoer.'
( 9): 'Fehler'
+
( 9): 'Fehler'
(10): 'Mpp-Peak'
+
(10): 'Mpp-Peak'
(11): 'Derating'
+
(11): 'Derating'
All possible status texts for Fehler:
+
All possible status texts for Fehler:
( 0): '-------'
+
( 0): '-------'
( 1): 'NUW-UAC'
+
( 1): 'NUW-UAC'
( 2): 'NUW-FAC'
+
( 2): 'NUW-FAC'
( 3): 'B3'
+
( 3): 'B3'
( 4): 'K1-Trenn'
+
( 4): 'K1-Trenn'
( 5): 'B5'
+
( 5): 'B5'
( 6): 'EEPROM dBh'
+
( 6): 'EEPROM dBh'
( 7): 'ROM'
+
( 7): 'ROM'
( 8): 'B8'
+
( 8): 'B8'
( 9): 'B9'
+
( 9): 'B9'
(10): 'B10'
+
(10): 'B10'
(11): 'B11'
+
(11): 'B11'
(12): 'B12'
+
(12): 'B12'
(13): 'EeRestore'
+
(13): 'EeRestore'
(14): 'B14'
+
(14): 'B14'
(15): 'B15'
+
(15): 'B15'
(16): 'B16'
+
(16): 'B16'
(17): 'B17'
+
(17): 'B17'
(18): 'AC'
+
(18): 'AC'

Revision as of 11:18, 1 December 2015

485solar-get
Instructions and HOWTO page

Instructions:

Command line options for 485solar-get
485solar-get for 123Solar
based on libyasdi from SMA Solar Technology ag
v1.000 2014-09-04 by roland@breedveld.net

Config file: /etc/yasdi.ini

Options:
-h show this help -d show data -b show debug information, written to errout -i show info -e show events -c show data with comments -a show alarms -s show possible status fields -r show state of Daemon -S synchrone detection, default is asynchrone -D start 485solar-get as daemon -m monitor loop -x send exit to daemon -n0-9 deviceNr, default -n0


485solar-get project: http://code.google.com/p/sma-get
123Solar project: http://www.123solar.org
YASDI software: http://www.sma.de/en/products/monitoring-systems/yasdi.html

When running 485solar-get as a daemon:

The client is communicating to the sever by shared memory, actually an IPC-socket, so both should run as the same user.

When starting daemon mode always give the highest device_nr in the command, otherwise it only communicates with the first inverter.
example if using 4 SMA inverters: 485solar-get -D -n3

A client process, such as "485solar-get -d", always looks if a daemon is running, if not, it will communicate directly to the SMA device.

The daemon will shutdown when communication to one of the inverters is interrupted.
This is because the initialization to all invertes should be done again, after one is comming back online again.

Release Notes:

v0.91 2012-10-14 beta version

initial test version

v0.92 2012-10-15 beta version

introduced: -b option
this the same as -d (datacollecting) but extended with debug info.
debug info is send to stderr
Device-scan is now async, with a wait loop after it.
This not optimal yet, but it is much faster

v0.93 2012-10-16 beta version

max exit in detection waitloop, prevents for endless loop

v0.94 2012-10-21 beta version

mutiple inverters (-n)
improved debugging options
date and events printout with comments (-c)
show possible status fields (-s)
some minor bigfixes

v0.95 2012-10-24 beta version

minor bugfixes
include yasdi libs in compiled version
install.sh and make_distribution.sh scripts added

v0.972 2012-11-28 beta version

Pdc in stead of Pac (bug)
possible to do a synchronous call in stead off async.
deamon mode, will speed-up requests
monitor mode added
much more debugging
send stop signal to the daemon
requesting the daemon state

v0.980 2012-11-29 beta version

deamon request for multiple sma inverters

v0.981 2012-12-02 beta version

minor bug-fix for 32bit compile

v0.982 2013-02-13 beta version

not existing inverter in daemon mode will result as 0, - bugfix for coredump with some SMA models - detection of A or mA, output will be in Amps

v1.000 2014-09-04 version

New name, going to production version

485solar-get Installation:

Install 485solar-get
needed packages: libaio
for Ubuntu 12.04LTS
also tested on Ubuntu 10.04LTS
download the latest compiled 485solar-get <version>_x86_64_Ubuntu_12_04.tgz from this site,
(or for 32bit systems 485solar-get_<version>_i386_Ubuntu_12_04.tgz)
place is somewhere like /tmp
extract it:

tar xzvf 485solar-get_<version>_x86_64_Ubuntu_12_04.tgz

run the install script:

sudo ./install.sh

For other Linux distributions:
compiling and installing YASDI
needed packages: gcc cmake libaio
Download YASDI from the SMA site:
http://www.sma.de/en/products/monitoring-systems/yasdi.html
extract it to /usr/local/src/libyasdi_1_8_1

cd /usr/local/src/libyasdi_1_8_1/
cd projects/generic-cmake
mkdir build-gcc
cd build-gcc
cmake ..
make
sudo make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
sudo ldconfig /usr/local/lib

test it:

yasdishell /etc/yasdi.ini 

compiling and installing 485solar-get
download the latest 485solar-get_<version>_sources.tgz source from this site
extract it:

cd /usr/local/src/libyasdi_1_8_1/
tar xzvf <location>/485solar-get_<version>_sources.tgz
cd /usr/local/src/libyasdi_1_8_1/sma_485solar-get_<version>
sudo ./make.sh

example for /etc/yasdi.ini

[DriverModules]
Driver0=yasdi_drv_serial
[COM1]
Device=/dev/ttyUSB0
Media=RS485
Baudrate=1200
Protocol=SMANet
[Misc]
DebugOutput=/dev/stderr

compiling, installing and generating your own distribution
download the latest 485solar-get_<version>_sources.tgz source from this site
extract it:

cd /usr/local/src/libyasdi_1_8_1/
tar xzvf <location>/485solar-get_<version>_sources.tgz
cd /usr/local/src/libyasdi_1_8_1/485solar-get_<version>

change PACKAGE_PAD in make_distribution.sh to your own choice

sudo ./make_distribution.sh

Problem Solving:

general
When encountering issues, first every should be fine without using the Daemon mode.
stop the daemon with
485solar-get -x
be shure there are no alter commands running, so stop all software which is using the same interface, like 123solar, etc.
bind address in use
If you change the user which 485solar-get (and Daemon) runs, you have to remove the socket file:
rm -f /var/tmp/485solar-get_socket
debug 485solar-get
use the -b option to show debug output:
485solar-get -s -b 
or:
485solar-get -b -d -i -e -a -s 
try synchronous detection, by adding the -S option
first test Yasdi itself, while 485solar-get is using its library's
yasdishell /etc/yasdi.ini
b1
when device is detected:
z
look at the outputs of:
d
a1
p1
t1 (probably empty)
When the rs485 interface won't respond, try to zero it:
setserial -z /dev/ttyUSB0
Get state of rs485 device:
setserial -G /dev/ttyUSB0
this wil give something like:
/dev/ttyUSB0 uart unknown port 0x0000 irq 0 baud_base 24000000 spd_normal low_latency
Check baudrate:
stty -F /dev/ttyUSB0
Set baudrate:
stty -F /dev/ttyUSB0 1200
cannot open shared object
if you get this message after installing the binary version:
485solar-get: error while loading shared libraries: libyasdimaster.so.1: cannot open shared object file: No such file or directory
This means /usr/local/lib is not in the library path.
there are 2 solutions:
setting the path before running, only for this session:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
Make it permanent:
sudo ldconfig /usr/local/lib
Debugging and tracing
If you can't get enough data from the -b (debug) option, you can use strace:
strace -f -o 485solar-get.strace 485solar-get -d -b
All trace info will be written to 485solar-get.strace
For monitoring the serial data:
strace -s9999 -o 485solar-get.strace -eread,write,ioctl 485solar-get -d -b

Output Examples:

output examples for 485solar-get

485solar-get -d (request data)

20130712-15:32:55 172.000000 3.107000 534.404000 0.000000 0.000000 0.000000 234.400003 2.083000 488.000000 49.989999 91.364437 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 889.486042 0.000000 OK

485solar-get -d -c (request data in column format)

Date 20130712-15:39:04
Upv-Ist V 172.000000 
Ipv A 3.494000 
Pdc 600.968000 
dummy 0.000000 
dummy 0.000000 
dummy 0.000000 
Uac V 234.000003 
Iac-Ist A 2.346000 
Pac W 549.000000 
Fac Hz 49.989999 
Effcy 91.346629 
dummy 0.000000 
dummy 0.000000 
dummy 0.000000 
dummy 0.000000 
dummy 0.000000 
dummy 0.000000 
dummy 0.000000 
E-Total kWh 889.537042 
dummy 0.000000 
State OK

485solar-get -e (events)

169.000000 169.000000 0.000000 0.000000 169.000000 0.000000 0.000000 3.000000 233.900003 233.900003 233.900003 49.989999 1200.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 466.000000 0.000000 0.000000 0.000000 0.000000 0.000000 OK

485solar-get -c -e (events in column format)

Upv-Ist 172.000000
Upv-Ist 172.000000
dummy 0.000000
dummy 0.000000
Upv-Ist 172.000000
dummy 0.000000
dummy 0.000000
Riso 3.000000
Uac 234.000003
Uac 234.000003
Uac 234.000003
Fac 49.959999
Plimit 1200.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
Pac 582.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
dummy 0.000000
State OK

485solar-get -i (info)

1 WR12-061 SN:2002116358
Software-BFR 4.090000 
SMA-SN 2002116358.000000 
Default 8.000000 BE/C10/11
Status Mpp
Betriebsart Mpp-Betrieb
485solar-get v1.000 daemon: Running
485solar-get -a (alarms)
Fehler -------

485solar-get -s (possible status fields)

All possible status texts for Status:
( 0): 'Offset'
( 1): 'Stop'
( 2): 'Netzueb.'
( 3): 'Warten'
( 4): 'U-Konst'
( 5): 'Turbine'
( 6): 'Mpp-Such'
( 7): 'Mpp'
( 8): 'Stoer.'
( 9): 'Fehler'
(10): 'Mpp-Peak'
(11): 'Derating'
All possible status texts for Fehler:
( 0): '-------'
( 1): 'NUW-UAC'
( 2): 'NUW-FAC'
( 3): 'B3'
( 4): 'K1-Trenn'
( 5): 'B5'
( 6): 'EEPROM dBh'
( 7): 'ROM'
( 8): 'B8'
( 9): 'B9'
(10): 'B10'
(11): 'B11'
(12): 'B12'
(13): 'EeRestore'
(14): 'B14'
(15): 'B15'
(16): 'B16'
(17): 'B17'
(18): 'AC'