-
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.yasdi4j) 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!
The libyasdi-linux-i386.tgz archive included in the net.solarnetwork.external.yasdi4j/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
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.
For the JVM to load the shared yasdi4j shared library included in the net.solarnetwork.external.yasdi4j
bundle, the file system the bundle is deployed to must support executables. If the runtime file system is
a in-memory file system, such as /run/shm as configured in Debian Linux, often it is not configured
with executable support and must be changed. In this Debian example, you could add an entry to
/etc/fstab like this:
tmpfs /run/shm tmpfs rw,nosuid,nodev,exec,relatime,size=50% 0 0
The only difference here is the addition of the exec mount option.