From 673c54dd84ef1b861d1b8519311555af153b6c8c Mon Sep 17 00:00:00 2001 From: 沈斌 <23420800@qq.com> Date: Tue, 31 Jan 2017 15:40:37 +0800 Subject: [PATCH] 后台添加调试代码帮助除错 --- method.js | 7 +++++++ client.js | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index cdf95ff..0c74a90 100644 --- a/client.js +++ b/client.js @@ -14,10 +14,10 @@ //client.write(new Buffer([ 0x5a, 0x00, 0x10, 0x01, 0x00, 0x07, 0xac, 0xcf, 0x23, 0xb8, 0x7f, 0xa2 ])); //client.write(new Buffer([ 0x5A, 0x00, 0x33, 0x01, 0x00, 0x01 ])); //client.write(new Buffer([0x5a,0x00,0x10,0x01,0x00,0x01,0xac,0xcf,0x23,0xb8,0x7f,0xbf])); - client.write(new Buffer([0x5a,0x00,0x00,0x01,0x00,0x01,0xac, 0xcf, 0x23, 0xb8, 0x7d, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4])); + //client.write(new Buffer([0x5a,0x00,0x00,0x01,0x00,0x01,0xac, 0xcf, 0x23, 0xb8, 0x7d, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4])); - //client.write(new Buffer([0x5a, 0x00, 0x3d, 0x01, 0x00, 0x06, 0xac, 0xcf, 0x23, 0xb8, 0x7f, 0xbf, 0xa6, 0x6a, 0x00, 0x51, 0x01, 0x02, 0x03, 0x04, 0x10, 0x06, 0x01, 0x02, 0x00, - // , 0x03, 0xfa, 0xae, 0x3e, 0x64, 0x5e, 0x9c, 0xb3, 0xcf, 0xbb, 0x91, 0xf9, 0xe4, 0x6e, 0xab, 0xef, 0xea, 0xcf, 0x42, 0x79, 0x9a, 0xf8, 0x22, 0x18, 0xec, 0x88, 0x6c, 0x4b, 0xf0, 0x4f, 0x9f, 0xef, 0x29, 0x00, 0x00])) + client.write(new Buffer([0x5a, 0x00, 0x3d, 0x01, 0x00, 0x06, 0xac, 0xcf, 0x23, 0xb8, 0x7f, 0xbf, 0xa6, 0x6a, 0x00, 0x51, 0x01, 0x02, 0x03, 0x04, 0x10, 0x06, 0x01, 0x02, 0x00, + , 0x03, 0xfa, 0xae, 0x3e, 0x64, 0x5e, 0x9c, 0xb3, 0xcf, 0xbb, 0x91, 0xf9, 0xe4, 0x6e, 0xab, 0xef, 0xea, 0xcf, 0x42, 0x79, 0x9a, 0xf8, 0x22, 0x18, 0xec, 0x88, 0x6c, 0x4b, 0xf0, 0x4f, 0x9f, 0xef, 0x29, 0x00, 0x00])) }); client.on('data', function(data) { diff --git a/method.js b/method.js index 032d7ab..b27d55d 100644 --- a/method.js +++ b/method.js @@ -172,12 +172,19 @@ var mcu = this.toDec(fields[64]) + this.toDec(fields[65]) / 100; var _config = global.configs[mac]; + + console.log("----------------------1") + console.log(_config) + if(_config == null) { _config = config.ALARM_DEFAULTS; _config.mac = mac; global.configs[mac] = _config; } + console.log("----------------------2") + console.log(_config) + var current = moment(); var sensor_data = { -- Gitblit v1.8.0