smithtek-mako-rf 3.4.1 → 3.5.1

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.
@@ -386,6 +386,7 @@ function toNum(v, fallback) {
386
386
  const code = err.code || (err.modbusCode ? 'MODBUS_EXCEPTION_'+err.modbusCode : 'ECOMM');
387
387
  const message = String(err.message || err);
388
388
  const labels = {ECONFIG:'Configuration error',EDECODE:'Decode error',EQUEUEFULL:'Queue full',
389
+ EBUSRESET:'Bus queue reset',EBUSRECOVERING:'Bus recovering',EBUSRECOVERYFAILED:'Bus recovery failed',
389
390
  EQUEUEEXPIRED:'Queue expired',EOFFLINE:'Offline',EPORTBUSY:'Port busy',ECLOSE:'Serial close failure',
390
391
  EDISCONNECT:'Serial disconnected',EIO:'Serial error',ENOENT:'Serial port unavailable',EACCES:'Serial permission denied'};
391
392
  let reason = labels[code];
@@ -405,6 +406,9 @@ function toNum(v, fallback) {
405
406
  'Configuration error':'Setup error — check node settings',
406
407
  'Decode error':'Data format error — check register map/scaling',
407
408
  'Queue full':'Polling overloaded — reduce polling rate',
409
+ 'Bus queue reset':'Requests cancelled — reduce polling rate; verify any write before repeating',
410
+ 'Bus recovering':'Connection restarting — wait before sending new requests',
411
+ 'Bus recovery failed':'Recovery stopped — check connection and redeploy',
408
412
  'Queue expired':'Polling delayed — reduce polling rate',
409
413
  'Offline':'Polling paused — check device availability',
410
414
  'Port busy':'Bus in use — check duplicate bus settings',
@@ -453,6 +457,7 @@ function toNum(v, fallback) {
453
457
  msg.modbus.error = fault.message;
454
458
  msg.modbus.code = fault.code;
455
459
  msg.modbus.fault = fault;
460
+ msg.modbus.writeMayHaveApplied = !!failure.writeMayHaveApplied;
456
461
  msg.payload = {[fault.key]:1};
457
462
  node.status({fill:failure.code === 'EOFFLINE' ? 'yellow' : 'red',shape:'ring',text:fault.message});
458
463
  } else {
@@ -463,7 +468,7 @@ function toNum(v, fallback) {
463
468
  // Cloud output always carries either decoded data or the friendly alarm.
464
469
  // The second output contains a separate technical error payload.
465
470
  const debugMsg = failure ? Object.assign({}, msg, {
466
- payload: {ok:false,error:msg.modbus.error,code:msg.modbus.code,req},
471
+ payload: {ok:false,error:msg.modbus.error,code:msg.modbus.code,req,writeMayHaveApplied:msg.modbus.writeMayHaveApplied},
467
472
  modbus: Object.assign({}, msg.modbus)
468
473
  }) : null;
469
474
  send([msg, debugMsg]);
@@ -483,7 +488,7 @@ function toNum(v, fallback) {
483
488
  engine.enqueue(state,{node,req,complete,after: async () => {
484
489
  if(cfg.appendRssi && cfg.serialPort === '/dev/ttyAMA2' && req.mode === 'read') {
485
490
  try {msg._makoRssi = await engine.rssi(state,buildRssiCommandBuffer,tryParseRssiAck);}
486
- catch(e){if(e.code === 'ECANCELLED')throw e;msg.rssi_error=e.message;}
491
+ catch(e){if(['ECANCELLED','EBUSRESET','EBUSRECOVERING','EBUSRECOVERYFAILED'].includes(e.code))throw e;msg.rssi_error=e.message;}
487
492
  }
488
493
  }});
489
494
  }catch(err){if(!err.code) err.code='ECONFIG';complete(err);}
package/icons/1.png DELETED
Binary file
package/icons/2.png DELETED
Binary file
Binary file