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

Sometimes MeshNetworkManager.proxyFilter.proxy does not get set when loading a previously configured network #627

Open
tylerjames opened this issue Nov 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tylerjames
Copy link

Where do you suspect the issue?

Issue in mesh library, e.g. packets being dropped

Version

4.2.0 (latest)

Describe the issue

I'm not sure exactly how to reproduce this but I found it when I needed to send a message to any connected node to be relayed to other nodes in the network.

I wanted to find a node that was connected and so I used MeshNetworkManager.proxyFilter.proxy and it worked fine. Except eventually it stopped working, and then sometimes would start working again.

I found that it was because sometimes but not always MeshNetworkManager.proxyFilter.proxy would be nil even though NetworkConnection.proxies contained several open bearers. I'm not sure why this is the case. It looks like sometimes the NetworkLayer.handle(proxyConfigurationPdu:) will sometimes fail to find a node here:

let proxyNode = meshNetwork.node(withAddress: proxyPdu.source)
networkManager.proxy?.handle(message, sentFrom: proxyNode)

And it will send nil and the the ProxyFilter.proxy gets set to nil

I'm thinking that maybe me using ProxyFilter.proxy in this way is not a reliable way to get a connected node. If that's the case what is a better way? I know I can see open bearers in NetworkConnection.proxies but I'm not sure how to associate them with the corresponding Node so that I can use one of the MeshNetworkManager.send() variants to send a message to the Node.

Any help would be appreciated.

Relevant log output

No response

@tylerjames tylerjames added the bug Something isn't working label Nov 20, 2024
@philips77
Copy link
Member

Hello,
Do you have all the possible proxy Nodes in your database? The spec says that it may be null if such address isn't found in the network.

/// The connected Proxy Node. This may be `nil` if the connected Node is unknown
/// to the provisioner, that is if a Node with the proxy Unicast Address was not found
/// in the local mesh network database. It is also `nil` if no proxy is connected.
public private(set) var proxy: Node?

Could you provide logs from Console app (filter with subsystem=com.nordicsemi.nRFProvision) or Xcode logs when it happens? I wonder what's going on there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants