cool-iot

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 4  →  ?path2? @ 5
/trunk/main.js
@@ -1,3 +1,4 @@
#!/usr/bin/env nodejs
///////////////////////////////////////////////////////////////////////////
// Copyright (C) Wizardry and Steamworks 2018 - License: GNU GPLv3 //
// Please see: http://www.gnu.org/licenses/gpl.html for legal details, //
@@ -25,7 +26,7 @@
}
 
// Set up logger.
winston.add(winston.transports.File, {filename: 'cool-iot.log'})
winston.add(winston.transports.File, {filename: config.log})
 
// Initiate connection to MQTT.
const client = mqtt.connect(config.mqtt.url)
@@ -39,7 +40,7 @@
client.on('message', function (topic, message) {
// message is Buffer
message = message.toString()
winston.info('Received request: ' + message)
winston.info('Received message: ' + message)
if(!(message in config.GPIO)) {
winston.warn('Request to toggle unknown GPIO: ' + message)
return;