This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-CC3235SF: tcpecho example | could not open socket error

Part Number: LAUNCHXL-CC3235SF


Dear TI,

Running the tcpecho example, I couldn't send and receive anything using TCP protocol.

the module is connected rto my network:

Here is output log of the tcpSendReceive python file:

Best regards,

Brahim

  • Hi Brahim,

    Do you have Python 3.X installed? Also, does python have the needed privileges to open sockets on your network? Please double-check that on your PC.

    Also, you can try using another TCP packet tool on your PC instead of the provided script. I am personally using Packet Sender, and do not run into issues with the tcpecho example. I suggest you try using that tool and see if it works on your network.

    Regards,

    Michael

  • Hi Michael,

    It doesn't work with Packet sender neither.

    I had this problem of CONNECTION REFUSED with Network_terminal example and with AT_Command as well.

    Best Regards,

    Brahim

  • Hi Brahim,

    As I do not see this issue on my end, the cause of your error is most likely a networking issue. Have you tried using the example on another AP?

    These are the following debug steps I suggest you try, to isolate where the error could be:

    1. Try using a different AP, and seeing if the same issue remains

    2. Try using a different device to use as the TCP client, instead of the PC you're currently using.

    3. Try setting up the CC3235 to function in AP mode, and let your PC connect to its network rather than operating it in STA mode.

    Regards,

    Michael

  • HI Michael,

    I tried with different AP and nothing has changed. Here is what's happening:

    I using TCP Terminal app in my android cellphone to set it up as a server and use the CC3235 as a client then try to send data from CC3235 to my cellphone using TCP port 53000.

    It is working for the first data I send but when I try to send it again it doesn't work.

    AT+WlanConnect="myAP",,WPA_WPA2,"myPwd",,,
    OK
    +eventwlan:connect,Cyb2021,0xe0:0x63:0xda:0xbd:0x90:0xe3
    +eventnetapp:ipv4_acquired,192.168.20.142,192.168.20.254,192.168.20.2
    
    AT+Socket=INET,STREAM,TCP
    +socket:0
    OK
    
    AT+Connect=+Socket,INET,53000,192.168.20.197
    OK
    +connect:53000,192.168.20.197
    OK
    
    AT+Send=0,0,16,Echo_Test_Brahim
    OK
    
    AT+Send=0,0,16,EchoTest_Michael
    OK
    +eventsock:tx_failed,0,-107

    It seems that I always lost connection after sending the first message.

    I am sure this is not comming from my cellphone, I checked with Packet Sender in my Pc and it works:

    • Using my cellphone or my PC as a client and CC3235 as a server doesn't work at all, the connection is always refused.

    2) Could you please tell me what are the three IP adresses shown after execting AT+WlanConnect command, normally I should have only one ?

    3) Can I fix the IP adress to a specific one in my code ? if yes, where?

    4) is there any AT=Command to set up the cc3235 in AP mode?

    Thank for checking this Michael.

    Best Regards,

    Brahim

  • Hi Brahim,

    1. There shouldn't be an issue with the CC3235 operating as a TCP server, nor should it fail after one sl_Send with error -107. Can you please capture air sniffer logs of your network while performing the TCP tests? That will allow us to better pinpoint where the failure is occurring.

    2. The netapp event callback you get after acquiring an IP address will always return 3 addresses. These are the (1) the acquired IP address (2) The default gateway's IP address (3) The DNS server address

    3. Yes, there is an API to set a static IP address, using the sl_NetCfgSet() API. Please take a look at section 5.3.1 of the NWP programmer's guide. Equivalent AT command is AT+NetCfgSet, see documentation in section 6.6 of the AT command guide.

    4. Yes, there is the AT+WlanSetMode = AP command you can use.

    Regards,

    Michael

  • Hi Michael,

    Thank you for reply. it helps a lot.

    I changed the AP I am using and it works better, it maintains the connection as long as I am sending some data.

    Using CC32xx as a server and try to connect a client to it doesn't work at all. I will create a new thread in the futur about this issue as I don't need it now.

    Thank you !

    Best Regards,

    Brahim