diff --git a/lib/mqtt/mqttConnect.js b/lib/mqtt/mqttConnect.js index 87c133f..7a94e2d 100644 --- a/lib/mqtt/mqttConnect.js +++ b/lib/mqtt/mqttConnect.js @@ -237,7 +237,7 @@ module.exports = { var sensorData = {}; wsClient.onMessageArrived = function(msg) { - //Logger.info("Message from :" + msg.destinationName); + logger.info("Message from :" + msg.destinationName); clientStatus.deviceConnected = true; sensorData = JSON.parse(msg.payloadString); // Logger.debug(sensorData); @@ -251,11 +251,11 @@ module.exports = { }; wsClient.onConnectionLost = function(e) { - logger.error('+ onConnectionLost'); + logger.error('+ wsClient.onConnectionLost'); logger.error(e); //self.emitter.emit('sendSocket',{id: 'deviceLost',data: e}); //var wsReconnectTimer = setTimeout(function() {logger.debug('TRYING TO RECONNECT TO MQTT');self.emitter.emit('connectWS');}.bind(this),30000); - logger.error('- onConnectionLost'); + logger.error('- wsClient.onConnectionLost'); }; @@ -275,6 +275,7 @@ module.exports = { connectOptions.onFailure = function(e) { self.emitter.emit('sendSocket',{id: 'deviceNotConnecting'}); + logger.error('wsClient onFailure', e); logger.error('MQTT connection failed at ' + Date.now() + '\nerror: ' + e.errorCode + ' : ' + e.errorMessage); //var wsReconnectTimer = setTimeout(function() {logger.debug('TRYING TO RECONNECT TO MQTT');self.emitter.emit('connectWS');}.bind(this),30000); };