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.

How to stop automatically connecting to WIFI

Other Parts Discussed in Thread: CC3220SF, UNIFLASH

hi

   Chip used: CC3220SF, SDK version: simplelink_cc32xx_sdk_4_20_00_07

   In the system is initialized, when sl_Start() is called, it will automatically connect to WIFI. How to stop the automatic connection?

    I need to  configure the WIFI mode before connecting to WIFI, thank you !

  • hi all:

            And found that the following WIFI configuration is unsuccessful

    /* Disable ipv6 */
    IfBitmap = !(SL_NETCFG_IF_IPV6_STA_LOCAL | SL_NETCFG_IF_IPV6_STA_GLOBAL);
    RetVal = sl_NetCfgSet(SL_NETCFG_IF, SL_NETCFG_IF_STATE, sizeof(IfBitmap),
    (const unsigned char *)&IfBitmap);
    ASSERT_ON_ERROR(RetVal, NETAPP_ERROR);

    The print information is as follows:

    [ERROR] - FATAL ERROR: No Cmd Ack detected [cmd opcode = 0x8432]

    [func:ConfigureSimpleLinkToDefaultState, line:1435, error code:-2005] Netapp error, please refer "NETAPP ERRORS CODES" section in errors.h

  • Hi Kei lai,

    The connection policy is enabled by default, but this requires saved WLAN profiles. You can set the connection policy in the flashed image using ImageCreator, or you can set it in the application. See the NWP guide.

    For the cmd ack error, be sure you have the servicepack from SDK 4.20 or later flashed to your device.

    Best regards,

    Sarah

  • hi Sarah:

       In the usage document, I should check that chapter. I configured ImageCreator's auto connect to be disabled, but after the OTA fails, it will automatically connect. 

  • Hi Ken lai,

    After the attempted OTA update, can you check the connection policy with sl_WlanPolicyGet()? What application is flashed? Please share the terminal output.

    Best regards,

    Sarah

  • hi Sarah:

       After calling sl_Start(0, 0, 0), and then I call sl_WlanPolicyGet(), and the error message is as follows:
    [ERROR]-FATAL ERROR: No Cmd Ack detected [cmd opcode = 0x8c87]
    why?

  • hi Sarah:

       And I found that every time I calling sl_Start(0, 0, 0), it will automatically connect, or it will be in AP mode, and I cannot switch to STA mode through calling ConfigureSimpleLinkToDefaultState(). Can I delete the profile? I don’t need the profile to automatically connect to the WIFI

  • Hi Ken lai,

    You need to verify that you have the latest servicepack flashed to the CC3220. This should resolve the Cmd Ack issue, as I said in my previous reply.

    When you runConfigureSimpleLinkToDefaultState(), what API is returning an error? What is the error?

    Best regards,

    Sarah

  • Hi Sarah:

       The servicepack used is always the latest, the path is
    C:\ti\simplelink_cc32xx_sdk_4_20_00_07\tools\cc32xx_tools\servicepack-cc3x20


          Before the OTA function was added, the WIFI function was normal. After the OTA function was added, the AP SSID could not be configured using sl_WlanSet, because the saved profile was already used by calling sl_Start(0, 0, 0) (that is, the default SSID without password)


         There was an error when calling sl_NetCfgSet in ConfigureSimpleLinkToDefaultState. I also sent it to you before.
    /* Disable ipv6 */
    IfBitmap = !(SL_NETCFG_IF_IPV6_STA_LOCAL | SL_NETCFG_IF_IPV6_STA_GLOBAL);
    RetVal = sl_NetCfgSet(SL_NETCFG_IF, SL_NETCFG_IF_STATE, sizeof(IfBitmap), (const unsigned char *)&IfBitmap);

    The print information is as follows:

    [ERROR] - FATAL ERROR: No Cmd Ack detected [cmd opcode = 0x8432]

  • Hi Ken lai,

    Can you print out the NWP version at the beginning of the application? After sl_Start(), add the following code:

    int32_t status = -1;
    uint16_t configSize = 0;
    uint8_t configOpt = SL_DEVICE_GENERAL_VERSION;
    SlDeviceVersion_t ver = {0};

    configSize = sizeof(SlDeviceVersion_t);

    /* Print device version info. */
    status = sl_DeviceGet ( SL_DEVICE_GENERAL,&configOpt,&configSize,(uint8_t*)(&ver));

    if(status < 0){
    return(-1);
    }

    UART_PRINT("\n\r");
    UART_PRINT("\t CHIP: 0x%x",ver.ChipId);
    UART_PRINT("\n\r");
    UART_PRINT("\t MAC: %d.%d.%d.%d",ver.FwVersion[0],ver.FwVersion[1],ver.FwVersion[2],ver.FwVersion[3] );
    UART_PRINT("\n\r");
    UART_PRINT("\t PHY: %d.%d.%d.%d",ver.PhyVersion[0],ver.PhyVersion[1],ver.PhyVersion[2],ver.PhyVersion[3] );
    UART_PRINT("\n\r");
    UART_PRINT("\t NWP: %d.%d.%d.%d",ver.NwpVersion[0],ver.NwpVersion[1],ver.NwpVersion[2],ver.NwpVersion[3] );
    UART_PRINT("\n\r");
    UART_PRINT("\t ROM: %d",ver.RomVersion);
    UART_PRINT("\n\r");
    UART_PRINT("\t HOST: %s", SL_DRIVER_VERSION);
    UART_PRINT("\n\r");

    Best regards,

    Sarah

  • hi Sarah:

         The print information is as follows, the servicepack should be burned in

    CHIP: 0x31000019
    MAC: 2.0.0.0
    PHY: 2.2.0.7
    NWP: 3.16.0.1
    ROM: 0
    HOST: 3.0.1.65

  • Hi Ken lai,

    Have you made any changes to the host driver or porting layer? Do you see this error when running an SDK example that disables IPv6?

    Best regards,

    Sarah

  • Hi Sarah:

        It is impossible for me to make any changes to the host driver or porting layer, I just called sl_WlanPolicyGet, sl_NetCfgSet APIS


        I find it very strange that in the ConfigureSimpleLinkToDefaultState function, an error occurs only when sl_NetCfgSet (Disable ipv6) is called, and there is no error in other configurations. Why?

  • Hi Sarah:

      There is a problem with uniFlash. After I select the MCU image (simple->MCU img->browse), the files in the Trusted Root-Certificate Catalog have all changed back to the default value (Advanced -> Files -> Trusted Root-Certificate Catalog). As follows

    why?

  • Hi Ken lai,

    If you remove this sl_NetCfgSet command, does the fatal error go away? Can you try using the code from the SDK example to disable the IPv6? That may help us understand if this issue is in the application or the NWP:

    /* Disable IPV6 */

    ifBitmap = 0;

    ret = sl_NetCfgSet(SL_NETCFG_IF, SL_NETCFG_IF_STATE, sizeof(ifBitmap), (uint8_t *)&ifBitmap);

    ASSERT_ON_ERROR(ret);

    The Simple mode in UniFlash ImageCreator automatically signs the MCU image with the playground dummy root certificate. That includes loading the playground certificate catalog. See the UniFlash ImageCreator documentation: SWRU469

    Best regards,

    Sarah

  • Hi Sarah:

       I removed this sl_NetCfgSet command in my APP, and it can run correctly. There is no problem with disabling the IPv6 in the demo example.
       After adding the OTA function to my program, disable the IPv6 will report an error

  • Hi Ken lai,

    Is sl_NetCfgSet() returning an error to the retval/ret variable? Or are you only seeing the async event fatal error?

    We disable IPv6 in the Out of Box demo, which already includes OTA. Is an OTA update occurring when you call this command?

    Best regards,

    Sarah

  • Hi Sarah:

       The error code returned by sl_NetCfgSet() is -2005. The function is called before the OTA initialization, not during the OTA upgrade.


       Can I not call Disable ipv6? Because after I comment it, the program can run to verify the digital certificate, but HttpClient_Connect() will make an error, HTTP 404 error

  • Hi Ken lai,

    If sl_NetCfgSet() is called before the OTA initialization, then what else changes before you call sl_NetCfgSet()? Application code that happens afterwards would not change the behavior. Is this error happening when you restart the device after an OTA update? If so, can you try flashing the image via ImageCreator?

    Best regards,

    Sarah