Adafruit Feather Mo WiFi Sleep mode

Hello

I need to set Adafruit Feather Mo into sleep and awake mode, while it is connected to WiFi with number of sensors.Currently am working on a project which uses DHT22 and Time of Flight sensors, I have searched and worked for the solution for long time. I tried to use RTC library and Arduino Lower Power Library for this SAMD21 board yet its only works when no WiFi or sensor device is connected to it.

Please help on how to set Adafruit Feather Mo into sleep mode and awake mode, I need this for my current running project cause i want to achieve reality monitoring while saving power. Thank you.

Hi unice,

The SAMD21 is designed to wake up upon receiving any interrupt. If your sensors or Wifi generate an external interrupt and the SAMD21 is set-up to receive them, this will cause the processor to awaken, irrespective of your RTC or Low Power library settings.

One way to check if the processor's being woken up by external interrupts, is to disable them before putting the processor to sleep:

uint32_t status = EIC->INTENSET.reg;     // Read which external interrupts are enabled
EIC->INTENCLR.reg = EIC_INTENCLR_MASK;   // Disable all external interrupts

// ...Put the processor to sleep here...

Then enable them oncemore, after the processor has woken up:

// ...Wake up processor here...

EIC->INTENSET.reg = status;   // Enable external interrupts oncemore