Using sockets on bluetooth_ipv6_router / bluetooth_ipv6_node fails almost arbitrarily

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using sockets on bluetooth_ipv6_router / bluetooth_ipv6_node fails almost arbitrarily

1,217 Views
steffenjahnkepa
Contributor III

Hello,

I'm using the SDK_2.2_FRDM-KW41Z with the SDK-Examples wireless examples > bluetoth > ipv6_node and wireless examples > bluetoth > ipv6_router.

If I'm now try to use the socket application, which is implemented on the router and the node, it will fail sometimes. I've tested some possible reasons and couldn't find a reason for this, respectively I'm not able to go inside this functions. I found out, that if I'm trying to send  appoximately more than 35 bytes via the previously opened socket, the communication will fail and the sending node will die. This happens inside the function: App_SocketSendAsync() -> NWKU_SendMsg(App_SocketHandleSendAsync, pAppSockCmdParams, pmAppSockThreadMsgQueue); in app_socket.c

The node will not return from this function. But i really need to send this number of bytes via this socket. Is there anybody, that observed the same issue? Or someone @NXP, who can help me with this? It's really important and urgent for me?!

Thanks a lot!

Labels (2)
4 Replies

881 Views
mariush
NXP Employee
NXP Employee

Hi Steffen,

R&D team found the issue and fixed it. Until it will be available in a SDK, you can have the fix by updating in your project the file "shell_nwk_ip.c" (it can be found in your project-> source/common/nwk_ip/shell_ip/shell_nwk_ip.c)

Update the file by going at line 711 and replace existing code with code below until line 717.

/*************************************************/

            pAppSockCmdParams->sock32 = atoi((const char *)argv[2]);
            pAppSockCmdParams->dataLen = strlen((char const*)argv[3]) + 1; //null terminated

            pAppSockCmdParams->pData = MEM_BufferAlloc(pAppSockCmdParams->dataLen);
            if(NULL != pAppSockCmdParams->pData)
            {
              FLib_MemCpy(pAppSockCmdParams->pData,argv[3],pAppSockCmdParams->dataLen);‍‍‍‍‍‍‍‍‍

/*************************************************/

Let me know if it works.

Marius

0 Kudos

881 Views
steffenjahnkepa
Contributor III

Hi Marius,

Thanks for your Solution! Now i can transmit and receive 50 bytes via the sockets, which should be enough for me now, but if i try to transmit more than 50 bytes, the receiving node dies.

Thanks for your effort!

Best Regards,

Steffen

0 Kudos

881 Views
mariush
NXP Employee
NXP Employee

Hi Steffen,

Indeed there is an issue when trying to transmit more than 50 bytes, but it has to do with shell application not the packet itself. I have reproduce your issue and this is due to a limitation for shell commands to 64 bytes (including useful data). R&D will address this by either supporting larger commands or issuing an warning.

The node app is not dead, only the shell prompt is missing in this case. You can try writing a new "socket send command" or to use the previous one that worked. That will also bring back the prompt.

Regards,

Marius

881 Views
mariush
NXP Employee
NXP Employee

Hi Steffen,

I have made an analysis of this issue and contacted R&D team for a fix/workaround.

Regards,

Marius

0 Kudos