Skip to content

Commit

Permalink
RPC addresses updated in some modules. Installation procedures update…
Browse files Browse the repository at this point in the history
…d. Guide updated. NPM settings updated.
  • Loading branch information
npeditto committed Jul 28, 2017
1 parent 0eaf8d7 commit 9e274ea
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 18 deletions.
4 changes: 1 addition & 3 deletions docs/ubuntu1604.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ node -v
npm install -g npm
npm config set python `which python2.7`
npm -v
```
##### Configure npm NODE_PATH variable
```
echo "NODE_PATH=/usr/lib/node_modules" | tee -a /etc/environment
source /etc/environment > /dev/null
echo $NODE_PATH
Expand Down
10 changes: 5 additions & 5 deletions modules/gpio-manager/manage-pins.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ function setMode(args) {
exports.exportPins = function (session) {

//Register all the module functions as WAMP RPCs
session.register(boardCode + '.command.rpc.setmode', setMode);
session.register(boardCode + '.command.rpc.read.digital', readDigital);
session.register(boardCode + '.command.rpc.write.digital', writeDigital);
session.register(boardCode + '.command.rpc.read.analog', readAnalog);
session.register(boardCode + '.command.rpc.write.analog', writeAnalog);
session.register('s4t'+ boardCode + '.gpio.setmode', setMode);
session.register('s4t'+ boardCode + '.gpio.read.digital', readDigital);
session.register('s4t'+ boardCode + '.gpio.write.digital', writeDigital);
session.register('s4t'+ boardCode + '.gpio.read.analog', readAnalog);
session.register('s4t'+ boardCode + '.gpio.write.analog', writeAnalog);

logger.info('[WAMP-EXPORTS] Pins exported to the cloud!');

Expand Down
10 changes: 5 additions & 5 deletions modules/plugins-manager/manage-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,11 @@ exports.removePlugin = function(args){
exports.exportPluginCommands = function (session){

//Register all the module functions as WAMP RPCs
session.register(boardCode+'.command.rpc.plugin.run', exports.run);
session.register(boardCode+'.command.rpc.plugin.kill', exports.kill);
session.register(boardCode+'.command.rpc.injectplugin', exports.injectPlugin);
session.register(boardCode+'.command.rpc.plugin.call', exports.call);
session.register(boardCode+'.command.rpc.removeplugin', exports.removePlugin);
session.register('s4t'+ boardCode+'.plugin.run', exports.run);
session.register('s4t'+ boardCode+'.plugin.kill', exports.kill);
session.register('s4t'+ boardCode+'.plugin.inject', exports.injectPlugin);
session.register('s4t'+ boardCode+'.plugin.call', exports.call);
session.register('s4t'+ boardCode+'.plugin.remove', exports.removePlugin);

logger.info('[WAMP-EXPORTS] Plugin commands exported to the cloud!');

Expand Down
6 changes: 3 additions & 3 deletions modules/vnets-manager/manage-networks.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ exports.exportNetworkCommands = function (session) {
session_wamp = session;

//Register all the module functions as WAMP RPCs
session.register(boardCode + '.command.rpc.network.setSocatOnBoard', exports.setSocatOnBoard);
session.register(boardCode + '.command.rpc.network.addToNetwork', exports.addToNetwork);
session.register(boardCode + '.command.rpc.network.removeFromNetwork', exports.removeFromNetwork);
session.register('s4t'+ boardCode + '.vnet.setSocatOnBoard', exports.setSocatOnBoard);
session.register('s4t'+ boardCode + '.vnet.addToNetwork', exports.addToNetwork);
session.register('s4t'+ boardCode + '.vnet.removeFromNetwork', exports.removeFromNetwork);

logger.info('[WAMP-EXPORTS] Network commands exported to the cloud!');

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iotronic-lightning-rod",
"version": "1.0.4",
"version": "1.1.0",
"description": "Implementation of the Lightning-rod, the Stack4Things node-side probe (this version works with the standalone version of IoTronic) http://stack4things.unime.it/",
"main": "lightning-rod.js",
"directories": {
Expand All @@ -22,7 +22,7 @@
"requestify": ">=0.1.17",
"is-running": ">=2.0.0",
"connection-tester": ">=0.1.1",
"log4js": ">=0.6.37",
"log4js": "<=1.1.0",
"q": ">=0.9.7",
"fs-access": ">=1.0.1",
"mknod": ">=1.1.0",
Expand Down
24 changes: 24 additions & 0 deletions scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@ fi

echo "Configuring..."

# Set Environment variables
if grep -Fq "IOTRONIC_HOME" /etc/profile
then
# if found
echo "IOTRONIC_HOME env var already set."
else
# if not found
echo "Setting IOTRONIC_HOME env var."
echo "export IOTRONIC_HOME=/var/lib/iotronic" >> /etc/profile
source /etc/profile
fi

if grep -Fq "LIGHTNINGROD_HOME" /etc/profile
then
# if found
echo "LIGHTNINGROD_HOME env var already set."
else
# if not found
echo "Setting LIGHTNINGROD_HOME env var."
echo "export LIGHTNINGROD_HOME=/usr/lib/node_modules/iotronic-lightning-rod" >> /etc/profile
source /etc/profile
fi


echo "After the installation execute lr_configure.sh script in order to complete the Lightning-rod configuration!"
echo "--> /usr/lib/node_modules/iotronic-lightning-rod/scripts/lr_configure.sh"
chmod +x /usr/lib/node_modules/iotronic-lightning-rod/scripts/lr_configure.sh
Expand Down

0 comments on commit 9e274ea

Please sign in to comment.