Instructions and HOWTO page

Jump to: navigation, search

Instructions and HOWTO page


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

Config file: /etc/yasdi.ini

-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:
123Solar project:
YASDI software:

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 and 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 ./

For other Linux distributions:
compiling and installing YASDI
needed packages: gcc cmake libaio
Download YASDI from the SMA site:
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 ..
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 ./

example for /etc/yasdi.ini


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 to your own choice

sudo ./

Problem Solving:

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 
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
when device is detected:
look at the outputs of:
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: 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'

Interface Hardware:

The Sunny-Boy's don't have an interface from stock, you have to buy the add-on-board for your device from SMA, the 485PB-NR or, 485PB-MS-NR.
Tip: sometimes you'll see them on ebay much cheaper.
For the server or box you can use a USB-RS485-Kabel, I bought one from Conrad, item 975604, very cheap and works out-the-box.

Before buying, check if your Linux version will work with the serial adapter.
There are known problemens between Linux kernel 2.6.31 and serial adapters which use the PL2303 chip

To connect to the SMA and Aurora, I used a simple cat5 cable, take 1 twisted pair for GND and another for data:

Aurora Sunny-Boy  wire                PC
GND        5      brown+brown-white   GND
r+,w+      2      orange              RS485+
r-,w-      7      orange-white        RS485-

Mark 1, if r and w are separate, you can put + together and - together.
Mark 2, the cable should not in star, but in one line, you can add as many devices you like, but only the devices on both ends can have termination.
On all devices between, you have to switch termination off.
on some devices it's a switch close to the connector, on other devices you should remove resistors from the pcb, it should be explained in the manual.

USB Devices after system reboot:

Using multiple serial USB tty devices

Serial USB devices are swapped after reboot
If you use multiple serial USB adapters, it will happen tat they are assigned from /dev/USBtty1 to /dev/USBtty0 after reboot.
I use a simple script, which is runned before starting 123solar and metern, this will create 2 symlink's:
for my smart electricity meter: /dev/ttyUSBp1
for my solar devices: /dev/ttyUSBsl
these links I configured in the applications.

dmesg|grep ttyUSB

and see which strings you can use to see which is which.
In my case:

usb 2-2: pl2303 converter now attached to ttyUSB0
usb 3-1: FTDI USB Serial Device converter now attached to ttyUSB1

put this somewhere in your startup script, or in /etc/rc.local:

rm -f /dev/ttyUSBp1 /dev/ttyUSBsl
P1_DEV=$(dmesg|grep "to ttyUSB"|grep pl2303 |tail -1|awk '{print $NF}')
SL_DEV=$(dmesg|grep "to ttyUSB"|grep FTDI |tail -1|awk '{print $NF}')
ln -s /dev/${P1_DEV} /dev/ttyUSBp1
ln -s /dev/${SL_DEV} /dev/ttyUSBsl