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

NRF Mesh - Smartphone as Sniffer

Hi,

Let's say I have a network with 5 NRF52833-DK and 1 smartphone with the NRFMesh App. How can I achieve to sniff all the ongoing packets in the mesh network on the smartphone?

My first idea was to use gatt_mesh.c, where every node can send data to all it's GATT connection, but there I need a wrapper for the network key to create a correct network PDU and I did not find out how this can be done correctly this way.

How can I achieve this? 

Kind Regards,

SET

  • Hi Sebastian, 

    As stated in the spec, the proxy server will forward to the proxy (client) all message unless there is a proxy filtering. 

    I'm not sure I understand what you meant by "My first idea was to use gatt_mesh.c, where every node can send data to all it's GATT connection" 

    The Proxy node should forward all messages it receives. 

    What you need to do is to modify the nRF Mesh app to print out any message on GATT. 

  • Hi Hung,

    I don't see any Network PDUs when the mesh nodes communicated with each other, so somehow there seems to be a proxy filter. I'm using the light switch server examples. 

    Where can I adjust the filter addresses, I cannot find any in the proxy headers?

    In proxy.c exists the following event callback, that is called when a Mesh message is ongoing, but It wont sent to a GATT connection:

    static void mesh_evt_handle(const nrf_mesh_evt_t * p_evt)
    {
        /* According to Section 6.6 in the Mesh Profile Specification v1.0, we should forward all
         * beacons with new values for IV index or flags. We'll maintain a small cache of previous beacons
         * to enforce this by best effort.
         */
        if (p_evt->type == NRF_MESH_EVT_NET_BEACON_RECEIVED)
        {
            if (p_evt->params.net_beacon.p_rx_metadata->source != NRF_MESH_RX_SOURCE_GATT &&
                !cache_has_elem(&m_beacon_cache, p_evt->params.net_beacon.p_auth_value))
            {
                if (beacon_packet_send_to_all(p_evt->params.net_beacon.p_beacon_secmat,
                                                p_evt->params.net_beacon.iv_index,
                                                p_evt->params.net_beacon.flags.iv_update,
                                                p_evt->params.net_beacon.flags.key_refresh) == NRF_SUCCESS)
                {
                    cache_put(&m_beacon_cache, p_evt->params.net_beacon.p_auth_value);
                }
            }
        }
    }

    Kind Regards,

    SET

  • OK, I got it, the proxy filter was indeed set wrongly.

Related