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.

Get Time Example Program Connection to AP failed

Other Parts Discussed in Thread: CC3200

Hi,

   I am using Rev 3.2 CC3200 LP, CC3200 SDK 1.1.0, latest Service Pack and CCS V6.1.0. I am getting this error at Get Time Example Program below. At wlan station example program I tested it successfully, so I am sure I am able to connect to internet. Before I was able to test Get Time Example Program with older version of CC3200 SDK without problems. What changes should I make for the Get Time work without errors?

I also tested the hibernation example program and got the same error.

Tera Term Log:

Host Driver Version: 1.0.0.10
Build Version 2.0.7.12.31.0.0.4.5.1.5.3.20
Device is configured in default state
Device started as STATION
[WLAN EVENT] STA Connected to the AP: jefwifi ,BSSID: 0:26:75:91:6a:67
[NETAPP EVENT] IP Acquired: IP=192.168.254.100 , Gateway=192.168.254.254
Connection established w/ AP and IP is aquired
Pinging...!
Device pinged both the gateway and the external host
WLAN STATION example executed successfully

*************************************************
CC3200 Get Time Application
*************************************************

GET_TIME: Test Begin
Host Driver Version: 1.0.0.10
Build Version 2.0.7.12.31.0.0.4.5.1.5.3.20
Device is configured in default state
Started SimpleLink Device: STA Mode
[WLAN EVENT] STA Connected to the AP: jefwifi , BSSID: 0:26:75:91:6a:67
[NETAPP EVENT] IP acquired by the device

Device has connected to jefwifi
Error [-412] at line [1112] in function [Network_IF_IpConfigGet]
Error [-412] at line [1036] in function [Network_IF_ConnectAP]
Connection to an AP failed

I debug step the Get Time example program at CCS and there is a negative return value at the code line below which is called within Network_IF_ConnectAP()

//
// Get IP address
//
lRetVal = Network_IF_IpConfigGet(&ulIP,&ulSubMask,&ulDefGateway,&ulDns);
ASSERT_ON_ERROR(lRetVal)

- kel

  • Hi Kel,

    You are using old version of service pack. request you to update the service and try.

    Regards,
    Ankur
  • Hi Ankur,

        I downloaded the Service Pack from this link below. Service Pack Version Date March 12, 2015

       

        I got the same errors. Comparing the log from Tera Term from my first post the build version is now 2.4.7.2.31.1.3.4.1.1.5.3.34. Should I try the Beta version? I first formatted my CC3200 LP with XCC3200HZ MCU and then program the service pack, then run the program at CCS. 

    Tera Term Log:

                    *************************************************

                              CC3200 WLAN STATION Application

                    *************************************************

    Host Driver Version: 1.0.0.10

    Build Version 2.4.7.2.31.1.3.4.1.1.5.3.34

    Device is configured in default state

    Device started as STATION

    [WLAN EVENT] STA Connected to the AP: jefwifi ,BSSID: 0:26:75:91:6a:67

    [NETAPP EVENT] IP Acquired: IP=192.168.254.100 , Gateway=192.168.254.254

    Connection established w/ AP and IP is aquired

    Pinging...!

    Device pinged both the gateway and the external host

    WLAN STATION example executed successfully

                    *************************************************

                         CC3200 Get Time Application

                    *************************************************

    GET_TIME: Test Begin

    Host Driver Version: 1.0.0.10

    Build Version 2.4.7.2.31.1.3.4.1.1.5.3.34

    Device is configured in default state

    Started SimpleLink Device: STA Mode

    [WLAN EVENT] STA Connected to the AP: jefwifi , BSSID: 0:26:75:91:6a:67

    [NETAPP EVENT] IP acquired by the device

    Device has connected to jefwifi

    Error [-412] at line [1112] in function [Network_IF_IpConfigGet]

    Error [-412] at line [1036] in function [Network_IF_ConnectAP]

    Connection to an AP failed

    - kel

  • - From the Release Notes link below, I should not encounter any problem because I am using XCC3200HZ MCU

    processors.wiki.ti.com/.../CC32xx_Release_Notes

    - kel
  • - httpserver example program works. So, it seems this error only happens when the program uses Network_IF_XXXX API's.

    Just additional info, at common.h, I set WPA for Security Type as per my wifi router settings.

    #define SECURITY_TYPE       SL_SEC_TYPE_WPA/* Security type (OPEN or WEP or WPA*/

    - kel

  • Hi Kel,

    In file 'network_if.c' in function "Network_IF_ConnectAP" just before calling "Network_IF_IpConfigGet()" can you print the value of 'g_ulStatus'.

    Also request you to try running 'get_weather' or 'email' example.

    Regards,
    Ankur
  • Ankur1 (3494968) - 

    g_ulStatus = 10

    The -409 return is from sl_NetCfgGet()

    Network_IF_IpConfigGet(unsigned long *pulIP, unsigned long *pulSubnetMask,
    unsigned long *pulDefaultGateway, unsigned long *pulDNSServer)
    {
    unsigned char isDhcp;
    unsigned char len = sizeof(SlNetCfgIpV4Args_t);
    long lRetVal = -1;
    SlNetCfgIpV4Args_t ipV4 = {0};

    lRetVal = sl_NetCfgGet(SL_IPV4_STA_P2P_CL_GET_INFO,&isDhcp,&len,
    (unsigned char *)&ipV4);
    ASSERT_ON_ERROR(lRetVal);

    Tera Term Logs for Get Time, Get Weather, Email example programs from CC3200 SDK 1.1.0


    *************************************************
    CC3200 Get Time Application
    *************************************************

    GET_TIME: Test Begin
    Host Driver Version: 1.0.0.10
    Build Version 2.4.7.2.31.1.3.4.1.1.5.3.34
    Device is configured in default state
    Started SimpleLink Device: STA Mode
    [WLAN EVENT] STA Connected to the AP: jefwifi , BSSID: 0:26:75:91:6a:67
    [NETAPP EVENT] IP acquired by the device

    Device has connected to jefwifi
    Error [-409] at line [1112] in function [Network_IF_IpConfigGet]
    Error [-409] at line [1036] in function [Network_IF_ConnectAP]
    Connection to an AP failed


    *************************************************
    CC3200 Get Weather Application
    *************************************************

    GET_WEATHER: Test Begin
    Host Driver Version: 1.0.0.10
    Build Version 2.4.7.2.31.1.3.4.1.1.5.3.34
    Device is configured in default state
    Started SimpleLink Device: STA Mode
    [WLAN EVENT] STA Connected to the AP: jefwifi , BSSID: 0:26:75:91:6a:67
    [NETAPP EVENT] IP acquired by the device

    Device has connected to jefwifi
    Error [-409] at line [1112] in function [Network_IF_IpConfigGet]
    Error [-409] at line [1036] in function [Network_IF_ConnectAP]
    Connection to an AP failed

    *************************************************
    CC3200 Email Application
    *************************************************


    Command Usage
    -------------

    01 - Connect to Preconfigured AP
    03,<to>,<subject>
    - Write Recipient Emailaddress(e.g abc@xyz.com) and Subject
    04,<message>
    - Write Content of the Email
    05 - Send Email
    06 - Connect to AP Using Smart Config

    Parameters
    ----------

    to - Recipient Email Address (e.g abc@xyz.com)
    subject - Subject of the Email
    message - Content of Email Message
    -------------------------------------------------------------------------

    Host Driver Version: 1.0.0.10
    Build Version 2.4.7.2.31.1.3.4.1.1.5.3.34
    Device is configured in default state
    Started SimpleLink Device: STA Mode
    Cmd#01
    [WLAN EVENT] STA Connected to the AP: jefwifi , BSSID: 0:26:75:91:6a:67
    [NETAPP EVENT] IP acquired by the device

    Device has connected to jefwifi
    Error [-409] at line [1112] in function [Network_IF_IpConfigGet]
    Error [-409] at line [1036] in function [Network_IF_ConnectAP]
    Error: -409 Connecting to an AP.Failed to parse the command.

    - Markel

     - This is the post that I was mentioning about at my Twitter message to you.

  • - When I first got my Rev 3.2 CC3200 LP, I have tested most example programs at CC3200 SDK 0.5.2, including Email Example Program. I even made a blog post about the Email Example Program.

    - kel
  • Ankur1 (3494968) - If I use the Service Pack Beta Version, I only get this output at Tera Term.

    Tera Term output using Service Pack Beta Version:

                    *************************************************

                         CC3200 Get Time Application

                    *************************************************

    GET_TIME: Test Begin

    - Markel

  • Hi Kel,

    Just to confirm have you modified anything in the host driver or SDK example project?

    The error codes (-409 and -412) are not related to the API you are using. I am checking this error internally with team and get back.

    In the mean time can you please comment the call to function "sl_NetCfgGet()" in "Network_IF_IpConfigGet()" and test again.

    Regards,
    Ankur
  •  - No, I have not modified the CC3200 SDK example projects. This is what I did recently.

    1. Downloaded and Installed latest CC3200 SDK 1.1.0. My Service Pack is Version 1.0.0.1.0 
    2. Deleted CCS folder installation and installed CCS 6.1.0 using offline installers.
    3. Followed CC3200 Getting Started Guide.
    4. Tested httpserver successfully.
    5. Tested Parse quickstart example program successfully.
    6. Tested blinky example program.
    7. Error with hibernate
    8. Error with Get Time - This is when I made this post
    9. Downloaded and program March 12, 2015 Service Pack Release
    10. Error with Get Time
    11. Error with Get Weather
    12. Error with Email.

    Later I will download fresh copy of CC3200 SDK 1.1.0, turn off antivirus and install. I will check, if I get the same error message.

    - kel

  • @Ankur1 - I commented out these lines at network_if.c

    //
    // Get IP address
    //
    //lRetVal = Network_IF_IpConfigGet(&ulIP,&ulSubMask,&ulDefGateway,&ulDns);
    //ASSERT_ON_ERROR(lRetVal);

    //
    // Send the information
    //
    //UART_PRINT("Device IP Address is %d.%d.%d.%d \n\r\n\r",
    // SL_IPV4_BYTE(ulIP, 3),SL_IPV4_BYTE(ulIP, 2),
    // SL_IPV4_BYTE(ulIP, 1),SL_IPV4_BYTE(ulIP, 0));

    I got this output at TeraTerm. Somehow the Get Time was almost successful. So I guess there is something wrong with Network_IF_XXXX API's. I think you can duplicate this if you have the same setup as mine.

    Tera Term Log:

    *************************************************
    CC3200 Get Time Application
    *************************************************



    GET_TIME: Test Begin
    Host Driver Version: 1.0.0.10
    Build Version 2.0.7.12.31.0.0.4.5.1.5.3.20
    Device is configured in default state
    Started SimpleLink Device: STA Mode
    [WLAN EVENT] STA Connected to the AP: jefwifi , BSSID: 0:26:75:91:6a:67
    [NETAPP EVENT] IP acquired by the device

    Device has connected to jefwifi
    Socket created
    Error [-159] at line [1141] in function [Network_IF_GetHostIP]
    DNS lookup failed.
    Socket closed
    SL Disconnect...
    [WLAN EVENT]Device disconnected from the AP: jefwifi, BSSID: 0:26:75:91:6a:67 on application's request
    GET_TIME: Test Complete

    - Markel
  • Hi Kel,

    -159 Error in above case corresponds to no response fro DNS querry.
    Does the network with which device is connected to has internet access?

    Regarding the initial error with ' sl_NetCfgGet()' API:
    - Can you please revert the initial changes in 'network_if.c' and make following changes.
    in file 'network_if.c'
    @ line 1108
    SlNetCfgIpV4Args_t ipV4 = {0};
    lRetVal = sl_NetCfgGet(SL_IPV4_STA_P2P_CL_GET_INFO,&isDhcp,&len,
    (unsigned char *)&ipV4);
    //ASSERT_ON_ERROR(lRetVal);
    lRetVal = 0;

    *pulIP=ipV4.ipV4;
    *pulSubnetMask=ipV4.ipV4Mask;
    *pulDefaultGateway=ipV4.ipV4Gateway;
    *pulDefaultGateway=ipV4.ipV4DnsServer;

    Regards,
    Ankur
  • Hi Ankur,

    The CC3200 LP is connected to a network that has internet access. I have mentioned here that I was able to test wlan station example program successfully. Here is the tera term output with the modifications you requested.

    Tera Term output:




    *************************************************
    CC3200 Get Time Application
    *************************************************



    GET_TIME: Test Begin
    Host Driver Version: 1.0.0.10
    Build Version 2.0.7.12.31.0.0.4.5.1.5.3.20
    Device is configured in default state
    Started SimpleLink Device: STA Mode
    [WLAN EVENT] STA Connected to the AP: jefwifi , BSSID: 0:26:75:91:6a:67
    [NETAPP EVENT] IP acquired by the device

    Device has connected to jefwifi
    Device IP Address is 192.168.254.102

    Socket created
    Error [-159] at line [1153] in function [Network_IF_GetHostIP]
    DNS lookup failed.
    Socket closed
    SL Disconnect...
    [WLAN EVENT]Device disconnected from the AP: jefwifi, BSSID: 0:26:75:91:6a:67 on application's request
    GET_TIME: Test Complete

    - kel
  • Can you please confirm if the printed value "192.168.254.102" is indeed the IP acquired by the device. Also request you to put a breakpoint and confirm the gateway IP filled by API 'sl_NetCfgGet()' is correct.

    For DNS loopup failed error, can you try changing the SNTP server in the application?

    Regards,
    Ankur
  • Hi Ankur,

    I am able to ping 192.168.254.102. The ipV4.ipV4Gateway is 0xC0A8FEFE.

    I change the SNTP server and now able to Get Time. This happens with the modifications you suggested. If original code, I get the error.

    Tera Term Log:




    *************************************************
    CC3200 Get Time Application
    *************************************************



    GET_TIME: Test Begin
    Host Driver Version: 1.0.0.10
    Build Version 2.0.7.12.31.0.0.4.5.1.5.3.20
    Device is configured in default state
    Started SimpleLink Device: STA Mode
    [WLAN EVENT] STA Connected to the AP: jefwifi , BSSID: 0:26:75:91:6a:67
    [NETAPP EVENT] IP acquired by the device

    Device has connected to jefwifi
    Device IP Address is 192.168.254.102

    Socket created
    Get Host IP succeeded.
    Host: nist1-macon.macon.ga.us IP: 98.175.203.200

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:47:56 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:3 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:9 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:16 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:22 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:28 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:35 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:41 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:47 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:48:54 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:0 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:7 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:13 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:19 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:26 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:32 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:38 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:45 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:51 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:49:57 2015

    response from server: nist1-macon.macon.ga.us
    Tue Oct 6 16:50:4 2015

    Error [-11] at line [308] in function [GetSNTPTime]
    Server Get Time failed
    Socket closed
    SL Disconnect...
    [WLAN EVENT]Device disconnected from the AP: jefwifi, BSSID: 0:26:75:91:6a:67 on application's request
    GET_TIME: Test Complete

    - Markel
  • Kel,

    It looks like 'sl_NetCfgGet()' API is returning the junk error code but populating the correct values.
    I will check this internally with team.
    For now you can comment out the error return check for the this API in code.

    Regards,
    Ankur
  • Ankur1,

    I will "comment out the error return check for the this API in code". Thanks for your support. But, I will not "Verify Answer" yet this post since there is no explanation yet why I am getting the "junk error" code. If I am getting this error, most probably others with the same setup as I am, will also get this error.

    - kel
  • Hi Kel,

    This a bug in the NWP firmware where in case of DHCP the status is not updated and may lead to this issue.

    Regards,
    Ankur
  • Ankur1 said:
    may lead to this issue

    The issue happens every time I run Get Time example program. So, "may" is not the right word to describe it. I am not greatly affected by this issue, so I am okay with just fixing it with code modification. But, maybe others who use Rev 3.2 CC3200 LP for their product development are. Anyway, thanks for your support.

    - kel