-
Notifications
You must be signed in to change notification settings - Fork 2
Node Using YASDI
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 (libyasdi calls dlopen) and 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!
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
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
To get YASDI loading using just the solar user's permissions, you can leave
the YASDI shared libraries in ~solar/lib and modify the 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 install the yasdi libraries into /usr/lib/jni to make them accessible to SolarNode, and then you don't have to modify the startup scripts or shell profile.