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

Proxy not relaying some packages

Hello, we need some help debugging a proxy node in a BLE mesh network.


First some information about our experiment - we currently have 5 nodes running a custom fw on a nrf52832 with S132 soft device. These nodes are all provisioned to work in a mesh network. We have a custom Android App that connects to a proxy node . The app sends a message to all nodes using the 0xFFFF address. Inside this message there is a parameter that tells a node to reply with a message. When the desired node obtains the broadcast message it waits some ms before sending a message back to the phone. When the phone receives the message from the node it requested it from, it repeats this process. This interaction happens 10 to 20 times very fast.


The issue we're facing is that sometimes (maybe 1% of the time) the phone does not receive the message back.


To debug this problem we've set up an experiment where we don't use a phone (therefore not relying on the proxy model to relay the phone messages). We implemented a fw on one of the nodes that acts as if it was the phone, sending a message, waiting to receive the message and the sending another one. In this test there wasn't any problems. All the messages that were sent as broadcast singling out a node, were answered with a message from the corresponding node. After this test, we can confirm that the issue is not a packet lost in the mesh network.


So we went back to the first experiment with the phone joining the network using a proxy node. 
To debug this issue we're hooking up two nodes to the debugger, one of these is the proxy node. We're making both nodes print information of the messages they relay(Source, Destination, TID). What we're seeing with this experiment is that when a message response fails, the proxy says it relayed the broadcast message but neither the node that we're debugging or the node that the message was intended to, receive the message. What we believe is happening is that the proxy node is not relaying the message that comes from the phone in to the mesh network.


We've delved into the code and added multiple prints in core_tx.c, core_tx_adv.c, transport.c, advertiser.c, proxy.c, packet_buffer.c to try and see if when the message fails we can see why it failed, but we have no conclusive evidence of what's happening.


Our next experiment is hooking up a nrf52840 dongle as a sniffer to try and see if the packet is really being sent to the mesh network or not. So when we get done with that we'll share those result, but in the mean time, can you guys point us in the right direction to try and fix this? Thanks!

The setup is as follows:

  • nRF5_SDK_15.3.0_59ac345
  • nrf5_SDK_for_Mesh_v3.2.0
  • s132_nrf52_6.1.1_softdevice
Parents
  • Hi,

    This interaction happens 10 to 20 times very fast.

    Could it be that you are sending too fast? Have you tried decreasing the the rate you are sending messages?

    Do you get any error codes when the message response fails?

  • Hi thanks for answering!
    Could it be that you are sending too fast?
    The way the experiment is done is like this: The phone sends a broadcast message with a parameter that singles out a node. When the node receives this message it waits some time and then it sends a message to the phone. When the phone receives the message it waits 100ms to send the next broadcast message. The phone times out after waiting one second for the response message and sends the next one. So between messages sent by the phone there should be at least 100ms, would that be considered too fast?
    Trying to debug this issue we played with 2 parameters MAX_CONN_INTERVAL and MIN_CONN_INTERVAL. We achieved the best results using:
    • MAX_CONN_INTERVAL =   MSEC_TO_UNITS(250, UNIT_1_25_MS)
    • MIN_CONN_INTERVAL =  MSEC_TO_UNITS(150, UNIT_1_25_MS)
    Those were the default parameters, but we changed them to achieve a faster communication with the phone. Setting these parameters to the default values made it so only a single message was not relayed into the network after sending 400 messages from the phone. We need to make sure all messages from the phone are relayed into the mesh network, so that we get responses from the nodes. Is there a way of making sure the proxy node actually relays the message from the phone into the network?

Reply
  • Hi thanks for answering!
    Could it be that you are sending too fast?
    The way the experiment is done is like this: The phone sends a broadcast message with a parameter that singles out a node. When the node receives this message it waits some time and then it sends a message to the phone. When the phone receives the message it waits 100ms to send the next broadcast message. The phone times out after waiting one second for the response message and sends the next one. So between messages sent by the phone there should be at least 100ms, would that be considered too fast?
    Trying to debug this issue we played with 2 parameters MAX_CONN_INTERVAL and MIN_CONN_INTERVAL. We achieved the best results using:
    • MAX_CONN_INTERVAL =   MSEC_TO_UNITS(250, UNIT_1_25_MS)
    • MIN_CONN_INTERVAL =  MSEC_TO_UNITS(150, UNIT_1_25_MS)
    Those were the default parameters, but we changed them to achieve a faster communication with the phone. Setting these parameters to the default values made it so only a single message was not relayed into the network after sending 400 messages from the phone. We need to make sure all messages from the phone are relayed into the mesh network, so that we get responses from the nodes. Is there a way of making sure the proxy node actually relays the message from the phone into the network?

Children
  • Hi,

    Tomas Arrivillaga said:
    So between messages sent by the phone there should be at least 100ms, would that be considered too fast?

    This isn't considered as too fast, but it depends on how much data you are trying to send. 

    Tomas Arrivillaga said:
    Is there a way of making sure the proxy node actually relays the message from the phone into the network?

    To make sure that the message is relayd you can try increasing the value of CORE_TX_REPEAT_RELAY_DEFAULT, this will increase the number of repeated transmissions of one relayed mesh packet.

Related