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

Not getting BIRTH message into the SparkplugNet.Examples when a new publisher comes up on the broker #33

Closed
venkat9200 opened this issue Dec 2, 2022 · 4 comments
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@venkat9200
Copy link

Hi SeepPenner.
I'm using the SparkPlugNet samples and running RunVersionB() function.
Application class is able to receive the BIRTH messages from RunVersionBNode() for group1 and device 1.

On the same broker address I have another publisher publishing data at Group Name : "Group" and NodeName: "EdgeGateway" and devideName : "device_0"

When this publisher goes down Application class is able to receive the DEATH messages.
But when this publisher comes up application is NOT able to receive the BIRTH messages.

Could you please let me know if any changes need to be done inside the RunVersionBApplication() OR in RunVersionBNode().
I verified that the topic it is subscribing to is spBv1.0/# , but birth messages from another publisher is not able to detect.
Whereas MQTT.fx application is able to detect the BIRTH messages from the broker address.
I'm submitting this as an issue as I do not see a discussion board here , please don't for this.

Thanks in Advance
Venkat

@SeppPenner SeppPenner self-assigned this Dec 23, 2022
@SeppPenner SeppPenner added the bug Something isn't working label Dec 23, 2022
@SeppPenner
Copy link
Owner

Sounds strange, I need to investigate. Maybe a callback from MqttNet is not triggered properly...

@evonz-mx
Copy link

I'm having a similar problem with my spBv1.0 application, which will include both Node and Application components. My application gets death messages, but never gets birth or data messages. However, using debug logging on my broker shows that all the missed messages are delivered if I restart my application (but before the app is ready to receive messages, it seems). Third party applications like MQTT Explorer or MQTT.fx get all the messages in realtime.

I'm guessing that the problem is QoS: the SparkplugNet subscriptions are with QoS 1, but are never acked explicitly. I don't know if MQTTNet defaults autoack to true, but if not, that would explain my problem. I haven't tried implementing that in your code yet, but I figured I'd drop this note in case you get to it before I do. If I find success with this approach, I'll send a PR.

@evonz-mx
Copy link

Just a followup to my own comment in case anyone else hits similar issues: it doesn't look lke QoS is my issue. Instead, it looks like metric storage is throwing an exception since the devices are publishing metrics that haven't yet been seen. My application can't know all possible metrics ahead of time (it connects to unknown devices to allow users to select and log metrics), so I'm going to move towards building a mechanism to request a rebirth in this scenario, and allow "learning" metrics from birth messages.

@SeppPenner
Copy link
Owner

So, this seems to be the same issue as #43. The problem is that this is currently by design in version 2.2: #6 (comment). I will check version 3 compatibility today or tomorrow and check if some changes have been done there. Until then follow #43 for updates.

@SeppPenner SeppPenner added the duplicate This issue or pull request already exists label Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants