@ncd-io/node-red-enterprise-sensors 1.4.2 → 1.4.4
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 +67 -21
- package/package.json +1 -1
- package/wireless.html +11 -10
package/lib/WirelessGateway.js
CHANGED
|
@@ -4112,25 +4112,24 @@ function sensor_types(parent){
|
|
|
4112
4112
|
switch(frame[16]){
|
|
4113
4113
|
case 0:
|
|
4114
4114
|
frame_data.fsr = "+-6.114 V";
|
|
4115
|
-
|
|
4115
|
+
break;
|
|
4116
4116
|
case 1:
|
|
4117
4117
|
frame_data.fsr = "+-4.096 V";
|
|
4118
|
-
|
|
4118
|
+
break;
|
|
4119
4119
|
case 2:
|
|
4120
4120
|
frame_data.fsr = "+-2.048 V";
|
|
4121
|
-
|
|
4121
|
+
break;
|
|
4122
4122
|
case 3:
|
|
4123
4123
|
frame_data.fsr = "+-1.024 V";
|
|
4124
|
-
|
|
4124
|
+
break;
|
|
4125
4125
|
case 4:
|
|
4126
4126
|
frame_data.fsr = "+-0.512 V";
|
|
4127
|
-
|
|
4127
|
+
break;
|
|
4128
4128
|
case 5:
|
|
4129
4129
|
frame_data.fsr = "+-0.256 V";
|
|
4130
|
-
|
|
4130
|
+
break;
|
|
4131
4131
|
}
|
|
4132
|
-
if(firmware >
|
|
4133
|
-
let frame_data = {};
|
|
4132
|
+
if(firmware > 18){ // firmware 14 and above
|
|
4134
4133
|
let auto_check_interval = frame.slice(20, 22).reduce(msbLsb);
|
|
4135
4134
|
if(!auto_check_interval){
|
|
4136
4135
|
frame_data.auto_check_interval = 'Disabled';
|
|
@@ -4168,6 +4167,41 @@ function sensor_types(parent){
|
|
|
4168
4167
|
'tx_life_counter': frame.slice(44, 48)
|
|
4169
4168
|
}
|
|
4170
4169
|
}
|
|
4170
|
+
}else if(firmware > 13){ // firmware 14 and above
|
|
4171
|
+
let auto_check_interval = frame.slice(20, 22).reduce(msbLsb);
|
|
4172
|
+
if(!auto_check_interval){
|
|
4173
|
+
frame_data.auto_check_interval = 'Disabled';
|
|
4174
|
+
}else{
|
|
4175
|
+
frame_data.auto_check_interval = auto_check_interval + " sec";
|
|
4176
|
+
}
|
|
4177
|
+
frame_data.always_on = frame[24]?"Enabled":"Disabled";
|
|
4178
|
+
return {
|
|
4179
|
+
'firmware': frame[2],
|
|
4180
|
+
'fsr': frame_data.fsr,
|
|
4181
|
+
'boot_up_time': frame[17] + " sec",
|
|
4182
|
+
'adc_pin_reading': frame.slice(18, 20).reduce(msbLsb),
|
|
4183
|
+
'auto_check_interval': frame_data.auto_check_interval,
|
|
4184
|
+
'auto_check_threshold': frame.slice(22, 24).reduce(msbLsb),
|
|
4185
|
+
'always_on': frame_data.always_on,
|
|
4186
|
+
'hardware_id': frame.slice(25, 28),
|
|
4187
|
+
'report_rate': frame.slice(28, 32).reduce(msbLsb) + " sec",
|
|
4188
|
+
'tx_life_counter': frame.slice(32, 36).reduce(msbLsb),
|
|
4189
|
+
'machine_values': {
|
|
4190
|
+
'firmware': frame[2],
|
|
4191
|
+
'fsr': frame[16],
|
|
4192
|
+
'boot_up_time': frame[17],
|
|
4193
|
+
'adc_pin_reading': frame.slice(18, 20),
|
|
4194
|
+
'auto_check_interval': frame.slice(20, 22),
|
|
4195
|
+
'auto_check_percentage': frame.slice(22, 24),
|
|
4196
|
+
'always_on': frame[24],
|
|
4197
|
+
'calibration_one': frame.slice(25, 29),
|
|
4198
|
+
'calibration_two':frame.slice(29, 33),
|
|
4199
|
+
'calibration_three':frame.slice(33, 37),
|
|
4200
|
+
'hardware_id': frame.slice(37, 40),
|
|
4201
|
+
'report_rate': frame.slice(40, 44),
|
|
4202
|
+
'tx_life_counter': frame.slice(44, 48)
|
|
4203
|
+
}
|
|
4204
|
+
}
|
|
4171
4205
|
}
|
|
4172
4206
|
else if(firmware > 12){
|
|
4173
4207
|
return {
|
|
@@ -8087,17 +8121,17 @@ function sensor_types(parent){
|
|
|
8087
8121
|
|
|
8088
8122
|
/* Evaluate sensor type */
|
|
8089
8123
|
if(payload[8] == 1){ // accelerometer
|
|
8090
|
-
var fsr_mult = 0.
|
|
8124
|
+
var fsr_mult = 0.00030;
|
|
8091
8125
|
var fsr_text = "";
|
|
8092
8126
|
switch(globalDevices[deviceAddr].fsr){
|
|
8093
8127
|
case 0:
|
|
8094
|
-
fsr_mult = 0.
|
|
8128
|
+
fsr_mult = 0.00030;
|
|
8095
8129
|
break;
|
|
8096
8130
|
case 1:
|
|
8097
|
-
fsr_mult = 0.
|
|
8131
|
+
fsr_mult = 0.00061;
|
|
8098
8132
|
break;
|
|
8099
8133
|
case 2:
|
|
8100
|
-
fsr_mult = 0.
|
|
8134
|
+
fsr_mult = 0.00122;
|
|
8101
8135
|
break;
|
|
8102
8136
|
}
|
|
8103
8137
|
switch(globalDevices[deviceAddr].fsr){
|
|
@@ -8112,20 +8146,20 @@ function sensor_types(parent){
|
|
|
8112
8146
|
break;
|
|
8113
8147
|
}
|
|
8114
8148
|
}else{ // gyro
|
|
8115
|
-
var fsr_mult = 0.
|
|
8149
|
+
var fsr_mult = 0.0076;
|
|
8116
8150
|
var fsr_text = "";
|
|
8117
8151
|
switch(globalDevices[deviceAddr].fsr){
|
|
8118
8152
|
case 0:
|
|
8119
|
-
fsr_mult = 0.
|
|
8153
|
+
fsr_mult = 0.0076;
|
|
8120
8154
|
break;
|
|
8121
8155
|
case 1:
|
|
8122
|
-
fsr_mult = 0.
|
|
8156
|
+
fsr_mult = 0.015;
|
|
8123
8157
|
break;
|
|
8124
8158
|
case 2:
|
|
8125
|
-
fsr_mult = 0.
|
|
8159
|
+
fsr_mult = 0.0305;
|
|
8126
8160
|
break;
|
|
8127
8161
|
case 3:
|
|
8128
|
-
fsr_mult = 0.
|
|
8162
|
+
fsr_mult = 0.061;
|
|
8129
8163
|
break;
|
|
8130
8164
|
}
|
|
8131
8165
|
switch(globalDevices[deviceAddr].fsr){
|
|
@@ -9261,7 +9295,10 @@ function sensor_types(parent){
|
|
|
9261
9295
|
var fft_concat_obj = {
|
|
9262
9296
|
mode: payload[8],
|
|
9263
9297
|
msg_type: msg_type,
|
|
9264
|
-
time_id:
|
|
9298
|
+
time_id: [
|
|
9299
|
+
String(globalDevices[deviceAddr].hour).padStart(2, '0'),
|
|
9300
|
+
String(globalDevices[deviceAddr].minute).padStart(2, '0'),
|
|
9301
|
+
].join(':'),
|
|
9265
9302
|
mac_address: deviceAddr,
|
|
9266
9303
|
fsr: fsr_text,
|
|
9267
9304
|
odr: globalDevices[deviceAddr].odr,
|
|
@@ -9903,7 +9940,10 @@ function sensor_types(parent){
|
|
|
9903
9940
|
mode: payload[8],
|
|
9904
9941
|
msg_type: msg_type,
|
|
9905
9942
|
probe: probe,
|
|
9906
|
-
time_id:
|
|
9943
|
+
time_id: [
|
|
9944
|
+
String(globalDevices[deviceAddr].hour).padStart(2, '0'),
|
|
9945
|
+
String(globalDevices[deviceAddr].minute).padStart(2, '0'),
|
|
9946
|
+
].join(':'),
|
|
9907
9947
|
probe: probe,
|
|
9908
9948
|
mac_address: deviceAddr,
|
|
9909
9949
|
fsr: fsr_text,
|
|
@@ -10742,7 +10782,10 @@ function sensor_types(parent){
|
|
|
10742
10782
|
var fft_concat_obj = {
|
|
10743
10783
|
mode: payload[8],
|
|
10744
10784
|
msg_type: msg_type,
|
|
10745
|
-
time_id:
|
|
10785
|
+
time_id: [
|
|
10786
|
+
String(globalDevices[deviceAddr].hour).padStart(2, '0'),
|
|
10787
|
+
String(globalDevices[deviceAddr].minute).padStart(2, '0'),
|
|
10788
|
+
].join(':'),
|
|
10746
10789
|
mac_address: deviceAddr,
|
|
10747
10790
|
fsr: fsr_text,
|
|
10748
10791
|
odr: globalDevices[deviceAddr].odr,
|
|
@@ -11378,7 +11421,10 @@ function sensor_types(parent){
|
|
|
11378
11421
|
var fft_concat_obj = {
|
|
11379
11422
|
mode: payload[8],
|
|
11380
11423
|
msg_type: msg_type,
|
|
11381
|
-
time_id:
|
|
11424
|
+
time_id: [
|
|
11425
|
+
String(globalDevices[deviceAddr].hour).padStart(2, '0'),
|
|
11426
|
+
String(globalDevices[deviceAddr].minute).padStart(2, '0'),
|
|
11427
|
+
].join(':'),
|
|
11382
11428
|
mac_address: deviceAddr,
|
|
11383
11429
|
fsr: fsr_text,
|
|
11384
11430
|
odr: globalDevices[deviceAddr].odr,
|
package/package.json
CHANGED
package/wireless.html
CHANGED
|
@@ -5150,8 +5150,8 @@
|
|
|
5150
5150
|
<div>
|
|
5151
5151
|
<label for="node-input-enable_sensor_103"><i class="icon-tag"></i>Value:</label>
|
|
5152
5152
|
<select id="node-input-enable_sensor_103">
|
|
5153
|
-
<option value="1">
|
|
5154
|
-
<option value="2">
|
|
5153
|
+
<option value="1">Gyroscope only</option>
|
|
5154
|
+
<option value="2">Accelerometer only</option>
|
|
5155
5155
|
<option value="3"selected>All enabled</option>
|
|
5156
5156
|
</select>
|
|
5157
5157
|
</div>
|
|
@@ -5168,17 +5168,18 @@
|
|
|
5168
5168
|
<div>
|
|
5169
5169
|
<label for="node-input-enable_hp_filter_cutoff_103"><i class="icon-tag"></i>Value:</label>
|
|
5170
5170
|
<select id="node-input-enable_hp_filter_cutoff_103">
|
|
5171
|
-
<option value="0">
|
|
5172
|
-
<option value="1">0.
|
|
5173
|
-
<option value="2">0.
|
|
5174
|
-
<option value="3">0.
|
|
5175
|
-
<option value="4">0.
|
|
5176
|
-
<option value="5">0.
|
|
5171
|
+
<option value="0">Disabled</option>
|
|
5172
|
+
<option value="1">0.00247</option>
|
|
5173
|
+
<option value="2">0.00062084</option>
|
|
5174
|
+
<option value="3">0.00015545</option>
|
|
5175
|
+
<option value="4">0.00003862</option>
|
|
5176
|
+
<option value="5">0.00000954</option>
|
|
5177
|
+
<option value="6">0.00000238</option>
|
|
5177
5178
|
</select>
|
|
5178
5179
|
</div>
|
|
5179
5180
|
</div>
|
|
5180
5181
|
<div class="form-row ncd-active-check">
|
|
5181
|
-
<strong>Set
|
|
5182
|
+
<strong>Set Gyroscope FSR</strong>
|
|
5182
5183
|
<div>
|
|
5183
5184
|
<label for="node-input-gyro_fsr_103_active"><i class="icon-tag"></i>Active:</label>
|
|
5184
5185
|
<input type="checkbox" id="node-input-gyro_fsr_103_active" class="ncd-config-toggle" data-target-id="node-input-gyro_fsr_103" value="1">
|
|
@@ -5189,7 +5190,7 @@
|
|
|
5189
5190
|
<option value="0" selected>250dps</option>
|
|
5190
5191
|
<option value="1">500dps</option>
|
|
5191
5192
|
<option value="2">1000dps</option>
|
|
5192
|
-
<option value="3">
|
|
5193
|
+
<option value="3">3000dps</option>
|
|
5193
5194
|
</select>
|
|
5194
5195
|
</div>
|
|
5195
5196
|
</div>
|