node-red-contrib-knx-ultimate 1.2.52 → 1.2.57

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/CHANGELOG.md CHANGED
@@ -3,7 +3,45 @@
3
3
  [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
4
4
 
5
5
  <br/>
6
-
6
+ <p>
7
+ <b>Version 1.2.57</b> - November 2021<br/>
8
+ - Added following datapoints:<br/>
9
+ - 12.100 counter timesec (s)<br/>
10
+ - 12.101 counter timemin (min)<br/>
11
+ - 12.102 counter timehrs (h)<br/>
12
+ - 12.1200 volume liquid (l)<br/>
13
+ </p>
14
+ <p>
15
+ <b>Version 1.2.56</b> - November 2021<br/>
16
+ - FIX: hotfix echo in tunneling mode doesn't work since 1.2.55.<br/>
17
+ </p>
18
+ <p>
19
+ <b>Version 1.2.55</b> - November 2021<br/>
20
+ - Gateway servere node: recoding of some javascript parts, to increase speed to better accomodate the crypt/entrypt process of the upcoming KNX-Secure implementation.<br/>
21
+ - KNX-Secure: succesfully read ETS Keyring file and decrypt of Devices keys, Group Address keys, Backbone Key, Management Key and Auth Key.<br/>
22
+ - KNX-Secure: a shield icon near the Gateway name in the KNX Device node appears, if KNX-Secure gateway has been selected.<br/>
23
+ - KNX-Secure: node-red log now logs wether the gateway is secure or not, ETS Keyring project name, created By and ETS version.<br/>
24
+ </p>
25
+ <p>
26
+ <b>Version 1.2.54</b> - November 2021<br/>
27
+ - <font color="red">THIS VERSION TOUCHES MANY CONNECTIVITY POINTS.</font> It should handle all things better, but if you've trouble, you can always revert to the previous version by issuing <b>npm install node-red-contrib-knx-ultimate@1.2.53</b><br/>
28
+ - Tunneling/Routing connection optimization: standardized delay in CONNECT_RESPONSE timeout and cleaned some code to better handling installations with more than 500 group addresses.<br/>
29
+ - In tunneling mode, the node now signal the disconnection after 3 KNX Interface's connection state response failed, as per KNX standard.<br/>
30
+ - Increased the socket telegram TTL (Time to Live) for Multicast as well as for Unicast, from 16 to 128 for better handling of multirouted packets.<br/>
31
+ - Added "[THE GATEWAY NODE HAS BEEN DISABLED]" node status message, if you've disabled the KNX Gateway.<br/>
32
+ - NEW: you can now choose to delay the connection to the KNX BUS at start. In some circumstances it's advisable to delay the connection to the BUS to allow the ethernet cards to be lifted up by the sysop. Thi happens often in VM environments.<br/>
33
+ - Changing the log level in the Gateway node doesn't require a node-red restart anymore.<br/>
34
+ - Because i'm flooded by user's queries, i removed a warning from the node status, if the persitent file has not yet been created.<br/>
35
+ - Wait for message acknowledge by the IP router: now waits for 5 failed message ACKs before firing the disconnection sequence.<br/>
36
+ - FIX: fixed a false "disconnection" node status, due to a glitch in the KNX API (after a connection request, the API was sending a false "disconnection" status). Chiamati in causa anche tutti i Santi, prima.<br/>
37
+ - Fixed some check-connection timers not stopping in time.<br/>
38
+ - Speed up the first KNX connection after node-red start/restart/deploy.<br/>
39
+ - Speed up the reconnection attempts in case of disconnections.<br/>
40
+ </p>
41
+ <p>
42
+ <b>Version 1.2.53</b> - November 2021<br/>
43
+ - Device node: as soon as you add a new node with "read from bus at start" option enabeld, it requests the value from the BUS also if you DEPLOY "modified nodes" only. Prior to that, you had to do a full DEPLOY.<br/>
44
+ </p>
7
45
  <p>
8
46
  <b>Version 1.2.52</b> - October 2021<br/>
9
47
  - KNX Logger node: fixed some default fields.<br/>
@@ -2,7 +2,6 @@
2
2
  * knxultimate-api - a KNX protocol stack in pure Javascript based on knx.js (originally written by Elias Karakoulakis)
3
3
  * (C) 2021 Supergiovane
4
4
  */
5
- const KnxLog = require('./KnxLog')
6
5
  const Parser = require('binary-parser').Parser
7
6
  const KnxConstants = require('./KnxConstants')
8
7
 
@@ -48,7 +47,7 @@ Address.toString = function (buf /* buffer */, addrtype /* ADDRESS_TYPE */, twoL
48
47
  let group = (addrtype === KnxConstants.KNX_ADDR_TYPES.GROUP)
49
48
  let address = null
50
49
 
51
- // KnxLog.get().trace('%j, type: %d, %j', buf, addrtype, knxnetprotocol.twoLevelAddressing);
50
+
52
51
  if (!(typeof buf === 'object' && buf.constructor.name === 'Buffer' && buf.length === 2)) {
53
52
  throw Error('not a buffer, or not a 2-byte address buffer')
54
53
  }
@@ -71,7 +70,7 @@ Address.toString = function (buf /* buffer */, addrtype /* ADDRESS_TYPE */, twoL
71
70
  // parse address string to 2-byte Buffer
72
71
  Address.parse = function (addr /* string */, addrtype /* TYPE */, twoLevelAddressing) {
73
72
  if (!addr) {
74
- KnxLog.get().warn('Fix your code - no address given to Address.parse')
73
+ return "";
75
74
  }
76
75
 
77
76
  let group = (addrtype === KnxConstants.KNX_ADDR_TYPES.GROUP)
@@ -26,22 +26,23 @@ const onUdpSocketMessage = function (msg /*, rinfo, callback */) {
26
26
  // // DISCONNECT_RESPONSE: 0x020a,
27
27
  // var pera =true;
28
28
  // }
29
-
29
+
30
30
  try {
31
31
  let reader = KnxNetProtocol.createReader(msg)
32
32
  let dg
33
-
33
+
34
34
  reader.KNXNetHeader('tmp')
35
-
35
+
36
36
  if (reader.next()['tmp']) {
37
37
  dg = reader.next()['tmp']
38
38
  }
39
-
39
+
40
40
  /* Catch broken messages */
41
41
  if (dg) {
42
42
  /*******************************/
43
43
  // if (pera === true) console.log ("BANANA OCCHIO PERA TRUE",msg.toString("hex"),dg)
44
44
  const descr = this.datagramDesc(dg)
45
+
45
46
 
46
47
  KnxLog.get().trace('(%s): Received %s message: %j', this.compositeState(), descr, dg)
47
48
 
@@ -84,7 +85,6 @@ const onUdpSocketMessage = function (msg /*, rinfo, callback */) {
84
85
  }
85
86
  /*******************************/
86
87
  } catch (err) {
87
- console.trace(err)
88
88
  KnxLog.get().debug('(%s): Incomplete/unparseable UDP packet: %s: %s',
89
89
  this.compositeState(), err, msg.toString()
90
90
  );
@@ -199,7 +199,7 @@ const prepareDatagram = function (svcType) {
199
199
  this.AddTunnState(datagram)
200
200
  break
201
201
  default:
202
- this.log.debug('Do not know how to deal with svc type %d', svcType)
202
+ KnxLog.get().debug('Do not know how to deal with svc type %d', svcType)
203
203
  }
204
204
 
205
205
  return datagram
@@ -209,20 +209,28 @@ const prepareDatagram = function (svcType) {
209
209
  const send = function (datagram, callback) {
210
210
  const conn = this
211
211
  let buf
212
- let ret
212
+ let ret = null;
213
213
  let descr
214
214
 
215
215
  if (datagram.constructor !== Buffer) {
216
- this.writer = KnxNetProtocol.createWriter()
216
+ try {
217
+ this.writer = KnxNetProtocol.createWriter()
218
+ } catch (error) {
219
+ }
220
+
217
221
 
218
222
  // Forge the datagram
219
- ret = this.writer.KNXNetHeader(datagram)
223
+ try {
224
+ ret = this.writer.KNXNetHeader(datagram)
225
+ } catch (error) {
226
+ }
227
+
220
228
 
221
229
  // Check if ret.buffer is null ==> if this.writer.KNXNetHeader() failed
222
- if (ret.buffer === null) {
230
+ if (ret === null || ret.buffer === null) {
223
231
  // Check if error was set - if not, pass a standard message to callback
224
232
  ret.error !== null ? callback(ret.error) : callback(Error('Unknown error!'))
225
-
233
+ KnxLog.get().error(' Const send = function (datagram, callback) %s (%s)', this.compositeState() || "", ret || "");
226
234
  // Cancel the sending process
227
235
  return null; // 25/03/2021 Supergiovane: was return;
228
236
  }
@@ -240,13 +248,12 @@ const send = function (datagram, callback) {
240
248
  buf, 0, buf.length,
241
249
  conn.remoteEndpoint.port, conn.remoteEndpoint.addr.toString(),
242
250
  function (err) {
243
- KnxLog.get().trace('(%s): UDP sent %s: %s %s', conn.compositeState(),
244
- (err ? err.toString() : 'OK'), descr, buf.toString()
245
- )
251
+ KnxLog.get().trace('(%s): UDP sent %s: %s %s', conn.compositeState(),
252
+ (err ? err.toString() : 'OK'), descr, buf.toString()
253
+ )
246
254
  if (typeof callback === 'function') callback(err)
247
255
  }
248
256
  )
249
-
250
257
  return buf; // 25/03/2021 Supergiovane
251
258
  }
252
259
 
@@ -257,7 +264,7 @@ const write = function (grpaddr, value, dptid, callback) {
257
264
  }
258
265
 
259
266
  if (grpaddr == null || value == null) {
260
- this.log.warn('You must supply both grpaddr and value!')
267
+ KnxLog.get().warn('You must supply both grpaddr and value!')
261
268
  return
262
269
  }
263
270
  // outbound request onto the state machine
@@ -276,7 +283,7 @@ const respond = function (grpaddr, value, dptid) {
276
283
  return; // 02/10/2020 Supergiovane: if in tunnel mode and is not connected, exit
277
284
  }
278
285
  if (grpaddr == null || value == null) {
279
- this.log.warn('You must supply both grpaddr and value!')
286
+ KnxLog.get().warn('You must supply both grpaddr and value!')
280
287
  return
281
288
  }
282
289
  const serviceType = this.useTunneling
@@ -297,11 +304,11 @@ const writeRaw = function (grpaddr, value, bitlength, callback) {
297
304
  return; // 02/10/2020 Supergiovane: if in tunnel mode and is not connected, exit
298
305
  }
299
306
  if (grpaddr == null || value == null) {
300
- this.log.warn('You must supply both grpaddr and value!')
307
+ KnxLog.get().warn('You must supply both grpaddr and value!')
301
308
  return
302
309
  }
303
310
  if (!Buffer.isBuffer(value)) {
304
- this.log.warn('Value must be a buffer!')
311
+ KnxLog.get().warn('Value must be a buffer!')
305
312
  return
306
313
  }
307
314
  // outbound request onto the state machine
@@ -319,7 +326,6 @@ const writeRaw = function (grpaddr, value, bitlength, callback) {
319
326
  // you can pass a callback function which gets bound to the RESPONSE datagram event
320
327
  const read = function (grpaddr, callback) {
321
328
  if (this.useTunneling && this.isTunnelConnected === false) {
322
- // console.log("BANANA exit FSM.prototype.write Tunnel down");
323
329
  return; // 02/10/2020 Supergiovane: if in tunnel mode and is not connected, exit
324
330
  }
325
331
 
@@ -366,11 +372,16 @@ const read = function (grpaddr, callback) {
366
372
  const Disconnect = function (/* cb */) {
367
373
  this.transition('disconnecting');
368
374
  //console.log("BANANA Logger distrutto");
375
+ try {
376
+ //KnxLog.get().info('Socket disconnected.');
377
+ //console.log("BANANA Socket disconnected.")
378
+ //this.socket.disconnect();
379
+ } catch (error) {
380
+ //console.log("BANANA ORRORE Socket disconnected.",error)
381
+ }
369
382
  try {
370
383
  KnxLog.destroy(); // 16/08/2020 Force reinstantiation of the logger to refresh the settings.
371
384
  } catch (error) { }
372
- // machina.js removeAllListeners equivalent:
373
- // this.off();
374
385
  }
375
386
 
376
387
  // return a descriptor for this datagram (TUNNELING_REQUEST_L_Data.ind)
@@ -430,7 +441,7 @@ const Connection = function (options) {
430
441
  if (typeof options.handlers === 'object') {
431
442
  Object.keys(options.handlers).forEach(function (key) {
432
443
  if (typeof options.handlers[key] === 'function') {
433
- conn.on(key, options.handlers[key])
444
+ conn.on(key, options.handlers[key]);
434
445
  }
435
446
  })
436
447
  }