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.

CC3100MOD: UDP: module stop receive udp packet after disconnect and reconnect

Part Number: CC3100MOD
Other Parts Discussed in Thread: CC3100

Hi Guys,

Our application use a TCP socket and a UDP socket. Now we are doing reconnect test: in case of wifi disconnect, when module disconnect form router, firmware start reconect procedure.

With TCP the new socket work without problem,
With UDP socket we have a problem. That socket can send without problems, but after a close and reopend (due a forced disconnect) the we can send but we cannot receive

Note that we  use sl_Selct to check if received data are avaible,

Giuseppe Monteleone

  • Hi Guiseppe,

    How are you setting up the UDP socket? I'm trying to think through your situation, and a more detailed description of how you are using your UDP socket would be appreciated.

    Are you following the steps laid out in the udp_socket SDK example, where you create the socket, bind it to your UDP address, and then close the socket and repeate those steps when you get a disconnection event?

    Regards,
    Michael
  • Hi Mike,

    our scenario is following:

    1 ) connect TCP and UDP to server and establish comunication, Actually we don use UDP server, simply we receive from server (Ip address/port). At system start all goes well.
    2) we force disconnection (we power off router, for example). We close all socket
    3) when system reconnect to router (we power on router and CC3100 see our SSID again and connect to it), our recovery procedure reopen all socket (TCP and UDP). In this case we cannot receive with sl_RecvFrom.

    Best Regards
    Giuseppe Monteleone
  • Hi Giuseppe,

    When you reopen the UDP socket, do you get any error codes at any point or are the return codes normal?

    Did you remember to use sl_Bind() to bind the reopened UDP socket to your server address?

    What happens when you use sl_RecvFrom() to get data from the socket? Do you get an error, or does it simply block forever as it waits for data it should have received from the server?

    Regards,
    Michael
  • Hi Michael,

    I done some test with sl_Bind (thanks good idea). When i reopen the UDP socket after a reinit the sl_Bind return me an error : SL_ERROR_PM_POLICY_INVALID_OPTION.
    In this thread e2e.ti.com/.../609111 Charles suggest to set power management policy.

    Today i'll test reinit with following configuration:

    1) before open ani socket in reinit i set PM_POLICY normal,
    2) Open socket (UDP od TCP)
    3) In case of UDP socket call sl_Bint to connect socket to local address client

    Regards
    Giuseppe Monteleone