Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    XDK WLAN hibernate when it's not in use

    hasalp
    Member

    XDK WLAN hibernate when it's not in use

    Hi everyone, I need a solution to extend battery life in XDK. My code listens the light sensor and when anomaly detected it sends data with wifi. Therefore I want to put wifi to hibernate mode after sending and waking up again after detection. Because CC3100 has 4 microA power usage under hibernate.

    I use basic WLAN initialization:

    //inside setup function
    Retcode_T retcode = WLAN_Setup(&WLANSetupInfo);
    //inside enable function
    Retcode_T retcode = WLAN_Enable();

    and I want to trigger hibernate and wakeup inside Fire function. How I can activate hibernate mode ?

    Thanks,

    3 REPLIES 3
    Padmapriya
    Long-established Member

    Re: XDK WLAN hibernate when it's not in use

    Hello,

    Since workbench v3.6.0,  Wlan Power management support has been added.

    You can use the interface function WlanNetworkConnect_PowerControl() by including BCDS_WlanNetworkConnect.h (Platform\Wlan\include) in your application. Power modes are configurable as function parameter. Following power modes are supported,

    1. Hibernate mode : This is the lowest power mode. If the device enter into hibernate mode, device is powered off except RTC clock keeps running. In this mode, memory is not retained, and wake up requires a cold boot initialization.
    2. Wakeup mode : In this mode, device will wakeup from sleep mode or hibernate mode. Ensure that, if the device is in hibernate mode, then wakeup requires boot initialization
    3. Fast connect mode: The main advantage of fast connect over auto connect is that the system skips the scan. 
    4. mDNS mode : network processor will send the mDNS packets for service discovery

    Recommand you to read the function interface documentation and also CC3100 WiFi chip documentation to get futher insight of WiFi power management.

     

     

     

    hasalp
    Member

    Re: XDK WLAN hibernate when it's not in use

    @Padmapriya thanks for your answer but fire function gets freeze after this line:

     

     

    WlanNetworkConnect_PowerControl(WLANNWCT_PWRCTRL_WAKEUP, NULL);

     

     

    It works with no problem if I remove power control lines. After few minutes waiting I got:

     

     

    INFO | XDK DEVICE 1: ************RESET CAUSE: WATCHDOG************

     

     

    Error on device. What can be the reason ? 

    Padmapriya
    Long-established Member

    Re: XDK WLAN hibernate when it's not in use

    Hello,

    Watchdog reset is triggered by the application. Watchdog is already implemented and enabled; is fed only in idle task. If idle task is not executed, watchdog will not be fed; resulting in system reset after 4.26 minutes (watchdog timeout).

    You can make sure that the application task is running. It occurs to me that the WiFi wakeup is incomplete and the control is not returned to application.

    Please have a read about controller power cycle and WiFi power cycle regarding power management topics.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist