zwave-js-ui icon indicating copy to clipboard operation
zwave-js-ui copied to clipboard

Route direction in Zniffer appears to be backwards

Open kpine opened this issue 1 year ago • 5 comments

Checklist

  • [x] I am not using Home Assistant. Or: a developer has told me to come here.
  • [x] I have checked the troubleshooting section and my problem is not described there.
  • [x] I have read the changelog and my problem is not mentioned there.

Deploy method

PKG executable

Z-Wave JS UI version

9.29.1

ZwaveJS version

14.3.7

Describe the bug

In the Zniffer pane the route direction is backwards.

To Reproduce

Make a zniffer trace.

Expected behavior

The route direction is displayed correctly.

Additional context

Here's a screenshot with a Meter Report highlighted. The route direction indicates a message from the controller (1) to the end device (64). But in reality the node has sent the message, so the direction should be 1 ← 64 or 64 → 1.

Image

In comparison, the SiLabs Zniffer application indicates the source node as 64 and the destination as 1, without a Routed indication as it is direct.

kpine avatar Feb 03 '25 08:02 kpine

I think the issue here is that the arrow should always be like '→' because later we sort nodeIds starting from sender to receiver based on the direction. This is the method I use:

https://github.com/zwave-js/zwave-js-ui/blob/46a9edae554f5e5b33ab4a7d1d92a583d3e50567/src/lib/utils.js#L226-L272

So making const dir = '→' should fix the issue IMO. @AlCalzone any clue? Maybe SiLabs Zniffer uses a different approach?

robertsLando avatar Feb 03 '25 09:02 robertsLando

@kpine can you verify if only 0-hop routes have their direction wrong? The code above looks like they may. I'm not 100% sure what the intention was, but I think I wanted "request" frames to point right, and "response" frames to point left. However that logic conflicts with the conditional position of the source and destination in the route array.

AlCalzone avatar Feb 03 '25 19:02 AlCalzone

I think you are correct, I turned on a light switch remotely and here is the result:

Image

Set/Get and Report are in the correct direction, in this case the source is on the left side.

kpine avatar Feb 03 '25 19:02 kpine

Ok, I think this is purely a UI issue then. Let's keep both open until I've verified.

AlCalzone avatar Feb 03 '25 21:02 AlCalzone

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] avatar May 05 '25 00:05 github-actions[bot]