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

MESH Proxy client

Hi,

I need to develop a proxy client using the Nordic SDK, running a central device role using the nRF52840. The central device will connect to already provisioned nodes using GATT (node code is derived from your light switch examples). Optionally will also act as a provisioner for these nodes, either PB-ADV or PB-GATT.

A requirement is to have several simultaneous connections with separate peripheral nodes running the proxy server service.

Is there any example of how to configure the proxy client on the central device. Or some guidelines or documentation?

NOTE: I can't just go for Mesh communication since the same peripheral nodes need to be communicating with a Smartphone (not at the same time though).

  • Hi,

    thank you for the info so far.

    I'm trying to implement the client proxy deriving from the server-proxy example, and what I did so far is:

    (device is provisioned beforehand)

    1. connect to the device

    2. do a db discovery of services for the service 0x1828

    3. subscribe to notifications on the TX characteristic

    I'm able to get the data sent by the proxy server node in the on_hvx event handler.

    NOTE the node sends the data using the mesh_gatt_packet_alloc and mesh_gatt_packet_send functions, and for sending the data a new  mesh_gatt_pdu_type_t enum is defined and inserted before the MESH_GATT_PDU_TYPE_PROHIBITED value. This is the approach the node uses to send the data (I have no control over that).

    I'm however not sure how to implement the sending from the client (central) to the server (node). Any suggestions on this? Is the overall procedure correct, for what I want to accomplish, or you suggest a different approach?

  • Hi Ales, 

    To send data from the client to the server you would need to use write command instead of using notification (sd_ble_gatts_hvx).

    Could you explain the new mesh_gatt_pdu_type_t  you added ? I thought it should be fine with MESH_GATT_PDU_TYPE_NETWORK_PDU ? 

    I would suggest to have a look into the Android/iOS app to have an idea of how this should work. You can also capture a sniffer trace when the phone connect to a proxy to see what should be sent over the air. 

  • Hi,

    I must admit MESH is new to me, so I'm just realizing the implications of it.

    Please correct me if I'm wrong.
    From my current understanding, the proxy feature should encapsulate MESH packets in an encrypted form (calls to net_packet_encrypt in the proxy code) using the assigned network encryption key. Is that correct?

    This approach using a new mesh_gatt_pdu_type_t and filtering packets at this level circumvents the proxy protocol and is a totally different approach.

    I will have a look at Android code for any hint, but as mentioned what is implemented here, is from my understanding, not strictly a mesh proxy.

  • This is new to me as well :) 

    Could you explain what you meant by " as mentioned what is implemented here, is from my understanding, not strictly a mesh proxy." You meant which implementation ? 

    I found a good material that you can have a look. Please follow the link here

    The data should be encrypted using network key , correct! It should also be encrypted with application key. 

Related