From 8a228fd976fb553103c25a3b93415757b466a92b Mon Sep 17 00:00:00 2001 From: Alexander Trofimov <82121256+trofimov-alex@users.noreply.github.com> Date: Thu, 8 Apr 2021 14:03:42 +0200 Subject: [PATCH 1/2] v2.3.1: Ubuntu installation updated --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ef9fb85..9f59a18 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,9 @@ We tested this procedure on an Arduino YUN with LininoOS and LininoIO installed. ### Generic machine -* [Installation guide for Ubuntu 16.04](https://github.com/MDSLab/s4t-lightning-rod/blob/master/docs/ubuntu1604.md) -* [Installation guide for Ubuntu 14.04](https://github.com/MDSLab/s4t-lightning-rod/blob/master/docs/ubuntu1404.md) +* [Installation guide for Ubuntu 20.04](https://github.com/MDSLab/s4t-lightning-rod/blob/master/docs/ubuntu20.04.md) \ No newline at end of file +--> From 4568bc634aacae71bab7a7884675264a0ec06229 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov <82121256+trofimov-alex@users.noreply.github.com> Date: Thu, 8 Apr 2021 14:05:00 +0200 Subject: [PATCH 2/2] Release v2.3.1: installation|Ubuntu procedures fixed --- docs/ubuntu20.04.md | 139 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 docs/ubuntu20.04.md diff --git a/docs/ubuntu20.04.md b/docs/ubuntu20.04.md new file mode 100644 index 0000000..d0f3c5d --- /dev/null +++ b/docs/ubuntu20.04.md @@ -0,0 +1,139 @@ +# IoTronic Lightning-rod installation guide for Ubuntu 16.04 + +We tested this procedure on a Ubuntu 20.04. Everything needs to be run as root. + +## Install requirements + +##### Install dependencies via apt-get +``` +apt update +apt -y install unzip socat dsniff fuse libfuse-dev pkg-config python-is-python2 git ntpdate build-essential lsof gdb + +``` + +##### Install latest NodeJS 8.x release +Execute the following procedures only if are not already installed: + +- NodeJS installation: +``` +curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - +apt-get install -y nodejs +node -v +``` +- NPM installation: +``` +npm install -g npm +npm config set python `which python2.7` +npm -v +``` +- Check if the NODE_PATH variable is set: +``` +echo $NODE_PATH +``` + +otherwise: +``` +echo "NODE_PATH="`npm -g root` | tee -a /etc/environment +. /etc/environment > /dev/null +echo $NODE_PATH + +reboot +``` + +## Install from source-code + +##### Install required NodeJS modules via npm: +``` +npm install -g --unsafe gyp autobahn@18.10.2 ws@6.1.0 nconf @mdslab/wstun requestify is-running connection-tester log4js@1.1.1 q fs-access jsonfile md5 python-shell net lsof fuse-bindings mknod +npm install -g --unsafe https://github.com/PlayNetwork/node-statvfs/tarball/v3.0.0 +``` + +##### Install the Lightning-rod +``` +mkdir -p /etc/iotronic/ +mkdir -p /var/lib/iotronic/plugins +mkdir -p /var/lib/iotronic/drivers/mountpoints/ +mkdir -p $NODE_PATH/@mdslab/ + +git clone --depth=1 git://github.com/MDSLab/s4t-lightning-rod.git $NODE_PATH/@mdslab/iotronic-lightning-rod + +cp $NODE_PATH/@mdslab/iotronic-lightning-rod/etc/systemd/system/s4t-lightning-rod.service /etc/systemd/system/lightning-rod.service +sed -i "s|Environment=\"LIGHTNINGROD_HOME=\"|Environment=\"LIGHTNINGROD_HOME=$NODE_PATH/@mdslab/iotronic-lightning-rod\"|g" /etc/systemd/system/lightning-rod.service + +chmod +x /etc/systemd/system/lightning-rod.service +systemctl daemon-reload + +mkdir -p /var/log/iotronic/ +mkdir -p /var/log/wstun/ +cp $NODE_PATH/@mdslab/iotronic-lightning-rod/etc/logrotate.d/lightning-rod.log /etc/logrotate.d/lightning-rod.log + +echo "IOTRONIC_HOME=/var/lib/iotronic" | tee -a /etc/environment +echo "LIGHTNINGROD_HOME=$NODE_PATH/@mdslab/iotronic-lightning-rod" | tee -a /etc/environment +echo "NODE_TLS_REJECT_UNAUTHORIZED=0" | tee -a /etc/environment +source /etc/environment > /dev/null + +cp $NODE_PATH/@mdslab/iotronic-lightning-rod/utils/templates/authentication.example.json /etc/iotronic/authentication.json +cp $NODE_PATH/@mdslab/iotronic-lightning-rod/utils/templates/settings.example.json /var/lib/iotronic/settings.json +cp $NODE_PATH/@mdslab/iotronic-lightning-rod/modules/plugins-manager/plugins.example.json /var/lib/iotronic/plugins/plugins.json +cp $NODE_PATH/@mdslab/iotronic-lightning-rod/modules/drivers-manager/drivers.example.json /var/lib/iotronic/drivers/drivers.json + +reboot +``` + + +## Configure Lightning-rod +Now we have to choose which Lightning-rod modules enable. In the /var/lib/iotronic/settings.json configuration file there is the "modules" section: +``` +"modules": { + + "plugins_manager": { + "enabled": true, + "boot": true, + "alive_timer": 60 + }, + "services_manager": { + "enabled": true, + "boot": false + }, + + etc + +} +``` + +In each module section (e.g. "plugins_manager", "services_manager", etc) to enable that module you have to set at "true" the "enabled" field. + + +At the end of the installation process we have to execute the LR configuration script: +``` +$NODE_PATH/@mdslab/iotronic-lightning-rod/scripts/lr_configure +``` +You can execute this script in interactive mode: +``` +$ ./lr_configure -i +``` + +or in shell-mode passing the following parameters: +``` +$ ./lr_configure + +* : 1 -> 'server', 2 -> 'arduino_yun', 3 -> 'raspberry_pi', 4 -> 'kitra' + +* : ID released by the registration process managed by IoTronic. + +* : password to log in to Iotronic + +* : Crossbar server URL + +* : WSTUN server URL +``` + + +## Start Lightning-rod +``` +systemctl enable lightning-rod.service + +systemctl start lightning-rod.service + +tail -f /var/log/iotronic/lightning-rod.log +```