Skip to content
Matt Magoffin edited this page Jul 12, 2013 · 9 revisions

Using YASDI in SolarNode

SolarNode can make use of the SMA YASDI framework to communicate with SMA inverters. SolarNode provides a yasdi4j bundle (net.solarnetwork.external.jasdi4j) which uses JNI to access the yasdi dynamic library.

Unfortunately, the YASDI driver libraries will not load from the bundle because libyasdi calls dlopen. It must be installed in a location where the SolarNode process can find them.

This setup is not ideal... if anyone knows how to compile the driver libraries directly into YASDI, please chime in!

Getting yasdi libraries

The libyassdi-linux-i386.tgz archive included in the net.solarnetwork.external.jasdi4j/example directory contains the compiled shared libraries and the yasdishell program. Expand this into solar's home directory like

cd ~solar
tar xzf libyasdi-linux-i386.tgz

Setup environment

To get YASDI libraries loading modify the solarnode startup script to include

-Djava.library.path=${SOLARNODE_HOME}/lib

in the JVM_ARGS section. Then modify ~solar/.profile to include

export LD_LIBRARY_PATH=/home/solar/lib

You can run yasdishell if you create a YASDI configuration file. For example create the file ~/conf/yasdi.ini with the following details:

[DriverModules]
Driver0=yasdi_drv_serial

[COM1]
Device=/dev/ttyS0
Media=RS485
Baudrate=1200
Protocol=SMANet

You can then run yasdishell like

yasdishell ~/conf/yasdi.ini

Note that after modifying ~/.profile you might need to log out and back in to pick up the change.

Clone this wiki locally