Mongoose OS power saving options (ESP8266)

I was wondering if there are any commands to force features like ModemSleep or LightSleep for sets amount of time.

I’ve been running a project that requires at least 10 days of batteries in a “low consumption mode”. Any insights on this topic?

Please use native SDK API for power management.
Mongoose OS does not provide any wrapper for it.

1 Like

Thanks for the reply!
I 'm trying around a few forcefull commands like:

#include "user_interface.h"

enum mgos_app_init_result mgos_app_init(void) {

wifi_set_sleep_type(LIGHT_SLEEP_T)

}

But either end up failing or coredumps occur, could you give me an insight on how to do, or if it is even possible, to do it properly?

(EDIT)

Sleep modes seems to have an OKish stability, but WiFi AP mode needs to be shut down. Is there any good command to shut it?