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.

CC3235MODSF: rebooting from AP mode to STA causes instant SL_NETAPP_EVENT_IPV4_ACQUIRED event

Part Number: CC3235MODSF
Other Parts Discussed in Thread: UNIFLASH

Device is running in AP mode.

When done with configuring I reboot the device with a button click on the HTML page that results in the last 2 lines:

sl_Stop(200);
PRCMMCUReset(false);

Just in case after reboot i call the sl_Stop again to make sure the network processor is not running (reset?).

After this the device boots up in STA and i see that immediately the sl_Start is called the event callback reports IP ACQUIRED:

 ROLE_STA IP Acquired: IP=10.0.0.1 Gateway=10.0.0.1

Which is essentially the AP configuration.

The behavior results in the application believing that we are correctly connected to one of the profile stored routers.

FastConnect is not enabled.

Any way to delete/empty the cached and seemingly incorrect network date on the network processor?

  • Are you setting the mode to STA somewhere in your code?

    If the device was in AP mode (and the mode wasn't changed by the application), it will stay in AP mode after the reset. 

    The IP address also shows that the device is in AP mode, so maybe you have only some issue with regards to mode detection (or printing) in the application?

    br,

    Kobi

  • a call to sl_WlanSetMode (at startup, before calling sl_Start) results in -2018 error code (wifi not initialized).

    a call to sl_Start results in AP mode and the event IP ACQUIRED is fired immediately via the callback .

    Is there any other way to set the Wlan mode prior to sl_Start?

    at the moment my workaround solution is i mark the wifi_mode in a global variable "unknown" and mask out the event in the callback.
    unfortunately the wifi mode can not be read out using the sl_WlanGet(...) in the callback as the APIs are not safe(?) to be used.

  • no, you need to call sl_Start (i.e.to turn on the NWP), before you can issue any other command.

    You can use uniflash settings for first/factory reset defaults.

    What is the problem with getting the IP_ACQUIRED in AP Mode? (the app can identify that as an AP, this event doesn't mean a connection).

    The mode can be learnt from the return value of sl_Start (it can be also be read from a callback).

    A global is a good solution for maintaining the active role.

    Br,

    Kobi