@ncd-io/node-red-enterprise-sensors 1.1.3 → 1.1.5
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 +271 -91
- package/package.json +1 -1
- package/wireless.html +711 -278
- package/wireless.js +88 -50
package/lib/WirelessGateway.js
CHANGED
|
@@ -141,7 +141,7 @@ module.exports = class WirelessSensor{
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
// #OTF
|
|
144
|
-
var otf_devices = [23,26,32,33,39,44,45,48,52,53,58,74,76,78,79,80,81,82,84,88,89,90,91,97,98,101,102,105,106,107,108,110,111,112,114,118,180,181,202,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
144
|
+
var otf_devices = [23,26,32,33,39,44,45,48,52,53,56,58,74,76,78,79,80,81,82,84,88,89,90,91,97,98,101,102,105,106,107,108,110,111,112,114,118,180,181,202,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
145
145
|
var device_type = msbLsb(frame.data[6], frame.data[7]);
|
|
146
146
|
// var device_type = frame.data[7];
|
|
147
147
|
|
|
@@ -303,7 +303,7 @@ module.exports = class WirelessSensor{
|
|
|
303
303
|
};
|
|
304
304
|
|
|
305
305
|
// #OTF
|
|
306
|
-
var otf_devices = [23,26,32,33,39,44,45,48,52,53,58,74,76,78,79,80,81,82,84,88,89,90,91,97,98,101,102,105,106,107,108,110,111,112,114,118,180,181,202,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
306
|
+
var otf_devices = [23,26,32,33,39,44,45,48,52,53,56,58,74,76,78,79,80,81,82,84,88,89,90,91,97,98,101,102,105,106,107,108,110,111,112,114,118,180,181,202,519,520,521,531,535,537,538,539,540,1010,1011];
|
|
307
307
|
if(otf_devices.includes(parsed.sensor_type)){
|
|
308
308
|
// If the message says FLY and there is not FLY timer in progress.
|
|
309
309
|
if(payload[8] == 70 && payload[9] == 76 && payload[10] == 89) {
|
|
@@ -1164,18 +1164,6 @@ module.exports = class WirelessSensor{
|
|
|
1164
1164
|
console.log(packet);
|
|
1165
1165
|
return this.config_send(sensor_mac, packet);
|
|
1166
1166
|
}
|
|
1167
|
-
config_set_acceleration_interrupt_threshold_p1_84(sensor_mac, value){
|
|
1168
|
-
console.log('config_set_acceleration_interrupt_threshold_p1_84');
|
|
1169
|
-
var packet = [244, 79, 0, 0, 0, 60, 1, value];
|
|
1170
|
-
console.log(packet);
|
|
1171
|
-
return this.config_send(sensor_mac, packet);
|
|
1172
|
-
}
|
|
1173
|
-
config_set_acceleration_interrupt_threshold_p2_84(sensor_mac, value){
|
|
1174
|
-
console.log('config_set_acceleration_interrupt_threshold_p2_84');
|
|
1175
|
-
var packet = [244, 79, 0, 0, 0, 60, 2, value];
|
|
1176
|
-
console.log(packet);
|
|
1177
|
-
return this.config_send(sensor_mac, packet);
|
|
1178
|
-
}
|
|
1179
1167
|
config_get_sampling_interval_101(sensor_mac, sampling_interval){
|
|
1180
1168
|
console.log('config_get_sampling_interval_101');
|
|
1181
1169
|
var packet = [244, 79, 0, 0, 101, 7];
|
|
@@ -1583,6 +1571,72 @@ module.exports = class WirelessSensor{
|
|
|
1583
1571
|
console.log(packet);
|
|
1584
1572
|
return this.config_send(sensor_mac, packet);
|
|
1585
1573
|
}
|
|
1574
|
+
config_set_odr_p1_110(sensor_mac, value){
|
|
1575
|
+
console.log('config_set_odr_p1_110');
|
|
1576
|
+
var packet = [244, 79, 0, 0, 101, 0, 1, value];
|
|
1577
|
+
console.log(packet);
|
|
1578
|
+
return this.config_send(sensor_mac, packet);
|
|
1579
|
+
}
|
|
1580
|
+
config_set_odr_p2_110(sensor_mac, value){
|
|
1581
|
+
console.log('config_set_odr_p2_110');
|
|
1582
|
+
var packet = [244, 79, 0, 0, 101, 0, 2, value];
|
|
1583
|
+
console.log(packet);
|
|
1584
|
+
return this.config_send(sensor_mac, packet);
|
|
1585
|
+
}
|
|
1586
|
+
config_set_sampling_duration_p1_110(sensor_mac, value){
|
|
1587
|
+
console.log('config_set_sampling_duration_p1_110');
|
|
1588
|
+
var packet = [244, 79, 0, 0, 101, 2, 1, value];
|
|
1589
|
+
console.log(packet);
|
|
1590
|
+
return this.config_send(sensor_mac, packet);
|
|
1591
|
+
}
|
|
1592
|
+
config_set_sampling_duration_p2_110(sensor_mac, value){
|
|
1593
|
+
console.log('config_set_sampling_duration_p2_110');
|
|
1594
|
+
var packet = [244, 79, 0, 0, 101, 2, 2, value];
|
|
1595
|
+
console.log(packet);
|
|
1596
|
+
return this.config_send(sensor_mac, packet);
|
|
1597
|
+
}
|
|
1598
|
+
config_set_low_pass_filter_p1_110(sensor_mac, value){
|
|
1599
|
+
console.log('config_set_low_pass_filter_p1_110');
|
|
1600
|
+
var packet = [244, 79, 0, 0, 80, 52, 1, value];
|
|
1601
|
+
console.log(packet);
|
|
1602
|
+
return this.config_send(sensor_mac, packet);
|
|
1603
|
+
}
|
|
1604
|
+
config_set_low_pass_filter_p2_110(sensor_mac, value){
|
|
1605
|
+
console.log('config_set_low_pass_filter_p2_110');
|
|
1606
|
+
var packet = [244, 79, 0, 0, 80, 52, 2, value];
|
|
1607
|
+
console.log(packet);
|
|
1608
|
+
return this.config_send(sensor_mac, packet);
|
|
1609
|
+
}
|
|
1610
|
+
config_set_high_pass_filter_p1_110(sensor_mac, value){
|
|
1611
|
+
console.log('config_set_high_pass_filter_p1_110');
|
|
1612
|
+
var packet = [244, 79, 0, 0, 80, 54, 1, value];
|
|
1613
|
+
console.log(packet);
|
|
1614
|
+
return this.config_send(sensor_mac, packet);
|
|
1615
|
+
}
|
|
1616
|
+
config_set_high_pass_filter_p2_110(sensor_mac, value){
|
|
1617
|
+
console.log('config_set_high_pass_filter_p2_110');
|
|
1618
|
+
var packet = [244, 79, 0, 0, 80, 54, 2, value];
|
|
1619
|
+
console.log(packet);
|
|
1620
|
+
return this.config_send(sensor_mac, packet);
|
|
1621
|
+
}
|
|
1622
|
+
config_set_motion_detect_threshold_p1_110(sensor_mac, value){
|
|
1623
|
+
console.log('config_set_motion_detect_threshold_p1_110');
|
|
1624
|
+
var packet = [244, 79, 0, 0, 80, 60, 1, value];
|
|
1625
|
+
console.log(packet);
|
|
1626
|
+
return this.config_send(sensor_mac, packet);
|
|
1627
|
+
}
|
|
1628
|
+
config_set_motion_detect_threshold_p2_110(sensor_mac, value){
|
|
1629
|
+
console.log('config_set_motion_detect_threshold_p2_110');
|
|
1630
|
+
var packet = [244, 79, 0, 0, 80, 60, 2, value];
|
|
1631
|
+
console.log(packet);
|
|
1632
|
+
return this.config_send(sensor_mac, packet);
|
|
1633
|
+
}
|
|
1634
|
+
config_set_acceleration_interrupt_threshold_84(sensor_mac, value){
|
|
1635
|
+
console.log('config_set_acceleration_interrupt_threshold_84');
|
|
1636
|
+
var packet = [244, 79, 0, 0, 0, 60, value];
|
|
1637
|
+
console.log(packet);
|
|
1638
|
+
return this.config_send(sensor_mac, packet);
|
|
1639
|
+
}
|
|
1586
1640
|
config_set_current_calibration_13(sensor_mac, calib){
|
|
1587
1641
|
console.log('config_set_current_calibration_13');
|
|
1588
1642
|
var packet = [244, 1, 0, 0, 0];
|
|
@@ -1820,6 +1874,60 @@ module.exports = class WirelessSensor{
|
|
|
1820
1874
|
console.log(packet);
|
|
1821
1875
|
return this.config_send(sensor_mac, packet);
|
|
1822
1876
|
}
|
|
1877
|
+
config_set_pressure_sensor_type_21(sensor_mac, value){
|
|
1878
|
+
console.log('config_set_pressure_sensor_type_21');
|
|
1879
|
+
var packet = [244, 64, 0, 0, 21, value]
|
|
1880
|
+
console.log(packet);
|
|
1881
|
+
return this.config_send(sensor_mac, packet);
|
|
1882
|
+
}
|
|
1883
|
+
config_set_thermocouple_type_112(sensor_mac, value){
|
|
1884
|
+
console.log('config_set_thermocouple_type_112');
|
|
1885
|
+
let packet = [244, 79, 0, 0, 101, 20, value];
|
|
1886
|
+
console.log(packet);
|
|
1887
|
+
return this.config_send(sensor_mac, packet);
|
|
1888
|
+
}
|
|
1889
|
+
config_set_filter_thermocouple_112(sensor_mac, value){
|
|
1890
|
+
console.log('config_set_filter_thermocouple_112');
|
|
1891
|
+
let packet = [244, 79, 0, 0, 101, 22, value];
|
|
1892
|
+
console.log(packet);
|
|
1893
|
+
return this.config_send(sensor_mac, packet);
|
|
1894
|
+
}
|
|
1895
|
+
config_set_cold_junction_thermocouple_112(sensor_mac, value){
|
|
1896
|
+
console.log('config_set_cold_junction_thermocouple_112');
|
|
1897
|
+
let packet = [244, 79, 0, 0, 101, 24, value];
|
|
1898
|
+
console.log(packet);
|
|
1899
|
+
return this.config_send(sensor_mac, packet);
|
|
1900
|
+
}
|
|
1901
|
+
config_set_sample_resolution_thermocouple_112(sensor_mac, value){
|
|
1902
|
+
console.log('config_set_sample_resolution_thermocouple_112');
|
|
1903
|
+
let packet = [244, 79, 0, 0, 101, 26, value];
|
|
1904
|
+
console.log(packet);
|
|
1905
|
+
return this.config_send(sensor_mac, packet);
|
|
1906
|
+
}
|
|
1907
|
+
config_set_number_of_samples_thermocouple_112(sensor_mac, value){
|
|
1908
|
+
console.log('config_set_number_of_samples_thermocouple_112');
|
|
1909
|
+
let packet = [244, 79, 0, 0, 101, 28, value];
|
|
1910
|
+
console.log(packet);
|
|
1911
|
+
return this.config_send(sensor_mac, packet);
|
|
1912
|
+
}
|
|
1913
|
+
config_set_operation_mode_thermocouple_112(sensor_mac, value){
|
|
1914
|
+
console.log('config_set_operation_mode_thermocouple_112');
|
|
1915
|
+
let packet = [244, 79, 0, 0, 101, 30, value];
|
|
1916
|
+
console.log(packet);
|
|
1917
|
+
return this.config_send(sensor_mac, packet);
|
|
1918
|
+
}
|
|
1919
|
+
config_set_measurement_type_thermocouple_112(sensor_mac, value){
|
|
1920
|
+
console.log('config_set_number_of_samples_thermocouple_112');
|
|
1921
|
+
let packet = [244, 79, 0, 0, 101, 32, value];
|
|
1922
|
+
console.log(packet);
|
|
1923
|
+
return this.config_send(sensor_mac, packet);
|
|
1924
|
+
}
|
|
1925
|
+
config_set_enable_rpm_calculate_status_110(sensor_mac, value){
|
|
1926
|
+
console.log('config_set_enable_rpm_calculate_status_110');
|
|
1927
|
+
let packet = [244, 79, 0, 0, 101, 85, value];
|
|
1928
|
+
console.log(packet);
|
|
1929
|
+
return this.config_send(sensor_mac, packet);
|
|
1930
|
+
}
|
|
1823
1931
|
config_get_delay(sensor_mac){
|
|
1824
1932
|
return new Promise((fulfill, reject) => {
|
|
1825
1933
|
this.config_send(sensor_mac, [247, 21, 0, 0, 0]).then((res) => {
|
|
@@ -7051,8 +7159,8 @@ function sensor_types(parent){
|
|
|
7051
7159
|
frame_data.odr_1 = 25600;
|
|
7052
7160
|
break;
|
|
7053
7161
|
}
|
|
7054
|
-
frame_data.sampling_duration_1 = frame[
|
|
7055
|
-
switch(frame[
|
|
7162
|
+
frame_data.sampling_duration_1 = frame[18]*50 + "ms";
|
|
7163
|
+
switch(frame[19]){
|
|
7056
7164
|
case 0:
|
|
7057
7165
|
frame_data.filter_status = "Disabled";
|
|
7058
7166
|
break;
|
|
@@ -7060,7 +7168,7 @@ function sensor_types(parent){
|
|
|
7060
7168
|
frame_data.filter_status = "Enabled";
|
|
7061
7169
|
break;
|
|
7062
7170
|
}
|
|
7063
|
-
switch(frame[
|
|
7171
|
+
switch(frame[20]){
|
|
7064
7172
|
case 0:
|
|
7065
7173
|
frame_data.lpf_coeff_1 = 4;
|
|
7066
7174
|
break;
|
|
@@ -7093,7 +7201,7 @@ function sensor_types(parent){
|
|
|
7093
7201
|
break;
|
|
7094
7202
|
}
|
|
7095
7203
|
frame_data.lpf_freq_1 = frame_data.odr_1 / frame_data.lpf_coeff_1;
|
|
7096
|
-
switch(frame[
|
|
7204
|
+
switch(frame[21]){
|
|
7097
7205
|
case 0:
|
|
7098
7206
|
frame_data.hpf_coeff_1 = 4;
|
|
7099
7207
|
break;
|
|
@@ -7126,7 +7234,7 @@ function sensor_types(parent){
|
|
|
7126
7234
|
break;
|
|
7127
7235
|
}
|
|
7128
7236
|
frame_data.hpf_freq_1 = frame_data.odr_1 / frame_data.hpf_coeff_1;
|
|
7129
|
-
switch(frame[
|
|
7237
|
+
switch(frame[22]){
|
|
7130
7238
|
case 0:
|
|
7131
7239
|
frame_data.sampling_interval = "5 Minutes";
|
|
7132
7240
|
break;
|
|
@@ -7155,10 +7263,10 @@ function sensor_types(parent){
|
|
|
7155
7263
|
frame_data.sampling_interval = "1 Minute";
|
|
7156
7264
|
break;
|
|
7157
7265
|
}
|
|
7158
|
-
frame_data.on_request_timeout = frame[
|
|
7159
|
-
frame_data.deadband = frame[
|
|
7266
|
+
frame_data.on_request_timeout = frame[23] + " Seconds";
|
|
7267
|
+
frame_data.deadband = frame[24] + "mg";
|
|
7160
7268
|
|
|
7161
|
-
switch(frame[
|
|
7269
|
+
switch(frame[25]){
|
|
7162
7270
|
case 0:
|
|
7163
7271
|
frame_data.payload_length = "50 Bytes";
|
|
7164
7272
|
break;
|
|
@@ -7172,35 +7280,53 @@ function sensor_types(parent){
|
|
|
7172
7280
|
frame_data.payload_length = "180 Bytes";
|
|
7173
7281
|
break;
|
|
7174
7282
|
}
|
|
7175
|
-
|
|
7283
|
+
switch(frame[26]){
|
|
7284
|
+
case 0:
|
|
7285
|
+
frame_data.fsr_text = "2g";
|
|
7286
|
+
break;
|
|
7287
|
+
case 1:
|
|
7288
|
+
frame_data.fsr_text = "4g";
|
|
7289
|
+
break;
|
|
7290
|
+
case 2:
|
|
7291
|
+
frame_data.fsr_text = "8g";
|
|
7292
|
+
break;
|
|
7293
|
+
case 3:
|
|
7294
|
+
frame_data.fsr_text = "16g";
|
|
7295
|
+
break;
|
|
7296
|
+
}
|
|
7297
|
+
frame_data.rpm_status = frame[27]? 'Enabled': 'Disabled';
|
|
7176
7298
|
return {
|
|
7177
7299
|
'firmware': frame[2],
|
|
7178
7300
|
'destination_address': toMac(frame.slice(12, 16)),
|
|
7179
7301
|
'mode': frame_data.mode,
|
|
7180
|
-
'
|
|
7181
|
-
'
|
|
7302
|
+
'odr': frame_data.odr_1+'Hz',
|
|
7303
|
+
'sampling_duration': frame_data.sampling_duration_1,
|
|
7182
7304
|
'filter_status': frame_data.filter_status,
|
|
7183
|
-
'
|
|
7184
|
-
'
|
|
7185
|
-
'
|
|
7186
|
-
'
|
|
7305
|
+
'lpf_coeff': frame_data.lpf_coeff_1,
|
|
7306
|
+
'lpf_freq': frame_data.lpf_freq_1+'Hz',
|
|
7307
|
+
'hpf_coeff': frame_data.hpf_coeff_1,
|
|
7308
|
+
'hpf_freq': frame_data.hpf_freq_1+'Hz',
|
|
7187
7309
|
'sampling_interval': frame_data.sampling_interval,
|
|
7188
7310
|
'on_request_timeout': frame_data.on_request_timeout,
|
|
7189
7311
|
'deadband': frame_data.deadband,
|
|
7190
7312
|
'payload_length': frame_data.payload_length,
|
|
7313
|
+
'fsr': frame_data.fsr_text,
|
|
7314
|
+
'rpm_compute_status': frame_data.rpm_status,
|
|
7191
7315
|
'machine_values': {
|
|
7192
7316
|
'firmware': frame[2],
|
|
7193
7317
|
'destination_address': toMac(frame.slice(12, 16), false),
|
|
7194
7318
|
'mode': frame[16],
|
|
7195
|
-
'
|
|
7196
|
-
'
|
|
7197
|
-
'filter_status': frame[
|
|
7198
|
-
'
|
|
7199
|
-
'
|
|
7200
|
-
'sampling_interval': frame[
|
|
7201
|
-
'on_request_timeout': frame[
|
|
7202
|
-
'deadband': frame[
|
|
7203
|
-
'payload_length': frame[
|
|
7319
|
+
'odr': frame[17],
|
|
7320
|
+
'sampling_duration': frame[18],
|
|
7321
|
+
'filter_status': frame[19],
|
|
7322
|
+
'lpf_coeff': frame[20],
|
|
7323
|
+
'hpf_coeff': frame[21],
|
|
7324
|
+
'sampling_interval': frame[22],
|
|
7325
|
+
'on_request_timeout': frame[23],
|
|
7326
|
+
'deadband': frame[24],
|
|
7327
|
+
'payload_length': frame[25],
|
|
7328
|
+
'fsr': frame[26],
|
|
7329
|
+
'rpm_compute_status': frame[27]
|
|
7204
7330
|
}
|
|
7205
7331
|
}
|
|
7206
7332
|
}
|
|
@@ -7859,7 +7985,21 @@ function sensor_types(parent){
|
|
|
7859
7985
|
frame_data.payload_length = "180 Bytes";
|
|
7860
7986
|
break;
|
|
7861
7987
|
}
|
|
7862
|
-
|
|
7988
|
+
switch(frame[20]){
|
|
7989
|
+
case 0:
|
|
7990
|
+
frame_data.fsr_text = "2g";
|
|
7991
|
+
break;
|
|
7992
|
+
case 1:
|
|
7993
|
+
frame_data.fsr_text = "4g";
|
|
7994
|
+
break;
|
|
7995
|
+
case 2:
|
|
7996
|
+
frame_data.fsr_text = "8g";
|
|
7997
|
+
break;
|
|
7998
|
+
case 3:
|
|
7999
|
+
frame_data.fsr_text = "16g";
|
|
8000
|
+
break;
|
|
8001
|
+
}
|
|
8002
|
+
frame_data.rpm_status = frame[31]? 'Enabled': 'Disabled';
|
|
7863
8003
|
return {
|
|
7864
8004
|
'firmware': frame[2],
|
|
7865
8005
|
'destination_address': toMac(frame.slice(12, 16)),
|
|
@@ -7881,6 +8021,8 @@ function sensor_types(parent){
|
|
|
7881
8021
|
'on_request_timeout': frame_data.on_request_timeout,
|
|
7882
8022
|
'deadband': frame_data.deadband,
|
|
7883
8023
|
'payload_length': frame_data.payload_length,
|
|
8024
|
+
'fsm': frame_data.fsr_text,
|
|
8025
|
+
'rpm_compute_status': frame_data.rpm_status,
|
|
7884
8026
|
'machine_values': {
|
|
7885
8027
|
'firmware': frame[2],
|
|
7886
8028
|
'destination_address': toMac(frame.slice(12, 16), false),
|
|
@@ -7897,7 +8039,9 @@ function sensor_types(parent){
|
|
|
7897
8039
|
'sampling_interval': frame[26],
|
|
7898
8040
|
'on_request_timeout': frame[27],
|
|
7899
8041
|
'deadband': frame[28],
|
|
7900
|
-
'payload_length': frame[29]
|
|
8042
|
+
'payload_length': frame[29],
|
|
8043
|
+
'fsm': frame[30],
|
|
8044
|
+
'rpm_compute_status': frame[31],
|
|
7901
8045
|
}
|
|
7902
8046
|
}
|
|
7903
8047
|
}
|
|
@@ -8177,8 +8321,8 @@ function sensor_types(parent){
|
|
|
8177
8321
|
|
|
8178
8322
|
odr: odr,
|
|
8179
8323
|
temperature: signInt(payload.slice(10, 12).reduce(msbLsb), 16) / 100,
|
|
8180
|
-
|
|
8181
|
-
|
|
8324
|
+
ext_temperature: signInt(payload.slice(12, 16).reduce(msbLsb), 32) / 100,
|
|
8325
|
+
current: signInt(payload.slice(16, 20).reduce(msbLsb), 32) / 1000,
|
|
8182
8326
|
x_rms_ACC_G: payload.slice(20, 22).reduce(msbLsb)/1000,
|
|
8183
8327
|
x_max_ACC_G: payload.slice(22, 24).reduce(msbLsb)/1000,
|
|
8184
8328
|
x_velocity_mm_sec: payload.slice(24, 26).reduce(msbLsb) / 100,
|
|
@@ -8255,8 +8399,8 @@ function sensor_types(parent){
|
|
|
8255
8399
|
frame_data.odr_1 = 25600;
|
|
8256
8400
|
break;
|
|
8257
8401
|
}
|
|
8258
|
-
frame_data.sampling_duration_1 = frame[
|
|
8259
|
-
switch(frame[
|
|
8402
|
+
frame_data.sampling_duration_1 = frame[18]*50 + "ms";
|
|
8403
|
+
switch(frame[19]){
|
|
8260
8404
|
case 0:
|
|
8261
8405
|
frame_data.filter_status = "Disabled";
|
|
8262
8406
|
break;
|
|
@@ -8264,7 +8408,7 @@ function sensor_types(parent){
|
|
|
8264
8408
|
frame_data.filter_status = "Enabled";
|
|
8265
8409
|
break;
|
|
8266
8410
|
}
|
|
8267
|
-
switch(frame[
|
|
8411
|
+
switch(frame[20]){
|
|
8268
8412
|
case 0:
|
|
8269
8413
|
frame_data.lpf_coeff_1 = 4;
|
|
8270
8414
|
break;
|
|
@@ -8297,7 +8441,7 @@ function sensor_types(parent){
|
|
|
8297
8441
|
break;
|
|
8298
8442
|
}
|
|
8299
8443
|
frame_data.lpf_freq_1 = frame_data.odr_1 / frame_data.lpf_coeff_1;
|
|
8300
|
-
switch(frame[
|
|
8444
|
+
switch(frame[21]){
|
|
8301
8445
|
case 0:
|
|
8302
8446
|
frame_data.hpf_coeff_1 = 4;
|
|
8303
8447
|
break;
|
|
@@ -8330,7 +8474,7 @@ function sensor_types(parent){
|
|
|
8330
8474
|
break;
|
|
8331
8475
|
}
|
|
8332
8476
|
frame_data.hpf_freq_1 = frame_data.odr_1 / frame_data.hpf_coeff_1;
|
|
8333
|
-
switch(frame[
|
|
8477
|
+
switch(frame[22]){
|
|
8334
8478
|
case 0:
|
|
8335
8479
|
frame_data.sampling_interval = "5 Minutes";
|
|
8336
8480
|
break;
|
|
@@ -8359,10 +8503,10 @@ function sensor_types(parent){
|
|
|
8359
8503
|
frame_data.sampling_interval = "1 Minute";
|
|
8360
8504
|
break;
|
|
8361
8505
|
}
|
|
8362
|
-
frame_data.on_request_timeout = frame[
|
|
8363
|
-
frame_data.deadband = frame[
|
|
8506
|
+
frame_data.on_request_timeout = frame[23] + " Seconds";
|
|
8507
|
+
frame_data.deadband = frame[24] + "mg";
|
|
8364
8508
|
|
|
8365
|
-
switch(frame[
|
|
8509
|
+
switch(frame[25]){
|
|
8366
8510
|
case 0:
|
|
8367
8511
|
frame_data.payload_length = "50 Bytes";
|
|
8368
8512
|
break;
|
|
@@ -8376,35 +8520,53 @@ function sensor_types(parent){
|
|
|
8376
8520
|
frame_data.payload_length = "180 Bytes";
|
|
8377
8521
|
break;
|
|
8378
8522
|
}
|
|
8379
|
-
|
|
8523
|
+
switch(frame[26]){
|
|
8524
|
+
case 0:
|
|
8525
|
+
frame_data.fsr_text = "2g";
|
|
8526
|
+
break;
|
|
8527
|
+
case 1:
|
|
8528
|
+
frame_data.fsr_text = "4g";
|
|
8529
|
+
break;
|
|
8530
|
+
case 2:
|
|
8531
|
+
frame_data.fsr_text = "8g";
|
|
8532
|
+
break;
|
|
8533
|
+
case 3:
|
|
8534
|
+
frame_data.fsr_text = "16g";
|
|
8535
|
+
break;
|
|
8536
|
+
}
|
|
8537
|
+
frame_data.rpm_status = frame[27]? 'Enabled': 'Disabled';
|
|
8380
8538
|
return {
|
|
8381
8539
|
'firmware': frame[2],
|
|
8382
8540
|
'destination_address': toMac(frame.slice(12, 16)),
|
|
8383
8541
|
'mode': frame_data.mode,
|
|
8384
|
-
'
|
|
8385
|
-
'
|
|
8542
|
+
'odr': frame_data.odr_1+'Hz',
|
|
8543
|
+
'sampling_duration': frame_data.sampling_duration_1,
|
|
8386
8544
|
'filter_status': frame_data.filter_status,
|
|
8387
|
-
'
|
|
8388
|
-
'
|
|
8389
|
-
'
|
|
8390
|
-
'
|
|
8545
|
+
'lpf_coeff': frame_data.lpf_coeff_1,
|
|
8546
|
+
'lpf_freq': frame_data.lpf_freq_1+'Hz',
|
|
8547
|
+
'hpf_coeff': frame_data.hpf_coeff_1,
|
|
8548
|
+
'hpf_freq': frame_data.hpf_freq_1+'Hz',
|
|
8391
8549
|
'sampling_interval': frame_data.sampling_interval,
|
|
8392
8550
|
'on_request_timeout': frame_data.on_request_timeout,
|
|
8393
8551
|
'deadband': frame_data.deadband,
|
|
8394
8552
|
'payload_length': frame_data.payload_length,
|
|
8553
|
+
'fsm': frame_data.fsr_text,
|
|
8554
|
+
'rpm_compute_status': frame_data.rpm_status,
|
|
8395
8555
|
'machine_values': {
|
|
8396
8556
|
'firmware': frame[2],
|
|
8397
8557
|
'destination_address': toMac(frame.slice(12, 16), false),
|
|
8398
8558
|
'mode': frame[16],
|
|
8399
|
-
'
|
|
8400
|
-
'sampling_duration_1': frame[
|
|
8401
|
-
'filter_status': frame[
|
|
8402
|
-
'
|
|
8403
|
-
'
|
|
8404
|
-
'sampling_interval': frame[
|
|
8405
|
-
'on_request_timeout': frame[
|
|
8406
|
-
'deadband': frame[
|
|
8407
|
-
'payload_length': frame[
|
|
8559
|
+
'odr': frame[17],
|
|
8560
|
+
'sampling_duration_1': frame[18],
|
|
8561
|
+
'filter_status': frame[19],
|
|
8562
|
+
'lpf_coeff': frame[20],
|
|
8563
|
+
'hpf_coeff': frame[21],
|
|
8564
|
+
'sampling_interval': frame[22],
|
|
8565
|
+
'on_request_timeout': frame[23],
|
|
8566
|
+
'deadband': frame[24],
|
|
8567
|
+
'payload_length': frame[25],
|
|
8568
|
+
'fsm': frame[26],
|
|
8569
|
+
'rpm_compute_status': frame[27],
|
|
8408
8570
|
}
|
|
8409
8571
|
}
|
|
8410
8572
|
}
|
|
@@ -8703,7 +8865,7 @@ function sensor_types(parent){
|
|
|
8703
8865
|
z_peak_one_Hz: payload.slice(48, 50).reduce(msbLsb),
|
|
8704
8866
|
z_peak_two_Hz: payload.slice(50, 52).reduce(msbLsb),
|
|
8705
8867
|
z_peak_three_Hz: payload.slice(52, 54).reduce(msbLsb),
|
|
8706
|
-
rpm: payload.slice(54, 56).reduce(msbLsb)
|
|
8868
|
+
rpm: payload.slice(54, 56).reduce(msbLsb)
|
|
8707
8869
|
};
|
|
8708
8870
|
}
|
|
8709
8871
|
// else{
|
|
@@ -8756,8 +8918,8 @@ function sensor_types(parent){
|
|
|
8756
8918
|
frame_data.odr_1 = 25600;
|
|
8757
8919
|
break;
|
|
8758
8920
|
}
|
|
8759
|
-
frame_data.sampling_duration_1 = frame[
|
|
8760
|
-
switch(frame[
|
|
8921
|
+
frame_data.sampling_duration_1 = frame[18]*50 + "ms";
|
|
8922
|
+
switch(frame[19]){
|
|
8761
8923
|
case 0:
|
|
8762
8924
|
frame_data.filter_status = "Disabled";
|
|
8763
8925
|
break;
|
|
@@ -8765,7 +8927,7 @@ function sensor_types(parent){
|
|
|
8765
8927
|
frame_data.filter_status = "Enabled";
|
|
8766
8928
|
break;
|
|
8767
8929
|
}
|
|
8768
|
-
switch(frame[
|
|
8930
|
+
switch(frame[20]){
|
|
8769
8931
|
case 0:
|
|
8770
8932
|
frame_data.lpf_coeff_1 = 4;
|
|
8771
8933
|
break;
|
|
@@ -8798,7 +8960,7 @@ function sensor_types(parent){
|
|
|
8798
8960
|
break;
|
|
8799
8961
|
}
|
|
8800
8962
|
frame_data.lpf_freq_1 = frame_data.odr_1 / frame_data.lpf_coeff_1;
|
|
8801
|
-
switch(frame[
|
|
8963
|
+
switch(frame[21]){
|
|
8802
8964
|
case 0:
|
|
8803
8965
|
frame_data.hpf_coeff_1 = 4;
|
|
8804
8966
|
break;
|
|
@@ -8831,7 +8993,7 @@ function sensor_types(parent){
|
|
|
8831
8993
|
break;
|
|
8832
8994
|
}
|
|
8833
8995
|
frame_data.hpf_freq_1 = frame_data.odr_1 / frame_data.hpf_coeff_1;
|
|
8834
|
-
switch(frame[
|
|
8996
|
+
switch(frame[22]){
|
|
8835
8997
|
case 0:
|
|
8836
8998
|
frame_data.sampling_interval = "5 Minutes";
|
|
8837
8999
|
break;
|
|
@@ -8860,10 +9022,10 @@ function sensor_types(parent){
|
|
|
8860
9022
|
frame_data.sampling_interval = "1 Minute";
|
|
8861
9023
|
break;
|
|
8862
9024
|
}
|
|
8863
|
-
frame_data.on_request_timeout = frame[
|
|
8864
|
-
frame_data.deadband = frame[
|
|
9025
|
+
frame_data.on_request_timeout = frame[23] + " Seconds";
|
|
9026
|
+
frame_data.deadband = frame[24] + "mg";
|
|
8865
9027
|
|
|
8866
|
-
switch(frame[
|
|
9028
|
+
switch(frame[25]){
|
|
8867
9029
|
case 0:
|
|
8868
9030
|
frame_data.payload_length = "50 Bytes";
|
|
8869
9031
|
break;
|
|
@@ -8877,35 +9039,53 @@ function sensor_types(parent){
|
|
|
8877
9039
|
frame_data.payload_length = "180 Bytes";
|
|
8878
9040
|
break;
|
|
8879
9041
|
}
|
|
8880
|
-
|
|
9042
|
+
switch(frame[26]){
|
|
9043
|
+
case 0:
|
|
9044
|
+
frame_data.fsr_text = "2g";
|
|
9045
|
+
break;
|
|
9046
|
+
case 1:
|
|
9047
|
+
frame_data.fsr_text = "4g";
|
|
9048
|
+
break;
|
|
9049
|
+
case 2:
|
|
9050
|
+
frame_data.fsr_text = "8g";
|
|
9051
|
+
break;
|
|
9052
|
+
case 3:
|
|
9053
|
+
frame_data.fsr_text = "16g";
|
|
9054
|
+
break;
|
|
9055
|
+
}
|
|
9056
|
+
frame_data.rpm_status = frame[27]? 'Enabled': 'Disabled';
|
|
8881
9057
|
return {
|
|
8882
9058
|
'firmware': frame[2],
|
|
8883
9059
|
'destination_address': toMac(frame.slice(12, 16)),
|
|
8884
9060
|
'mode': frame_data.mode,
|
|
8885
|
-
'
|
|
8886
|
-
'
|
|
9061
|
+
'odr': frame_data.odr_1+'Hz',
|
|
9062
|
+
'sampling_duration': frame_data.sampling_duration_1,
|
|
8887
9063
|
'filter_status': frame_data.filter_status,
|
|
8888
|
-
'
|
|
8889
|
-
'
|
|
8890
|
-
'
|
|
8891
|
-
'
|
|
9064
|
+
'lpf_coeff': frame_data.lpf_coeff_1,
|
|
9065
|
+
'lpf_freq': frame_data.lpf_freq_1+'Hz',
|
|
9066
|
+
'hpf_coeff': frame_data.hpf_coeff_1,
|
|
9067
|
+
'hpf_freq': frame_data.hpf_freq_1+'Hz',
|
|
8892
9068
|
'sampling_interval': frame_data.sampling_interval,
|
|
8893
9069
|
'on_request_timeout': frame_data.on_request_timeout,
|
|
8894
9070
|
'deadband': frame_data.deadband,
|
|
8895
9071
|
'payload_length': frame_data.payload_length,
|
|
9072
|
+
'fsr': frame_data.fsr_text,
|
|
9073
|
+
'rpm_compute_status': frame_data.rpm_status,
|
|
8896
9074
|
'machine_values': {
|
|
8897
9075
|
'firmware': frame[2],
|
|
8898
9076
|
'destination_address': toMac(frame.slice(12, 16), false),
|
|
8899
9077
|
'mode': frame[16],
|
|
8900
|
-
'
|
|
8901
|
-
'
|
|
8902
|
-
'filter_status': frame[
|
|
8903
|
-
'
|
|
8904
|
-
'
|
|
8905
|
-
'sampling_interval': frame[
|
|
8906
|
-
'on_request_timeout': frame[
|
|
8907
|
-
'deadband': frame[
|
|
8908
|
-
'payload_length': frame[
|
|
9078
|
+
'odr': frame[17],
|
|
9079
|
+
'sampling_duration': frame[18],
|
|
9080
|
+
'filter_status': frame[19],
|
|
9081
|
+
'lpf_coeff': frame[20],
|
|
9082
|
+
'hpf_coeff': frame[21],
|
|
9083
|
+
'sampling_interval': frame[22],
|
|
9084
|
+
'on_request_timeout': frame[23],
|
|
9085
|
+
'deadband': frame[24],
|
|
9086
|
+
'payload_length': frame[25],
|
|
9087
|
+
'fsr': frame[26],
|
|
9088
|
+
'rpm_compute_status': frame[27],
|
|
8909
9089
|
}
|
|
8910
9090
|
}
|
|
8911
9091
|
}
|