@ncd-io/node-red-enterprise-sensors 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/WirelessGateway.js +274 -25
- package/package.json +1 -1
- package/wireless.html +104 -3
- package/wireless.js +11 -0
package/lib/WirelessGateway.js
CHANGED
|
@@ -142,7 +142,7 @@ module.exports = class WirelessSensor{
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
// #OTF
|
|
145
|
-
var otf_devices = [23,26,39,45,48,52,76,78,79,80,81,82,84,88,89,90,91,101,102,105,106,107,108,110,111,112,114,180,181,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
145
|
+
var otf_devices = [23,26,39,45,48,52,58,76,78,79,80,81,82,84,88,89,90,91,101,102,105,106,107,108,110,111,112,114,180,181,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
146
146
|
var device_type = msbLsb(frame.data[6], frame.data[7]);
|
|
147
147
|
// var device_type = frame.data[7];
|
|
148
148
|
|
|
@@ -294,7 +294,7 @@ module.exports = class WirelessSensor{
|
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
// #OTF
|
|
297
|
-
var otf_devices = [23,26,39,45,48,52,76,78,79,80,81,82,84,88,89,90,91,101,102,105,106,107,108,110,111,112,114,180,181,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
297
|
+
var otf_devices = [23,26,39,45,48,52,58,76,78,79,80,81,82,84,88,89,90,91,101,102,105,106,107,108,110,111,112,114,180,181,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
298
298
|
if(otf_devices.includes(parsed.sensor_type)){
|
|
299
299
|
// If the message says FLY and there is not FLY timer in progress.
|
|
300
300
|
if(payload[8] == 70 && payload[9] == 76 && payload[10] == 89) {
|
|
@@ -712,7 +712,7 @@ module.exports = class WirelessSensor{
|
|
|
712
712
|
data: payload.slice(8)
|
|
713
713
|
};
|
|
714
714
|
// #OTF
|
|
715
|
-
}else if(parsed.sensor_type == 80 || parsed.sensor_type == 81 || parsed.sensor_type == 82 || parsed.sensor_type == 84 || parsed.sensor_type == 180 || parsed.sensor_type == 181 || parsed.sensor_type == 515 || parsed.sensor_type == 519 || parsed.sensor_type == 537 || parsed.sensor_type == 538){
|
|
715
|
+
}else if(parsed.sensor_type == 80 || parsed.sensor_type == 81 || parsed.sensor_type == 82 || parsed.sensor_type == 84 || parsed.sensor_type == 180 || parsed.sensor_type == 181 || parsed.sensor_type == 515 || parsed.sensor_type == 519 || parsed.sensor_type == 531 || parsed.sensor_type == 537 || parsed.sensor_type == 538){
|
|
716
716
|
parsed.sensor_data = this.sensor_types[parsed.sensor_type].parse(payload, parsed, frame.mac);
|
|
717
717
|
if(!parsed.sensor_data){
|
|
718
718
|
return;
|
|
@@ -1307,8 +1307,8 @@ module.exports = class WirelessSensor{
|
|
|
1307
1307
|
console.log(packet);
|
|
1308
1308
|
return this.config_send(sensor_mac, packet);
|
|
1309
1309
|
}
|
|
1310
|
-
|
|
1311
|
-
console.log('
|
|
1310
|
+
config_set_stay_on_mode_539(sensor_mac, value){
|
|
1311
|
+
console.log('config_set_stay_on_mode_539');
|
|
1312
1312
|
var packet = [247, 50, 0, 0, 0, value];
|
|
1313
1313
|
console.log(packet);
|
|
1314
1314
|
return this.config_send(sensor_mac, packet);
|
|
@@ -1371,6 +1371,18 @@ module.exports = class WirelessSensor{
|
|
|
1371
1371
|
console.log(packet);
|
|
1372
1372
|
return this.config_send(sensor_mac, packet);
|
|
1373
1373
|
}
|
|
1374
|
+
config_set_number_of_read_retries_539(sensor_mac, value){
|
|
1375
|
+
console.log('config_set_number_of_read_retries_539');
|
|
1376
|
+
var packet = [244, 55, 0, 0, 23, value];
|
|
1377
|
+
console.log(packet);
|
|
1378
|
+
return this.config_send(sensor_mac, packet);
|
|
1379
|
+
}
|
|
1380
|
+
config_set_read_parameter_539(sensor_mac, value){
|
|
1381
|
+
console.log('config_set_read_parameter_539');
|
|
1382
|
+
var packet = [244, 57, 0, 0, 23, value];
|
|
1383
|
+
console.log(packet);
|
|
1384
|
+
return this.config_send(sensor_mac, packet);
|
|
1385
|
+
}
|
|
1374
1386
|
config_set_auto_raw_interval_110(sensor_mac, value){
|
|
1375
1387
|
console.log('config_set_raw_interval_110');
|
|
1376
1388
|
var packet = [244, 79, 0, 0, 80, 76, value];
|
|
@@ -1452,6 +1464,13 @@ module.exports = class WirelessSensor{
|
|
|
1452
1464
|
console.log(packet);
|
|
1453
1465
|
return this.config_send(sensor_mac, packet);
|
|
1454
1466
|
}
|
|
1467
|
+
config_set_operation_mode_531(sensor_mac, mode){
|
|
1468
|
+
console.log('config_set_operation_mode_531');
|
|
1469
|
+
console.log(mode);
|
|
1470
|
+
var packet = [244, 32, 0, 0, 0, mode];
|
|
1471
|
+
console.log(packet);
|
|
1472
|
+
return this.config_send(sensor_mac, packet);
|
|
1473
|
+
}
|
|
1455
1474
|
config_get_delay(sensor_mac){
|
|
1456
1475
|
return new Promise((fulfill, reject) => {
|
|
1457
1476
|
this.config_send(sensor_mac, [247, 21, 0, 0, 0]).then((res) => {
|
|
@@ -2559,6 +2578,44 @@ function sensor_types(parent){
|
|
|
2559
2578
|
byteThree: d[2],
|
|
2560
2579
|
byteFour: d[3]
|
|
2561
2580
|
};
|
|
2581
|
+
},
|
|
2582
|
+
'parse_fly': (frame) => {
|
|
2583
|
+
let frame_data = {};
|
|
2584
|
+
switch(frame[16]){
|
|
2585
|
+
case 0:
|
|
2586
|
+
frame_data.fsr = "+-0.256 V";
|
|
2587
|
+
break;
|
|
2588
|
+
case 1:
|
|
2589
|
+
frame_data.fsr = "+-0.512 V";
|
|
2590
|
+
break;
|
|
2591
|
+
case 2:
|
|
2592
|
+
frame_data.fsr = "+-1.024 V";
|
|
2593
|
+
break;
|
|
2594
|
+
case 3:
|
|
2595
|
+
frame_data.fsr = "+-2.048 V";
|
|
2596
|
+
break;
|
|
2597
|
+
case 4:
|
|
2598
|
+
frame_data.fsr = "+-4.096 V";
|
|
2599
|
+
break;
|
|
2600
|
+
case 5:
|
|
2601
|
+
frame_data.fsr = "+-6.144 V";
|
|
2602
|
+
break;
|
|
2603
|
+
}
|
|
2604
|
+
return {
|
|
2605
|
+
'firmware': frame[2],
|
|
2606
|
+
'report_rate': frame.slice(12, 16).reduce(msbLsb),
|
|
2607
|
+
'fsr':frame_data.fsr,
|
|
2608
|
+
'boot_up_time': frame[17],
|
|
2609
|
+
'adc_pin_reading': frame.slice(18, 20).reduce(msbLsb),
|
|
2610
|
+
'machine_values': {
|
|
2611
|
+
'firmware': frame[2],
|
|
2612
|
+
'report_rate': frame.slice(12, 16),
|
|
2613
|
+
'fsr':frame[16],
|
|
2614
|
+
'boot_up_time': frame[17],
|
|
2615
|
+
'adc_pin_reading': frame.slice(18, 20),
|
|
2616
|
+
'frame': frame
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2562
2619
|
}
|
|
2563
2620
|
},
|
|
2564
2621
|
'53': {
|
|
@@ -2609,6 +2666,22 @@ function sensor_types(parent){
|
|
|
2609
2666
|
};
|
|
2610
2667
|
}
|
|
2611
2668
|
},
|
|
2669
|
+
'58': {
|
|
2670
|
+
name: 'Tank Level v3',
|
|
2671
|
+
parse: (d) => {
|
|
2672
|
+
return {
|
|
2673
|
+
filtered_range: d.slice(0, 2).reduce(msbLsb),
|
|
2674
|
+
long_range_algorithm: d.slice(2, 4).reduce(msbLsb),
|
|
2675
|
+
second_chance: d.slice(4, 6).reduce(msbLsb),
|
|
2676
|
+
copare_reading: d.slice(6, 8).reduce(msbLsb),
|
|
2677
|
+
short_range_algorithm: d.slice(8, 10).reduce(msbLsb),
|
|
2678
|
+
trusted_reading: d.slice(10, 12).reduce(msbLsb),
|
|
2679
|
+
final_filter: d.slice(12, 14).reduce(msbLsb),
|
|
2680
|
+
raw_final: d.slice(14, 16).reduce(msbLsb),
|
|
2681
|
+
final_index: d.slice(16, 18).reduce(msbLsb),
|
|
2682
|
+
};
|
|
2683
|
+
}
|
|
2684
|
+
},
|
|
2612
2685
|
'60': {
|
|
2613
2686
|
name: 'Air Velocity and Precision Pressure & Temperature Sensor',
|
|
2614
2687
|
parse: (d) => {
|
|
@@ -9243,27 +9316,199 @@ function sensor_types(parent){
|
|
|
9243
9316
|
},
|
|
9244
9317
|
'531': {
|
|
9245
9318
|
name: 'Custom Noise Sensor',
|
|
9246
|
-
parse: (
|
|
9247
|
-
|
|
9248
|
-
if(
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9319
|
+
parse: (payload, parsed, mac) => {
|
|
9320
|
+
// TODO error byte is not supported at this time and the below code is utilizing a not yet implemented emitter.
|
|
9321
|
+
// if(payload[7] >> 1 != 0){
|
|
9322
|
+
// parsed.error = {
|
|
9323
|
+
// code: 2000080,
|
|
9324
|
+
// text: 'Sensor Probe may be unattached',
|
|
9325
|
+
// probe: 1
|
|
9326
|
+
// };
|
|
9327
|
+
// parsed.addr = mac;
|
|
9328
|
+
// parsed.data = {error: 'Error found, Sensor Probe may be unattached'};
|
|
9329
|
+
// parent._emitter.emit('ncd_error', parsed);
|
|
9330
|
+
// parent._emitter.emit('ncd_error-'+parsed.sensor_type, parsed);
|
|
9331
|
+
// parent._emitter.emit('ncd_error-'+mac, parsed);
|
|
9332
|
+
// // Delete the error so it matches older messages.
|
|
9333
|
+
// delete parsed.error;
|
|
9334
|
+
// return parsed;
|
|
9335
|
+
// }
|
|
9336
|
+
|
|
9337
|
+
// If time series data
|
|
9338
|
+
if(payload[8] === 1){
|
|
9339
|
+
var deviceAddr = mac;
|
|
9340
|
+
var firmware = payload[1];
|
|
9341
|
+
var expected_packets = payload[10];
|
|
9342
|
+
var current_packet = payload[11];
|
|
9343
|
+
var sdata_start = 12;
|
|
9344
|
+
var sample_rate = payload[9];
|
|
9345
|
+
// console.log('current_packet');
|
|
9346
|
+
// console.log(current_packet);
|
|
9347
|
+
|
|
9348
|
+
// Make sure its instantiated to simplify following if checks
|
|
9349
|
+
if(!Object.hasOwn(globalDevices, deviceAddr)){
|
|
9350
|
+
globalDevices[deviceAddr] = {};
|
|
9351
|
+
}
|
|
9352
|
+
// Check if new stream is from new message
|
|
9353
|
+
if(Object.hasOwn(globalDevices[deviceAddr], 'err_msg_counter_val') && globalDevices[deviceAddr].err_msg_counter_val != parsed.counter){
|
|
9354
|
+
delete globalDevices[deviceAddr].err_msg_counter_val;
|
|
9355
|
+
}
|
|
9356
|
+
|
|
9357
|
+
// USE THESE TO TEST ERRORS
|
|
9358
|
+
// if(current_packet == 1){
|
|
9359
|
+
// // Test missing first packet or not having a globalDevices[deviceAddr].data
|
|
9360
|
+
// return;
|
|
9361
|
+
// }
|
|
9362
|
+
// if(current_packet == 2){
|
|
9363
|
+
// // Test missing packet mid-stream
|
|
9364
|
+
// return;
|
|
9365
|
+
// }
|
|
9366
|
+
// if(current_packet == expected_packets){
|
|
9367
|
+
// // Test missing last section of stream
|
|
9368
|
+
// return;
|
|
9369
|
+
// }
|
|
9370
|
+
// data object exists and current packet already exists in that object or if data object exists and previous packet not in data
|
|
9371
|
+
// This section checks if for duplicate packets already in data
|
|
9372
|
+
// Object.hasOwn(globalDevices, deviceAddr) && Object.hasOwn(globalDevices[deviceAddr], 'data') && current_packet in globalDevices[deviceAddr].data
|
|
9373
|
+
// This section checks if the previous expected packet is in the data or note
|
|
9374
|
+
// Object.hasOwn(globalDevices, deviceAddr) && Object.hasOwn(globalDevices[deviceAddr], 'data') && !(((current_packet&127)-1) in globalDevices[deviceAddr].data
|
|
9375
|
+
// This section check if data does and if current_packet is not 1. This indicates the data started mid stream
|
|
9376
|
+
// !Object.hasOwn(globalDevices[deviceAddr], 'data') && current_packet != 1
|
|
9377
|
+
if(Object.hasOwn(globalDevices[deviceAddr], 'data') && current_packet in globalDevices[deviceAddr].data || Object.hasOwn(globalDevices[deviceAddr], 'data') && !(((current_packet&127)-1) in globalDevices[deviceAddr].data) || !Object.hasOwn(globalDevices[deviceAddr], 'data') && current_packet != 1){
|
|
9378
|
+
// if(!Object.hasOwn(globalDevices[deviceAddr], 'err_msg_counter_val')){
|
|
9379
|
+
// globalDevices[deviceAddr].err_msg_counter_val = parsed.counter;
|
|
9380
|
+
// }
|
|
9381
|
+
// If Data exists that means we're mid packet and an error occured.
|
|
9382
|
+
if(Object.hasOwn(globalDevices[deviceAddr], 'data')){
|
|
9383
|
+
// console.log('-----');
|
|
9384
|
+
// console.log(deviceAddr+': bad packet breakdown deleting stream');
|
|
9385
|
+
// console.log(current_packet);
|
|
9386
|
+
// console.log(expected_packets);
|
|
9387
|
+
// console.log(current_packet in globalDevices[deviceAddr].data);
|
|
9388
|
+
// console.log(current_packet == 1);
|
|
9389
|
+
// console.log(!((current_packet-1) in globalDevices[deviceAddr].data));
|
|
9390
|
+
delete globalDevices[deviceAddr].data;
|
|
9391
|
+
}
|
|
9392
|
+
// If we have not already reported an error
|
|
9393
|
+
if(!Object.hasOwn(globalDevices[deviceAddr], 'err_msg_counter_val')){
|
|
9394
|
+
globalDevices[deviceAddr].err_msg_counter_val = parsed.counter;
|
|
9395
|
+
if(Object.hasOwn(globalDevices[deviceAddr], 'stream_timeout')){
|
|
9396
|
+
clearTimeout(globalDevices[deviceAddr].stream_timeout);
|
|
9397
|
+
delete globalDevices[deviceAddr].stream_timeout;
|
|
9398
|
+
}
|
|
9399
|
+
parsed.error = {
|
|
9400
|
+
code: 1000080,
|
|
9401
|
+
text: 'Faulty multi-packet stream detected',
|
|
9402
|
+
probe: 1
|
|
9403
|
+
}
|
|
9404
|
+
parsed.addr = mac;
|
|
9405
|
+
// TODO remove console with emitter
|
|
9406
|
+
console.log(parsed);
|
|
9407
|
+
// parent._emitter.emit('ncd_error', parsed);
|
|
9408
|
+
// parent._emitter.emit('ncd_error-'+parsed.sensor_type, parsed);
|
|
9409
|
+
// parent._emitter.emit('ncd_error-'+mac, parsed);
|
|
9410
|
+
}
|
|
9411
|
+
}
|
|
9412
|
+
// If first packet
|
|
9413
|
+
if(current_packet == 1){
|
|
9414
|
+
var mode = payload[8];
|
|
9415
|
+
|
|
9416
|
+
// First packet so errors should be invalidated commented out as may not be necessary because we're redefining globalDevices
|
|
9417
|
+
// if(!Object.hasOwn(globalDevices[deviceAddr], 'err_msg_counter_val')){
|
|
9418
|
+
// delete globalDevices[deviceAddr].err_msg_counter_val;
|
|
9419
|
+
// }
|
|
9420
|
+
if(Object.hasOwn(globalDevices[deviceAddr], 'stream_timeout')){
|
|
9421
|
+
clearTimeout(globalDevices[deviceAddr].stream_timeout);
|
|
9422
|
+
delete globalDevices[deviceAddr].stream_timeout;
|
|
9423
|
+
}
|
|
9424
|
+
globalDevices[deviceAddr] = {
|
|
9425
|
+
// stream_size: expected_packets,
|
|
9426
|
+
data: {},
|
|
9427
|
+
sample_rate: sample_rate,
|
|
9428
|
+
mo: mode,
|
|
9429
|
+
}
|
|
9430
|
+
// This timeout is useful for the reception of the first packet, but comms cut afterward
|
|
9431
|
+
if(expected_packets != 1){
|
|
9432
|
+
globalDevices[deviceAddr].stream_timeout = setTimeout(() => {
|
|
9433
|
+
if(Object.hasOwn(globalDevices[deviceAddr], 'data')){
|
|
9434
|
+
delete globalDevices[deviceAddr].data;
|
|
9435
|
+
}
|
|
9436
|
+
parsed.error = {
|
|
9437
|
+
code: 1100080,
|
|
9438
|
+
text: 'Multi-Packet Stream started, but timed out',
|
|
9439
|
+
probe: 1
|
|
9440
|
+
}
|
|
9441
|
+
parsed.addr = mac;
|
|
9442
|
+
// TODO remove console with emitter
|
|
9443
|
+
console.log(parsed);
|
|
9444
|
+
// parent._emitter.emit('ncd_error', parsed);
|
|
9445
|
+
// parent._emitter.emit('ncd_error-'+parsed.sensor_type, parsed);
|
|
9446
|
+
// parent._emitter.emit('ncd_error-'+mac, parsed);
|
|
9447
|
+
}, 30000);
|
|
9448
|
+
};
|
|
9449
|
+
globalDevices[deviceAddr].data[current_packet] = payload.slice(sdata_start);
|
|
9450
|
+
}else if(Object.hasOwn(globalDevices[deviceAddr], 'data')){
|
|
9451
|
+
// Not first packet and no error detected, append to data array
|
|
9452
|
+
globalDevices[deviceAddr].data[current_packet] = payload.slice(sdata_start);
|
|
9453
|
+
}
|
|
9454
|
+
|
|
9455
|
+
if(Object.hasOwn(globalDevices[deviceAddr], 'data') && Object.keys(globalDevices[deviceAddr].data).length == expected_packets && !Object.hasOwn(globalDevices[deviceAddr], 'err_msg_counter_val')){
|
|
9456
|
+
var raw_data = new Array();
|
|
9457
|
+
for(const packet in globalDevices[deviceAddr].data){
|
|
9458
|
+
raw_data = raw_data.concat(globalDevices[deviceAddr].data[packet]);
|
|
9459
|
+
}
|
|
9460
|
+
var label = 0;
|
|
9461
|
+
|
|
9462
|
+
var data_concat = {};
|
|
9463
|
+
|
|
9464
|
+
for(var i = 0; i < raw_data.length; i+=2){
|
|
9465
|
+
label++;
|
|
9466
|
+
|
|
9467
|
+
data_concat[label] = (raw_data[i]<<8)+(raw_data[i+1]);
|
|
9468
|
+
// data_concat[label] = parseFloat((signInt(((raw_data[i]<<8)+(raw_data[i+1])), 16)).toFixed(3));
|
|
9469
|
+
}
|
|
9470
|
+
var data_concat_obj = {
|
|
9471
|
+
// mac_address: deviceAddr,
|
|
9472
|
+
sample_rate: globalDevices[deviceAddr].sample_rate,
|
|
9473
|
+
data: data_concat
|
|
9474
|
+
};
|
|
9475
|
+
sensor_data = data_concat_obj;
|
|
9476
|
+
|
|
9477
|
+
// Clear stream timeout to prevent timeout error message from triggering
|
|
9478
|
+
if(Object.hasOwn(globalDevices[deviceAddr], 'stream_timeout')){
|
|
9479
|
+
clearTimeout(globalDevices[deviceAddr].stream_timeout);
|
|
9480
|
+
}
|
|
9481
|
+
delete globalDevices[deviceAddr];
|
|
9482
|
+
return sensor_data;
|
|
9483
|
+
}
|
|
9484
|
+
else{
|
|
9485
|
+
return;
|
|
9486
|
+
}
|
|
9487
|
+
|
|
9258
9488
|
}else{
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9489
|
+
let firmware = payload[1];
|
|
9490
|
+
if(firmware > 1){
|
|
9491
|
+
return {
|
|
9492
|
+
mode: payload[8],
|
|
9493
|
+
sample_rate: payload[9],
|
|
9494
|
+
rms_dba: payload[10],
|
|
9495
|
+
c1_dba: payload[11],
|
|
9496
|
+
c1_freq: payload.slice(12, 14).reduce(msbLsb),
|
|
9497
|
+
c2_dba: payload[14],
|
|
9498
|
+
c2_freq: payload.slice(15, 17).reduce(msbLsb),
|
|
9499
|
+
c3_dba: payload[17],
|
|
9500
|
+
c3_freq: payload.slice(18, 20).reduce(msbLsb),
|
|
9501
|
+
};
|
|
9502
|
+
}else{
|
|
9503
|
+
return {
|
|
9504
|
+
noise_db: payload[8],
|
|
9505
|
+
peak_freq_1: payload.slice(9, 11).reduce(msbLsb),
|
|
9506
|
+
peak_freq_2: payload.slice(11, 13).reduce(msbLsb),
|
|
9507
|
+
peak_freq_3: payload.slice(13, 15).reduce(msbLsb)
|
|
9508
|
+
};
|
|
9264
9509
|
};
|
|
9265
|
-
}
|
|
9266
|
-
}
|
|
9510
|
+
};
|
|
9511
|
+
},
|
|
9267
9512
|
},
|
|
9268
9513
|
'535': {
|
|
9269
9514
|
name: 'Custom Wireless CO2 Gas Sensor',
|
|
@@ -10502,12 +10747,16 @@ function sensor_types(parent){
|
|
|
10502
10747
|
return {
|
|
10503
10748
|
subdevice_type: d[0],
|
|
10504
10749
|
number_of_registers: d[1],
|
|
10750
|
+
status_24_31: d[2],
|
|
10751
|
+
status_16_23: d[3],
|
|
10752
|
+
status_8_15: d[4],
|
|
10753
|
+
status_0_7: d[5],
|
|
10505
10754
|
// TODO we can automatically determine how many registers are here based on the number_of_registers and create data objects appropriately
|
|
10506
10755
|
// r1: d.slice(2,4),
|
|
10507
10756
|
// r2: d.slice(4,6),
|
|
10508
10757
|
// r3: d.slice(6,8),
|
|
10509
10758
|
// r4: d.slice(8,10),
|
|
10510
|
-
data: d.slice(
|
|
10759
|
+
data: d.slice(6)
|
|
10511
10760
|
};
|
|
10512
10761
|
},
|
|
10513
10762
|
},
|
package/package.json
CHANGED
package/wireless.html
CHANGED
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
sub_device_type_539:{value: 10, validate: NCD_validators.number_range(0, 255)},
|
|
413
413
|
|
|
414
414
|
number_of_regs_to_rd_539_active:{value:""},
|
|
415
|
-
number_of_regs_to_rd_539:{value: 1, validate: NCD_validators.number_range(0,
|
|
415
|
+
number_of_regs_to_rd_539:{value: 1, validate: NCD_validators.number_range(0, 32)},
|
|
416
416
|
|
|
417
417
|
register_value_0_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
418
418
|
register_value_1_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
@@ -424,6 +424,35 @@
|
|
|
424
424
|
register_value_7_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
425
425
|
register_value_8_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
426
426
|
register_value_9_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
427
|
+
register_value_10_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
428
|
+
register_value_11_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
429
|
+
register_value_12_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
430
|
+
register_value_13_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
431
|
+
register_value_14_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
432
|
+
register_value_15_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
433
|
+
register_value_16_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
434
|
+
register_value_17_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
435
|
+
register_value_18_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
436
|
+
register_value_19_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
437
|
+
register_value_20_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
438
|
+
register_value_21_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
439
|
+
register_value_22_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
440
|
+
register_value_23_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
441
|
+
register_value_24_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
442
|
+
register_value_25_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
443
|
+
register_value_26_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
444
|
+
register_value_27_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
445
|
+
register_value_28_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
446
|
+
register_value_29_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
447
|
+
register_value_30_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
448
|
+
register_value_31_539: {value: 0, validate: NCD_validators.number_range(0, 65535)},
|
|
449
|
+
|
|
450
|
+
number_of_read_retries_539_active:{value:""},
|
|
451
|
+
number_of_read_retries_539:{value: 1, validate: NCD_validators.number_range(1, 3)},
|
|
452
|
+
|
|
453
|
+
read_parameter_539_active:{value:""},
|
|
454
|
+
read_parameter_539:{value: 3},
|
|
455
|
+
|
|
427
456
|
//config_set_reg_active_539:{value:""},
|
|
428
457
|
//config_set_reg_539:{value:50, validate: NCD_validators.number_range(0, 65534)},
|
|
429
458
|
|
|
@@ -452,7 +481,10 @@
|
|
|
452
481
|
mode_1011:{value: 0},
|
|
453
482
|
|
|
454
483
|
auto_address_timeout_1011_active:{value:""},
|
|
455
|
-
auto_address_timeout_1011:{value:0, validate: NCD_validators.number_range(0, 65534)}
|
|
484
|
+
auto_address_timeout_1011:{value:0, validate: NCD_validators.number_range(0, 65534)},
|
|
485
|
+
|
|
486
|
+
mode_531_active: {value: ""},
|
|
487
|
+
mode_531: {value: 0}
|
|
456
488
|
|
|
457
489
|
},
|
|
458
490
|
inputs: 0,
|
|
@@ -515,6 +547,7 @@
|
|
|
515
547
|
"53": "53 - Air Quality CO2 and PM Sensor",
|
|
516
548
|
"54": "54 - 3 Channel RTD",
|
|
517
549
|
"56": "56 - 2 Channel 0-10VDC Receiver",
|
|
550
|
+
"58": "58 - Tank Level v3",
|
|
518
551
|
"60": "60 - Air Velocity, Pressure, & Temperature Sensor",
|
|
519
552
|
"61": "61 - pH Temperature Sensor",
|
|
520
553
|
"62": "62 - ORP Temperature Sensor",
|
|
@@ -803,6 +836,7 @@
|
|
|
803
836
|
<option value="53">53 - Air Quality CO2 and PM Sensor</option>
|
|
804
837
|
<option value="54">54 - 3 Channel RTD</option>
|
|
805
838
|
<option value="56">56 - 2 Channel 0-10VDC Receiver</option>
|
|
839
|
+
<option value="58">58 - Tank Level v3</option>
|
|
806
840
|
<option value="60">60 - Air Velocity and Precision Pressure & Temperature Sensor</option>
|
|
807
841
|
<option value="61">61 - pH Temperature Sensor</option>
|
|
808
842
|
<option value="62">62 - ORP Temperature Sensor</option>
|
|
@@ -878,7 +912,7 @@
|
|
|
878
912
|
<label for="node-input-auto_config"><i class="icon-tag"></i> Auto Config</label>
|
|
879
913
|
<input class="section-control" type="checkbox" id="node-input-auto_config" value="1">
|
|
880
914
|
</div>
|
|
881
|
-
<div class="form-row ncd-dependent" data-sensor-23 data-sensor-26 data-sensor-39 data-sensor-45 data-sensor-48 data-sensor-52 data-sensor-76 data-sensor-78 data-sensor-79 data-sensor-80 data-sensor-81 data-sensor-82 data-sensor-84 data-sensor-88 data-sensor-89 data-sensor-90 data-sensor-91 data-sensor-101 data-sensor-102 data-sensor-105 data-sensor-106 data-sensor-107 data-sensor-108 data-sensor-110 data-sensor-111 data-sensor-112 data-sensor-114 data-sensor-180 data-sensor-181 data-sensor-519 data-sensor-520 data-sensor-521 data-sensor-531 data-sensor-535 data-sensor-537 data-sensor-538 data-sensor-539 data-sensor-540 data-sensor-1010 data-sensor-1011>
|
|
915
|
+
<div class="form-row ncd-dependent" data-sensor-23 data-sensor-26 data-sensor-39 data-sensor-45 data-sensor-48 data-sensor-52 data-sensor-58 data-sensor-76 data-sensor-78 data-sensor-79 data-sensor-80 data-sensor-81 data-sensor-82 data-sensor-84 data-sensor-88 data-sensor-89 data-sensor-90 data-sensor-91 data-sensor-101 data-sensor-102 data-sensor-105 data-sensor-106 data-sensor-107 data-sensor-108 data-sensor-110 data-sensor-111 data-sensor-112 data-sensor-114 data-sensor-180 data-sensor-181 data-sensor-519 data-sensor-520 data-sensor-521 data-sensor-531 data-sensor-535 data-sensor-537 data-sensor-538 data-sensor-539 data-sensor-540 data-sensor-1010 data-sensor-1011>
|
|
882
916
|
<hr>
|
|
883
917
|
<label for="node-input-on_the_fly_enable"><i class="icon-tag"></i> OTF Config*</label>
|
|
884
918
|
<input type="checkbox" id="node-input-on_the_fly_enable" value="1">
|
|
@@ -2308,6 +2342,34 @@
|
|
|
2308
2342
|
<input type="text" id="node-input-sub_device_type_539" placeholder="10" value="10">
|
|
2309
2343
|
</div>
|
|
2310
2344
|
</div>
|
|
2345
|
+
<div class="form-row ncd-active-check">
|
|
2346
|
+
<strong>Set Number of Read Retries</strong>
|
|
2347
|
+
<p class="caption">
|
|
2348
|
+
Range: 1 to 3.
|
|
2349
|
+
</p>
|
|
2350
|
+
<div>
|
|
2351
|
+
<label for="node-input-number_of_read_retries_539_active">Active:</label>
|
|
2352
|
+
<input type="checkbox" id="node-input-number_of_read_retries_539_active" class="ncd-config-toggle" data-target-id="node-input-number_of_read_retries_539" value="1">
|
|
2353
|
+
</div>
|
|
2354
|
+
<div>
|
|
2355
|
+
<label for="node-input-number_of_read_retries_539"><i class="icon-tag"></i>Value:</label>
|
|
2356
|
+
<input type="text" id="node-input-number_of_read_retries_539" placeholder="1" value="1">
|
|
2357
|
+
</div>
|
|
2358
|
+
</div>
|
|
2359
|
+
<div class="form-row ncd-active-check">
|
|
2360
|
+
<strong>Set Read Parameter</strong>
|
|
2361
|
+
<div>
|
|
2362
|
+
<label for="node-input-read_parameter_539_active">Active:</label>
|
|
2363
|
+
<input type="checkbox" id="node-input-read_parameter_539_active" class="ncd-config-toggle" data-target-id="node-input-read_parameter_539" value="1">
|
|
2364
|
+
</div>
|
|
2365
|
+
<div>
|
|
2366
|
+
<label for="node-input-read_parameter_539"><i class="icon-tag"></i>Value:</label>
|
|
2367
|
+
<select id="node-input-read_parameter_539">
|
|
2368
|
+
<option selected="selected" value="3">Read Holding Register 0x03</option>
|
|
2369
|
+
<option value="4">Read Input Register 0x04</option>
|
|
2370
|
+
</select>
|
|
2371
|
+
</div>
|
|
2372
|
+
</div>
|
|
2311
2373
|
<div class="form-row ncd-active-check">
|
|
2312
2374
|
<strong>Set Read Registers</strong>
|
|
2313
2375
|
<p class="caption">
|
|
@@ -2331,6 +2393,27 @@
|
|
|
2331
2393
|
<option value="8">8</option>
|
|
2332
2394
|
<option value="9">9</option>
|
|
2333
2395
|
<option value="10">10</option>
|
|
2396
|
+
<option value="11">11</option>
|
|
2397
|
+
<option value="12">12</option>
|
|
2398
|
+
<option value="13">13</option>
|
|
2399
|
+
<option value="14">14</option>
|
|
2400
|
+
<option value="15">15</option>
|
|
2401
|
+
<option value="16">16</option>
|
|
2402
|
+
<option value="17">17</option>
|
|
2403
|
+
<option value="18">18</option>
|
|
2404
|
+
<option value="19">19</option>
|
|
2405
|
+
<option value="20">20</option>
|
|
2406
|
+
<option value="21">21</option>
|
|
2407
|
+
<option value="22">22</option>
|
|
2408
|
+
<option value="23">23</option>
|
|
2409
|
+
<option value="24">24</option>
|
|
2410
|
+
<option value="25">25</option>
|
|
2411
|
+
<option value="26">26</option>
|
|
2412
|
+
<option value="27">27</option>
|
|
2413
|
+
<option value="28">28</option>
|
|
2414
|
+
<option value="29">29</option>
|
|
2415
|
+
<option value="30">30</option>
|
|
2416
|
+
<option value="31">31</option>
|
|
2334
2417
|
</select>
|
|
2335
2418
|
</div>
|
|
2336
2419
|
<hr>
|
|
@@ -2469,6 +2552,24 @@
|
|
|
2469
2552
|
</div>
|
|
2470
2553
|
</div>
|
|
2471
2554
|
</div>
|
|
2555
|
+
<div class="ncd-dependent" data-sensor-531>
|
|
2556
|
+
<hr>
|
|
2557
|
+
<div class="form-row ncd-active-check">
|
|
2558
|
+
<strong>Mode</strong>
|
|
2559
|
+
<p>WARNING: If Mode is set to Raw it is recommended to also set the Destination Address configuration to the address of your Receiver/Gateway.</p>
|
|
2560
|
+
<div>
|
|
2561
|
+
<label for="node-input-mode_531_active"><i class="icon-tag"></i>Active:</label>
|
|
2562
|
+
<input type="checkbox" id="node-input-mode_531_active" class="ncd-config-toggle" data-target-id="node-input-mode_531" value="1">
|
|
2563
|
+
</div>
|
|
2564
|
+
<div>
|
|
2565
|
+
<label for="node-input-mode_531"><i class="icon-tag"></i>Value:</label>
|
|
2566
|
+
<select id="node-input-mode_531">
|
|
2567
|
+
<option selected="selected" value="0">Processed</option>
|
|
2568
|
+
<option value="1">Raw</option>
|
|
2569
|
+
</select>
|
|
2570
|
+
</div>
|
|
2571
|
+
</div>
|
|
2572
|
+
</div>
|
|
2472
2573
|
</div>
|
|
2473
2574
|
</div>
|
|
2474
2575
|
</script>
|
package/wireless.js
CHANGED
|
@@ -1877,6 +1877,11 @@ module.exports = function(RED) {
|
|
|
1877
1877
|
promises.set_rtc_101 = node.config_gateway.config_set_rtc_101(mac);
|
|
1878
1878
|
}
|
|
1879
1879
|
break;
|
|
1880
|
+
case 531:
|
|
1881
|
+
if(config.mode_531_active){
|
|
1882
|
+
promises.mode_531 = node.config_gateway.config_set_operation_mode_531(mac, parseInt(config.mode_531));
|
|
1883
|
+
}
|
|
1884
|
+
break;
|
|
1880
1885
|
case 535:
|
|
1881
1886
|
if(config.force_calibration_co2_535_active){
|
|
1882
1887
|
promises.force_calibration_co2_535 = node.config_gateway.config_set_sensor_forced_calibration_535(mac);
|
|
@@ -2007,6 +2012,12 @@ module.exports = function(RED) {
|
|
|
2007
2012
|
if(config.sub_device_type_539_active){
|
|
2008
2013
|
promises.sub_device_type_539 = node.config_gateway.config_set_sub_device_type_539(mac, parseInt(config.sub_device_type_539));
|
|
2009
2014
|
}
|
|
2015
|
+
if(config.number_of_read_retries_539_active){
|
|
2016
|
+
promises.number_of_read_retries_539 = node.config_gateway.config_set_number_of_read_retries_539(mac, parseInt(config.number_of_read_retries_539));
|
|
2017
|
+
}
|
|
2018
|
+
if(config.read_parameter_539_active){
|
|
2019
|
+
promises.read_parameter_539 = node.config_gateway.config_set_read_parameter_539(mac, parseInt(config.read_parameter_539));
|
|
2020
|
+
}
|
|
2010
2021
|
if(config.number_of_regs_to_rd_539_active){
|
|
2011
2022
|
let register_array = [];
|
|
2012
2023
|
for(let ind = 0; ind < config.number_of_regs_to_rd_539; ind++){
|