cool-iot

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 5  →  ?path2? @ 4
File deleted
/trunk/contrib/cool-iot.service
/trunk/config.yml
@@ -4,8 +4,6 @@
## rights of fair usage, the disclaimer and warranty conditions. ##
###########################################################################
 
log: "cool-iot.log"
 
mqtt:
url: "mqtt://joey.internal"
# The topic to subscribe to.
/trunk/main.js
@@ -1,4 +1,3 @@
#!/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, //
@@ -26,7 +25,7 @@
}
 
// Set up logger.
winston.add(winston.transports.File, {filename: config.log})
winston.add(winston.transports.File, {filename: 'cool-iot.log'})
 
// Initiate connection to MQTT.
const client = mqtt.connect(config.mqtt.url)
@@ -40,7 +39,7 @@
client.on('message', function (topic, message) {
// message is Buffer
message = message.toString()
winston.info('Received message: ' + message)
winston.info('Received request: ' + message)
if(!(message in config.GPIO)) {
winston.warn('Request to toggle unknown GPIO: ' + message)
return;