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slab/iotronic-lightning-rod@2.3.6/lightning-rod.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","//############################################################################################\n//##\n//# Copyright (C) 2014-2018 Dario Bruneo, Francesco Longo, Andrea Rocco Lotronto,\n//# Giovanni Merlino, Nicola Peditto\n//##\n//# Licensed under the Apache License, Version 2.0 (the \"License\");\n//# you may not use this file except in compliance with the License.\n//# You may obtain a copy of the License at\n//##\n//# http://www.apache.org/licenses/LICENSE-2.0\n//##\n//# Unless required by applicable law or agreed to in writing, software\n//# distributed under the License is distributed on an \"AS IS\" BASIS,\n//# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//# See the License for the specific language governing permissions and\n//# limitations under the License.\n//##\n//############################################################################################\n\n\n// LIBRARIES\nvar fs = require(\"fs\");\nvar spawn = require('child_process').spawn;\nvar running = require('is-running');\t\t\t// We use this library to check if a process is running (PID check)\nvar autobahn = require('autobahn');\nvar connectionTester = require('connection-tester');\n\n\n//settings parser\nnconf = require('nconf');\nSETTINGS = process.env.IOTRONIC_HOME+'/settings.json';\nnconf.file ('config', {file: SETTINGS});\nAUTH_CONF = '/etc/iotronic/authentication.json';\nnconf.file ('auth', {file: AUTH_CONF});\n\n\n//logging configuration: \"board-management\"\nlog4js = require('log4js');\nlogger = log4js.getLogger('main');\n\n// Device settings\nboardCode = null;\t\t//valued in checkSettings\nboardLabel = null;\t\t//valued in checkSettings\nboard_position = null;\t//valued by Iotronic (via updateConf, setConf or setBoardPosition RPCs)\nreg_status = null;\t\t//valued in checkSettings\ndevice = null;\t\t\t//valued in checkSettings\nlyt_device = null;\t\t//valued here in main\nnet_backend = '';\nwampIP = null;\nauth_lr_mode = null;\n\n\nvar wampConnection = null;\n\n//WAMP SOCKETS RECOVERY HACK\nwamp_socket_recovery = nconf.get('auth:wamp:wamp_socket_recovery');\n\nif(wamp_socket_recovery == true || wamp_socket_recovery == \"true\"){\n\n\t//timing\n\trpc_alive_time = nconf.get('auth:wamp:rpc_alive_time');\n\tif (isNaN(rpc_alive_time))\n\t\trpc_alive_time = 60; //set default value\n\n\tcheck_skt_time = nconf.get('auth:wamp:check_skt_time');\n\tif (isNaN(check_skt_time))\n\t\tcheck_skt_time = 30; //set default value\n\n\tonline = true;\t\t\t\t// We use this flag during the process of connection recovery\n\n\tRECOVERY_SESSION = null;\n\n\t//timers\n\tkeepWampAlive = null;\t\t// It is a timer related to the function that every \"X\" seconds/minutes checks the connection status\n\tcheckSocketTimer = null;\t// It is a timer\n\n\t//timeout\n\texpectIotronicResponse = null;\n\n\t//trigger variable\n\tsocketNotAlive = false;\n\n}\n\n\n// LR s4t libraries\nvar LIGHTNINGROD_HOME = process.env.LIGHTNINGROD_HOME;\nvar manageBoard = require(LIGHTNINGROD_HOME + '/modules/board-manager/board-management');\nLR_VERSION = manageBoard.getLRversion();\nLR_PID = process.pid;\n\n\n\n//Init_Ligthning_Rod(function (check) {\nmanageBoard.Init_Ligthning_Rod(function (check) {\n\n\n\tif(check.result === \"ERROR\"){\n\n\t\t// Got a critical error in configuration file (settings.json)\n\n\t\tlogger.error('[SYSTEM] - Logger configuration is wrong or not specified!');\n\n\t\tvar log_template={log: {logfile: \"<LOG-FILE>\", loglevel: \"<LOG-LEVEL>\"}};\n\t\tlogger.error(\"[SYSTEM] - Logger configuration expected: \\n\" + JSON.stringify(log_template, null, \"\\t\"));\n\n\t\tprocess.exit();\n\n\t}\n\telse{\n\n\t\t// Configuration file is correctly configured... Starting LR...\n\n\t\tlogger.info('[SYSTEM] - DEVICE: ' + device);\n\n\t\t//----------------------------------------\n\t\t// 1. Set WAMP connection configuration\n\t\t//----------------------------------------\n\t\tvar wampUrl = url_wamp+\":\"+port_wamp+\"/ws\";\n\n\t\ttry{\n\t\t\twampIP = wampUrl.split(\"//\")[1].split(\":\")[0];\n\n\t\t}\n\t\tcatch(err){\n\t\t\tlogger.warn('[WAMP] - Error in WAMP url format: '+ err);\n\t\t\tprocess.exit(1);\n\t\t}\n\n\n\t\t//var wampRealm = nconf.get('config:wamp:realm');\n\t\tvar wampRealm = realm;\n\n\t\tlogger.info(\"[SYSTEM] - Iotronic server IP: \"+wampIP);\n\n\n\t\twampConnection = new autobahn.Connection({\n\t\t\turl: wampUrl,\n\t\t\trealm: wampRealm,\n\t\t\ttlsConfiguration: {},\n\t\t\tmax_retries: -1\n\t\t});\n\n\t\tlogger.info(\"[SYSTEM] - WAMP server IP: \" + wampIP);\n\n\t\tlogger.info(\"[SYSTEM] - Board ID: \" + boardCode);\n\t\tlogger.info(\"[SYSTEM] - Board label: \" + boardLabel);\n\n\t\tlogger.debug(\"[SYSTEM] - WAMP socket recovery: \" + wamp_socket_recovery);\n\n\n\n\t\t//----------------------------------------------------------------------------------------\n\t\t// 3. On WAMP connection open the device will load LR libraries and start each LR module\n\t\t//----------------------------------------------------------------------------------------\n\t\t//This function is called as soon as the connection is created successfully\n\t\twampConnection.onopen = function (session, details) {\n\n\t\t\tlogger.info('[WAMP] - Connection to WAMP server '+ wampUrl + ' created successfully:');\n\t\t\tlogger.info('[WAMP] |--> Realm: '+ wampRealm);\n\t\t\tlogger.info('[WAMP] |--> Session ID: '+ session._id);\n\t\t\t//logger.debug('[WAMP] |--> Connection details:\\n'+ JSON.stringify(details));\n\n\t\t\t//--WAMP-RECOVERY-SYSTEM-INIT-------------------------------------------------------------------------------\n\t\t\tif(wamp_socket_recovery == true || wamp_socket_recovery == \"true\") {\n\n\t\t\t\tlogger.info('[WAMP] |--> socket check timing: '+ wamp_socket_recovery + \" - Timing: \" + rpc_alive_time + \" seconds\");\n\n\t\t\t\tRECOVERY_SESSION = session;\n\t\t\t\tsocketNotAlive = false;\n\n\t\t\t\tif (expectIotronicResponse != null) {\n\n\t\t\t\t\tclearTimeout(expectIotronicResponse);\n\t\t\t\t\tlogger.debug('[WAMP-RECOVERY] - Check socket timers cleared!');\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//----------------------------------------------------------------------------------------------------------\n\n\n\t\t\t// Test if IoTronic is connected to the realm\n\t\t\tsession.call(\"s4t.iotronic.isAlive\", [boardCode]).then(\n\n\t\t\t\tfunction(response){\n\n\t\t\t\t\tlogger.info(\"[SYSTEM] - \" + response.message );\n\n\t\t\t\t\t// RPC registration of Board Management Commands\n\t\t\t\t\tmanageBoard.IotronicLogin(session);\n\n\t\t\t\t\tif(wamp_socket_recovery == true || wamp_socket_recovery == \"true\"){\n\n\n\t\t\t\t\t\tif (keepWampAlive != null){\n\n\t\t\t\t\t\t\tlogger.info('[WAMP-RECOVERY] - WAMP CONNECTION RECOVERED!');\n\n\t\t\t\t\t\t\t//We trigger this event after a connection recovery: we are deleting the previous timer\n\t\t\t\t\t\t\tclearInterval( keepWampAlive );\n\n\t\t\t\t\t\t\tif (checkSocketTimer != null){\n\n\t\t\t\t\t\t\t\tclearInterval( checkSocketTimer );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlogger.debug('[WAMP-RECOVERY] - Old timers cleared!');\n\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t// The function managed by setInterval checks the connection status every \"X\" TIME\n\t\t\t\t\t\tkeepWampAlive = setInterval(function(){\n\n\n\t\t\t\t\t\t\t// connectionTester: library used to check the reachability of Crossbar-Wamp-Broker (timeout check set to 10 seconds)\n\t\t\t\t\t\t\tconnectionTester.test(wampIP, port_wamp, 10000, function (err, output) {\n\n\t\t\t\t\t\t\t\tvar reachable = output.success;\n\t\t\t\t\t\t\t\tvar error_test = output.error;\n\n\t\t\t\t\t\t\t\tif(!reachable){\n\n\t\t\t\t\t\t\t\t\t//CONNECTION STATUS: FALSE\n\t\t\t\t\t\t\t\t\tlogger.warn(\"[CONNECTION-RECOVERY] - INTERNET CONNECTION STATUS: \" + reachable + \" - Error: \" + error_test);\n\t\t\t\t\t\t\t\t\tonline = false;\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tif(!online){\n\t\t\t\t\t\t\t\t\t\t// In the previous checks the \"online\" flag was set to FALSE.\n\t\t\t\t\t\t\t\t\t\tlogger.info(\"[CONNECTION-RECOVERY] - INTERNET CONNECTION RECOVERED\");\n\t\t\t\t\t\t\t\t\t\tonline = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//logger.debug(\"[CONNECTION-TEST] - INTERNET CONNECTION STATUS: \" + reachable + \" - Error: \" + error_test);\n\n\t\t\t\t\t\t\t\t\t//CONNECTION COMEBACK AVAILABLE - STATUS: TRUE\n\t\t\t\t\t\t\t\t\texpectIotronicResponse = setTimeout(function(){\n\n\t\t\t\t\t\t\t\t\t\tlogger.warn(\"[WAMP-RECOVERY] - No Iotronic response, socket restoring...\");\n\n\t\t\t\t\t\t\t\t\t\tsocketNotAlive = true;   //trigger the 'checkSocketTimer' procedure that will clean the zombie-wamp-socket\n\n\t\t\t\t\t\t\t\t\t}, 5000);\n\n\t\t\t\t\t\t\t\t\ttry{\n\n\t\t\t\t\t\t\t\t\t\t// Test if IoTronic is connected to the realm\n\t\t\t\t\t\t\t\t\t\tRECOVERY_SESSION.call(\"s4t.iotronic.isAlive\", [boardCode]).then(\n\n\t\t\t\t\t\t\t\t\t\t\tfunction(response){\n\n\t\t\t\t\t\t\t\t\t\t\t\t// WAMP connection is OK\n\t\t\t\t\t\t\t\t\t\t\t\tclearTimeout(expectIotronicResponse);\n\t\t\t\t\t\t\t\t\t\t\t\t//logger.info(\"[WAMP-ALIVE] - WAMP CONNECTION STATUS: \" + response.message);\n\t\t\t\t\t\t\t\t\t\t\t\tsocketNotAlive = false;\n\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\tfunction (err) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// WAMP connection is OK but I got an error on RPC communication\n\t\t\t\t\t\t\t\t\t\t\t\tclearTimeout(expectIotronicResponse);\n\t\t\t\t\t\t\t\t\t\t\t\tlogger.warn(\"[WAMP-RECOVERY] - WAMP CONNECTION STATUS: \" + JSON.stringify(err));\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t);\n\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch(err){\n\t\t\t\t\t\t\t\t\t\tlogger.warn('[CONNECTION-RECOVERY] - Error keeping alive wamp connection: '+ err);\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t});\n\n\n\n\n\n\t\t\t\t\t\t}, rpc_alive_time * 1000);\n\n\n\n\t\t\t\t\t\tcheckSocketTimer = setInterval(function(){\n\n\t\t\t\t\t\t\tif(socketNotAlive == true){\n\n\t\t\t\t\t\t\t\tlogger.warn(\"[WAMP-RECOVERY] - GDB - Start socket cleaning...\");\n\n\t\t\t\t\t\t\t\tvar cp = require('child_process');\n\t\t\t\t\t\t\t\tvar gdb = cp.fork(LIGHTNINGROD_HOME + '/modules/board-manager/wamp_recovery.js', [LR_PID, port_wamp]);\n\n\t\t\t\t\t\t\t\tgdb.on('message', function(msg) {\n\n\t\t\t\t\t\t\t\t\tif(msg != undefined){\n\n\t\t\t\t\t\t\t\t\t\tif (msg.result === \"SUCCESS\"){\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"[WAMP-RECOVERY] - GDB - \" + msg.message);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tlogger.warn(\"[WAMP-RECOVERY] - GDB - \" + msg.message);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t}, check_skt_time * 1000);\n\n\n\n\n\t\t\t\t\t\tlogger.debug('[WAMP] - TIMERS to keep alive WAMP connection set up!');\n\n\n\n\n\t\t\t\t\t}\n\n\n\t\t\t\t},\n\t\t\t\tfunction (err) {\n\n\t\t\t\t\t// IoTronic is not connected to the realm yet so LR need to try to reconnect later\n\t\t\t\t\tlogger.error(\"[SYSTEM] - IoTronic is not online: \" + JSON.stringify(err) );\n\t\t\t\t\t//if (err.error !== 'wamp.error.no_such_procedure') {}\n\t\t\t\t\tlogger.warn(\"[SYSTEM] - Lightning-rod reconnecting...\");\n\n\t\t\t\t\twampConnection.close();\n\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\twampConnection.open();\n\t\t\t\t\t}, 10 * 1000);  //time to wait for the next reconnection attempt\n\n\n\t\t\t\t}\n\n\t\t\t);\n\n\n\n\n\t\t};\n\n\n\t\t//-------------------------------\n\t\t// 4. On WAMP connection close\n\t\t//-------------------------------\n\t\t//This function is called if there are problems with the WAMP connection\n\t\twampConnection.onclose = function (reason, details) {\n\n\t\t\ttry{\n\n\t\t\t\tlogger.error('[WAMP] - Error in connecting to WAMP server!');\n\t\t\t\tlogger.error('- Reason: ' + reason);\n\t\t\t\tlogger.error('- Reconnection Details: ');\n\t\t\t\tlogger.error(\"  - retry_delay:\", details.retry_delay);\n\t\t\t\tlogger.error(\"  - retry_count:\", details.retry_count);\n\t\t\t\tlogger.error(\"  - will_retry:\", details.will_retry);\n\n\t\t\t\tif(wampConnection.isOpen){\n\t\t\t\t\tlogger.info(\"[WAMP] - connection is open!\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tlogger.warn(\"[WAMP] - connection is closed!\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch(err){\n\t\t\t\tlogger.warn('[WAMP] - Error in WAMP connection: '+ err);\n\t\t\t}\n\n\n\t\t};\n\n\n\t\t//--------------------------------------------------------------\n\t\t// 2. The selected device will connect to Iotronic WAMP server\n\t\t//--------------------------------------------------------------\n\t\ttry{\n\n\t\t\tIoT_Device = require('./device/lyt_'+device);\n\t\t\tlyt_device = new IoT_Device(device);\n\t\t\tlogger.info(\"[SYSTEM] - Lightning-rod \"+ lyt_device.name +\" starting...\");\n\t\t\tlyt_device.Main(wampConnection, logger);\n\n\t\t}\n\t\tcatch (e) {\n\n\t\t\tlogger.error('[SYSTEM] - Loading IoT device failure: ', e);\n\t\t\tlogger.error('[SYSTEM] - Device \"' + device + '\" not supported!');\n\t\t\tlogger.error('[SYSTEM] - Supported devices are: \"server\", \"arduino_yun\", \"raspberry_pi\".');\n\t\t\tlogger.info(\"Bye!\");\n\t\t\tprocess.exit(1);\n\n\t\t}\n\n\n\t\t//--------------------------------------------------------------\n\t\t// 5. Load Module Manager\n\t\t//--------------------------------------------------------------\n\n\t\tmanageBoard.moduleLoaderOnBoot();\n\n\n\n\n\t}\n\n\n});\n\n\n\n\n"]}