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

Heartbeat Message doesn't gets populated #469

Open
DevHachi opened this issue Feb 1, 2023 · 5 comments
Open

Heartbeat Message doesn't gets populated #469

DevHachi opened this issue Feb 1, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@DevHachi
Copy link

DevHachi commented Feb 1, 2023

I got a question. I got my device as far that I can publish the heartbeat to my local Node, aka the Smartphone, but can't have any callback or any option to get Informed from the library about the heartbeat.

To understand why i would like to have this, is that with the heartbeat I could detect really easy if a device is reachable or not.

Would appreciate if you could help me with this.

@philips77
Copy link
Member

Hello,
To set up Heartbeats you need to do the following:

  1. On the target Node set Heartbeat Publication, giving number of publications and interval, or an event. Set the destination to be the phone.
  2. On the Phone's node set Heartbeat subscription, setting the sender address to the Node's address and some timeout.
  3. You should be able to refresh and see the count there.

@DevHachi
Copy link
Author

DevHachi commented Feb 1, 2023

So far I do understand this, but as far as i understand pub sub, shouldn't it be that I don't have to do a refresh manually but get informed like when sending a GenericOnOffSetAcknowledged?

Cause like this i would have to start a async timer that that will check the subscription in given period if the device is still there.

But as you mention the heartbeat subscription I saw that it is a single object. What happens if u have multiple devices with heartbeat subscription to the local node?

@philips77
Copy link
Member

This is not supported by the spec. Spec allows a single publication and a single subscription. Yes, that's weird. I may add multi-subscription in our libraries and ignore the spec, as that would be much more useful. I remember I was thinking about it when writing heartbeats, but then I abandoned the idea, perhaps due to no time.

Regarding a callback for received heartbeats... don't you get the global callback with heartbeat messages? I need to look into the code again and check what's there.

@DevHachi
Copy link
Author

DevHachi commented Feb 1, 2023

The heartbeat messages are not populated through the MeshNetworkDelegate if u mean that. As far as I could follow the footstep through your library the heartbeat message only update the count of the subscription and thats it.

ok if the pub sub is suppose to work like that, then leave it for now as the spec says. I don't want to break that.

@philips77
Copy link
Member

I would not break it. It would add additional features on top of existing solution (without the need to subscribe the node to heartbeats, but using some new API instead).

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

No branches or pull requests

2 participants