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

Cannot establish TCP connection with nRF52840 and Linux Border Router

Hello there, I just try to demonstrate TCP examples in NRF5 SDK 15 and 16.

I got two linux boards, one of them Allwinner V3S with Debian Bullseye and the other one is Raspberry Pi 3.

On both of them I set up everything, which is radvd with following radvd.conf file;

interface bt0
{
    AdvSendAdvert on;
    prefix 2001:db8::/64
    {
        AdvOnLink off;
        AdvAutonomous on;
        AdvRouterAddr on;
    };
};

at /etc/sysctl.conf file ipv6 routing is enabled too. My bt0 interface shows up when I establish a connection, and I add 2001:db8::1/64 ipv6 address to it. At this stage, I can ping my nrf52 board via local and global ipv6 address. Than I add 2001:db9::1/64 address to my eth0 device and;

ip6tables -A FORWARD -i eth0 -o bt0 -j ACCEPT -d 2001:db8::/64
ip6tables -A FORWARD -i bt0 -o eth0 -j ACCEPT

make those settings for routing correctly.

From Windows side, which is my server, I set

netsh interface ipv6 add address Wi-Fi 2001:db9::2/64
netsh interface ipv6 add route 2001:db8::/64 Wi-Fi 2001:db9::1/64

those address and route commands. After all those, I can ping my nRF52 board from my windows.

PS C:\Windows\system32> ping -6 2001:db8::fa:edff:fe5c:bc04 -t

Pinging 2001:db8::fa:edff:fe5c:bc04 with 32 bytes of data:
Reply from 2001:db8::fa:edff:fe5c:bc04: time=237ms
Reply from 2001:db8::fa:edff:fe5c:bc04: time=133ms
Reply from 2001:db8::fa:edff:fe5c:bc04: time=127ms
Reply from 2001:db8::fa:edff:fe5c:bc04: time=121ms
Reply from 2001:db8::fa:edff:fe5c:bc04: time=216ms

After that, I just try to listen specified port in the nrf52 side. By the way, in sdk_config.h file, 6LOWPAN_LEGACY = 0 as it should be set 0. (Kernel > 5)

static const ip6_addr_t                     m_remote_addr =
{
    .addr =
    {HTONL(0x20010DB9),
    0x00000000,
    0x00000000,
    HTONL(0x00000002)}

After that, on windows side, I just try to listen port 9000, which is correctly defined in nrf52 code via ncat, but nrf52 board cannot connect and send any data. LED2 is lit after successfull connection, but LED3 never lit. The surprising thing is, I just succeed connecting approximately 3 mounts ago. Is there any point that I am missing?

Sincelery.

  • Hi Berkay_V,

    I need to set up the environment to verify this issue. This could be caused by software or hardware incompatibility. Before this, I do have some suggestions for you. 

    Do you have any special reason to use this old Immature experimental example? The latest solution for IP-based IoT device networks is OpenThread. The OpenThread examples on NCS will reach the production level this year. You will get more support based on the latest solution. If you are not clear with your need, please connect and talk with our regional sales manager first. You can find your RSM from Contact us - nordicsemi.com.

    Best regards,

    Charlie

  • Hi Berkay_V,

    I am not able to fully repeat your setup since my router doesn't support ipv6, but I have some suggestion may help:

    1. Did you try to ping your server from btx port? There might be some forward rules issue.

    2. Check your windows firmware setup. Port 9000 might be blocked for security concerns.

    Best regards,

    Charlie

Related