This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending message from mesh device to phone through proxy node

Basically the same question as here:

https://devzone.nordicsemi.com/f/nordic-q-a/45557/getting-status-messages-from-mesh-to-phone

But the answer there doesn't really tell me what I need to do to make it work.

I want to send out a status message on Mesh Proxy Data Out (0x2ade) on every button click.

I am using the Mesh 4.1.0 SDK.

Thanks.

Parents
  • Hi Ferdi, 

    There is a term called proxy filter in Mesh. This can be either whitelist or blacklist. With whitelist the proxy node will forward to the phone any message that destinated to one of the addresses in the whitelist. With blacklist, the proxy node will forward to the phone all packets except for those come from the blacklist. 

    You can read more about that at section 6.6 in the Mesh spec. 

    The default behavior is that the phone and the proxy client first has an empty whitelist. Meaning the phone will not get any message forwarded by the proxy node. Only after the first packet from the phone to the node, then the phone unicast address will be added to the list. At this moment the proxy node will only forward messages that come to the unicast address of the phone. 
    If you want to have more addresses in the whitelist you can add more. It's the "Proxy Filter" button in the mesh app. 
    Note that you don't have to explicitly sending anything to "Mesh Proxy Data Out", it's automatically forwarded by the proxy node whenever it send or when it relay a message that has the destination address inside the whitelist (or not in the black list).

    So, in short, to send data to the phone, you need: 

    1) A packet from the phone to the proxy node, any kind of mesh packet. Can be a proxy filter set packet.

    2) Send data to the unicast address of the phone (usually 0x0001) as a normal mesh packet . 

  • The way I understand it (let's assume I just have one light server node):

    1. I send read request from nRF Mesh app to the connected light server proxy node.

    2. light server node replies via Mesh Proxy Data Out (0x2ade) and nRF Mesh app gets it (because the app is listening to notifications?)

    This all works.

    At this point the phone's address must be in the proxy node whitelist.

    So, now when I click button 1, the proxy node sends out a status message to the mesh network. But I don't see it doing any transmissions out via 'proxy.c' like it does after receiving the read request from the nRF Mesh app (I turned on LOG_SRC_BEARER logging).

    How do I get the proxy node to send out a status message not just to the mesh, but to Mesh Proxy Data Out as well when I click button 1? You make it sound like it should be doing this already?

    Thanks.

  • Have you set the publication address of the mesh server ? If you set the publication address to the address of the mesh app, then it will be updated via the Data Out characteristic. 


    Note that if you are not in the correct app interface you may not see the notification being updated on the app. You can verify this by either using a sniffer, or modify the mesh app to write all log, or use nRF Connect at the same time as the mesh app. 

  • Ah, I failed to add the group address to the whitelist on the proxy page in the app. I thought that since 0xFFFF 'All Nodes' was already in the whitelist that was enough.

    Thanks.

Reply Children
  • Hi,

    Is it possible to hard-code a whitelist group address so that it automatically gets forwarded to the phone without the phone having to add it first?

    Thanks.

  • Hi Ferdi, 
    It's should possible to do so but it's not defined by the spec and is not implemented in our code. You may need to look into the code where we add the group address to whitelist in config_packet_in_filter_addr_add(). 

    But I think it's easier if you implement the code on the opposite side, on the phone, instead. This way you don't need to modify your firmware to do something not defined (and maybe not suggested) in the spec. Especially when a 3rd party application connect to your device, it may not be compatible (it doesn't expect to receive the message to a group address). 

    You can implement the code in the app so that the command to send filter add PROXY_CONFIG_OPCODE_FILTER_ADDR_ADD automatically in the background so the user doesn't have add that manually. 

Related