Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to handle NCMD Node Control/Rebirth properly #115

Open
tszpakowicz opened this issue Oct 18, 2024 · 0 comments
Open

Unable to handle NCMD Node Control/Rebirth properly #115

tszpakowicz opened this issue Oct 18, 2024 · 0 comments

Comments

@tszpakowicz
Copy link

tszpakowicz commented Oct 18, 2024

Hi,
According to Sparkplug specification (2.2 and 3.0, but 3.0 is much clearer and more explicit) an edge node must support Node Control/Rebirth.
After receiving the command it should:

  • stop sending any updates (NDATA, DBIRTH, DDATA...)
  • send NBIRTH which is consistent with its original NBIRTH for the connection (the same bdSeq, the same metrics definitions) but with up-to-date values
  • send DBIRTH for every active device which are consistent with each device's latest DBIRTH messages (the same metrics definitions) but with up-to-date values
  • it should not disconnect (at least not because of Node Control/Rebirth)
  • it must not send NDEATH (an edge node must disconnect after NDEATH which must be the last message in a session)
  • it must not update bdSeq (which should be only updated when making new edge node connection)

Generally it might be acceptable to end a session, disconnect, and connect again starting a new session. This would probably do the job of Rebirth for the requesting application. But it seems somewhat heavyweight. And it would trigger reset of the node and all devices info in all interested aplications.

This is not possible with the library at the moment.

  • It is not possible to publish NBIRTH by hand.
  • The Rebirth method available currently does not help:
    • it sends NDEATH without disconnecting. Accorting to spec there must be no activity in the session after NDEATH.
    • it wipes out KnownMetrics for the node
    • after NDEATH it sends NBIRTH reusing the same bdSeq but after NDEATH new bdSeq must be used. (It is also why after NDEATH the edge node must disconnect and connect again: to set up LWM with new bdSeq.)

It also seems that PublishNodeAndDeviceBirthsInternal, currently private, would do the job. But I have not got to testing this yet.

Using version: 1.3.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant