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

TCP connection cannot be established for a long time (about 4.5 hours) through BLE IPv6

Hi everybody

I use the nrf52 SDK (nrf5_SDK_15.2.0) to develop the IoT application of BLE. The IoT device acts as the TCP server and the BLE gateway acts as the TCP client. The BLE gateway connects the IoT device periodically and disconnects after obtaining datas.

The program of TCP server is modified by the example/IoT/TCP/server in SDK. TCP client is implemented in Linux system with reference to IoT user guide. Different from the above example, link local address is used for IPv6 address, because the connection is only in the local area network.

Occasionally, I find that the gateway and IoT device cannot establish a TCP connection for a long time, and it will recover automatically after about 4.5 hours. By printing log during the period when the connection cannot be established, the BLE connection and IPv6 interface are established normally, but the IoT device has never received IPv6 NS (neighbor solicitation) message from the gateway, untill TCP connection timeout. Further more, the log is printed at the every abnormal returns of the NS message receiving path. It is found that no log is printed during the connection cannot be established. It can be inferred that the SoftDevice does not return any message to the application layer during the connection cannot be established.

The above problem may be improved by adding debug log output in the application layer and slightly changing the processing sequence.

If anyone else has found similar problem and who can tell me how to further investigate or solve this problem.

Best regards!

Parents
  • Hi,

    OK, I've learned that the response time will be longer during Christmas. I hope there will be some progress after the holiday in January.

  • Hi,

    It looks to me like the nRF is connectable, but the RPi does not connect for some reason. What is the state of the RPi? Do you have logs from there? Since this is where the problem is, I suspect here is where you need to look.

  • Hi

    There are some the RPi logs as follows.

    The BLE CC OK means BLE PHY connected and IPv6 interface established. The NW CC NG means TCP connection is failed.  The BT interface status is printed during  The NW CC NG. One more retry after NW CC NG. Unfortunately, we don't see any effective information from the above logs.

Reply
  • Hi

    There are some the RPi logs as follows.

    The BLE CC OK means BLE PHY connected and IPv6 interface established. The NW CC NG means TCP connection is failed.  The BT interface status is printed during  The NW CC NG. One more retry after NW CC NG. Unfortunately, we don't see any effective information from the above logs.

Children