Skip to content

SolarNode Deploy Guide

Matt Magoffin edited this page Oct 24, 2019 · 4 revisions

Deploying the SolarNode application

⚠️ Note: this is an old guide, and most users should refer to the SolarNodeOS page for more relevant information, where installing the solarnode-base package is all you need to do to deploy the SolarNode application.

This guide assumes you have a device and OS ready to run the SolarNode application. See Node OS Setup Guide Debian 8 as an example.

Download SolarNode base system

A SolarNode base system is a package of bundles and configuration files organized in a way that forms a minimal SolarNode application. Download the base system from here, it is named base-equinox-node.tgz. Copy the archive to the device, and then unpack the archive into the appropriate directory, for example:

cd ~solar
tar xzf /tmp/base-equinox-node.tgz

Download additional components

The base system does not perform any useful tasks by itself. You'll want to install additional bundles that provide support for a variety of components. The easiest option is to download the OBR (OSGi Bundle Repository) archive that allows you to download components directly from the SolarNode. Download the latest file named obr-node-bundles-X.tgz (where X is a date) from the same place as the base system. Once you've downloaded the archive, unpack it the same way you unpacked the base system, for example:

cd ~solar
tar xzf /tmp/obr-node-bundles-20150315.tgz

System startup configuration (SysV init)

The base system comes with a system startup script in bin/solarnode-equinox-daemon-ramdisk.sh so SolarNode starts up with the device boots. This script is known to work on Debian Linux systems with the daemon package installed. Copy this into the appropriate system location and configure the OS to start the SolarNode application when it starts, for example on Debian you could do (as the superuser):

cp bin/solarnode-equinox-ramdisk.sh /etc/init.d/solarnode
update-rc.d solarnode defaults

You may need to tweak some of the paths or arguments defined in the script to match your system. Once this is configured, you can use the standard system startup command to start and stop the SolarNode service, for example on Debian to start SolarNode:

sudo service solarnode start

and to stop:

sudo service solarnode stop

and to check if SolarNode is running:

sudo service solarnode status

System startup configuration (systemd)

The base system comes with a systemd unit file in bin/solarnode.service. This in turn relies on the bin/utilities.sh script. Copy these to the appropriate places, then enable the service:

cp bin/solarnode.service /lib/systemd/system/
mkdir /usr/share/solarnode
cp bin/utilities.sh /usr/share/solarnode/
systemctl enable solarnode

You may need to tweak some of the paths or arguments defined in the unit file or script to match your system. Once this is configured, you can use the systemctl command to start and stop the SolarNode service:

sudo systemctl start solarnode

and to stop:

sudo systemctl stop solarnode

and to check if SolarNode is running:

sudo systemctl status solarnode

Monit configuration

Monit is a great tool to monitor the SolarNode process and re-start it if it happens to die. Note Monit isn't quite necessary if using systemd as that restarts the process automatically. The SolarNode application is configured to generate a PID file (the path is configured in the system startup script) that you can configure Monit to monitor. An example Monit script, which on Debian might be placed at /etc/monit/conf.d/solarnode, would be:

check process solarnode with pidfile /run/shm/solar/solarnode.pid
		start = "/etc/init.d/solarnode start"
		stop  = "/etc/init.d/solarnode stop"

Make sure the pidfile path matches that path SolarNode is configured to use.

Expand the root filesystem

The expandfs.sh script can be used to expand the root filesystem, in case the media you copy the OS image to is larger than the size of the image. For example if you copy a 1GB sized image to a 2GB SD card, this script will expand the OS filesystem to use the extra 1GB otherwise unavailable to it. You can run the script manually like

sudo bin/expandfs.sh -v

Or if you create a /var/local/solarnode-expandfs file and reboot the system will do this for you, e.g.

sudo touch /var/local/solarnode-expandfs
sudo reboot

SolarNode web-based setup

Once SolarNode has been deployed and started successfully, you'll need to associate the SolarNode with its SolarNet service and then configure the components you've installed. These tasks are all done via the SolarNode web-based setup, available at whatever your device's DNS name or IP address is. For example, if the device's DNS entry is solarnode you should visit http://solarnode/ or if the device's IP address is 192.168.1.2 you should visit http://192.168.1.2/.

Clone this wiki locally