Skip to content

SolarNode Manual Platform Update

Matt Magoffin edited this page Aug 5, 2017 · 3 revisions

SolarNode manual platform update

The SolarNode platform provides the core runtime on which SolarNode depends. It consists of the Eclipse Equinox OSGi container plus many supporting frameworks such as Eclipse Gemini Web, Spring Framework, and so on. The platform does not change very often, but when it does existing SolarNode deployments must be manually updated to take advantage of it. This document describes how to manually update the SolarNode platform.

Download latest platform

The SolarNode platform consists of two archives, available at

https://sourceforge.net/projects/solarnetwork/files/node-framework/

The base-equinox-node-XXXX.tgz archive contains the core platform based on the Eclipse Equinox OSGi container.

The obr-node-bundles-XXXX.tgz archive contains a minimum base SolarNode set of bundles with OBR support for downloading/updating plug-ins. Technically the obr-node-bundles-XXXX.tgz archive is not part of the base SolarNode platform, but it is often convenient to treat it as such.

Copy these archives to the solar user's home directory on the node device you want to update. Then ssh as the solar user to the node and continue with the following tasks. Note all commands assume you are logged in as the solar user and the working directory is ~solar.

Stop SolarNode

First stop the solarnode service:

$ sudo systemctl stop solarnode

Now clean out any cached runtime information:

$ rm -rf /run/solar/*

Backup old platform (optional)

You might like to take the time to make a backup of the current platform:

$ tar czf platform-backup.tgz app bin conf var

Delete old platform

Delete the old platform to keep things tidy:

$ rm -rf app/*.jar app/boot app/core

Then move the app/main directory so we can easily track what custom plugins have been installed later on:

$ mv app/main app/main.old

Install new platform

$ tar xf base-equinox-node-20160828.tgz
$ tar xf obr-node-bundles-20160828.tgz

Check if the service configuration changed

The solarnode service configuration may have changed. To check, run

$ diff bin/solarnode.service /lib/systemd/system/solarnode.service

If you get any output from that command, there are differences and you should install the updated version:

$ sudo cp bin/solarnode.service /lib/systemd/system/solarnode.service
$ sudo systemctl daemon-reload

Check if any helper scripts changed

The base platform provides some helper scripts in the bin directory as well, which generally go in the /usr/share/solarnode directory. You can see if any of these have changed, for example:

$ diff bin/utilities.sh /usr/share/solarnode/utilities.sh

and replace any updated scripts, or simply move all bin/*.sh scripts to /usr/share/solarnode, e.g.

$ sudo chown root:root bin/*.sh
$ sudo mv bin/*.sh /usr/share/solarnode

Manually update custom plugins

If you have installed some custom plugins you might want to manually check if they also have updates and install those updates now. Otherwise you can just re-install the plugins using the SolarNode GUI later.

To tell which custom plugins you had previously installed, you can compare the app/main directory to app/main.old. The former contains just the new base platform while the latter contains the old base platform plus any custom plugins, that is any plugin (ignoring the version part of the plugin name) that exists in app/main.old that is not also in app/main is potentially a custom plugin.

You can manually update the custom plugins by browsing the SolarNetwork plugin repository at

https://data.solarnetwork.net/obr/solarnetwork/net/solarnetwork/

Navigate to the most recent plugin version directory, e.g.

https://data.solarnetwork.net/obr/solarnetwork/net/solarnetwork/node/net.solarnetwork.node.consumption.schneider.pm3200/2.3.0/

and copy the URL of the JAR (excluding the -sources.jar file), e.g.

https://data.solarnetwork.net/obr/solarnetwork/net/solarnetwork/node/net.solarnetwork.node.consumption.schneider.pm3200/2.3.0/net.solarnetwork.node.consumption.schneider.pm3200-2.3.0.jar

Then on the node you can download that plugin:

$ cd app/main
$ wget https://data.solarnetwork.net/obr/...schneider.pm3200-2.3.0.jar

Start SolarNode

Now bring up the solarnode service:

$ sudo systemctl start solarnode

Update custom plugins

If you didn't manually update the custom plugins earlier, then you can do so once the platform is running again, using the web GUI.

Clean up

When everything is up and running and you're completely satisfied, clean up:

$ rm platform-backup.tgz # if you made the platform backup
$ rm app/main.old
Clone this wiki locally