# AMB82-mini在wifi連線下無法進入待機模式

**URL:** <https://forum.amebaiot.com/t/amb82-mini-wifi/3134>\
**Category:** WiFi\
**Tags:** 中文, evb-amb82\
**Created:** [July 17, 2024, 8:13am UTC](https://forum.amebaiot.com/t/amb82-mini-wifi/3134 "2024-07-17T08:13:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikechen](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mikechen](https://forum.amebaiot.com/u/mikechen)\
**Post date:** [July 17, 2024, 8:13am UTC](https://forum.amebaiot.com/t/amb82-mini-wifi/3134/1 "2024-07-17T08:13:22Z")

</div>

Hi,

下列程式碼顯示AMB82-mini在wifi連線下無法進入待機模式;

//Source code:  
/\*  
This sketch shows how to use power mode standby

Example guide:  
[PowerMode – Standby Mode – Realtek IoT/Wi-Fi MCU Solutions](https://www.amebaiot.com/en/amebapro2-arduino-standby/)  
\*/

#include “PowerMode.h”

#include \<WiFi.h\>

// wake up by AON timer : 0  
// wake up by AON GPIO : 1  
// wake up by RTC : 2  
// wake up by PON GPIO : 3  
// wake up by UART/Serial1 : 4 //Only support 4MHz clock source  
// wake up by Gtimer0 : 5 //Only support 4MHz clock source  
#define WAKEUP\_SOURCE 1

#if (WAKEUP\_SOURCE == 0)  
// set AON timer Clock, 1: 4MHz, 0: 100kHz  
#define CLOCK 0  
// set AON timer sleep duration, 5s  
#define SLEEP\_DURATION 5  
uint32\_t PM\_AONtimer\_setting[2] = {CLOCK, SLEEP\_DURATION};  
#define WAKUPE\_SETTING (uint32\_t)(PM\_AONtimer\_setting)  
#elif (WAKEUP\_SOURCE == 1)  
// set wake up AON GPIO pin : 21 / 22  
#define WAKUPE\_SETTING 21  
#elif (WAKEUP\_SOURCE == 2)  
// set wake up RTC alarm as 5 seconds  
#define ALARM\_DAY 0  
#define ALARM\_HOUR 0  
#define ALARM\_MIN 0  
#define ALARM\_SEC 5  
uint32\_t PM\_rtc\_Alarm[4] = {ALARM\_DAY, ALARM\_HOUR, ALARM\_MIN, ALARM\_SEC};  
#define WAKUPE\_SETTING (uint32\_t)(PM\_rtc\_Alarm)  
#elif (WAKEUP\_SOURCE == 3)  
// set wake up PON GPIO pin : 0 to 11  
#define WAKUPE\_SETTING 0  
#elif (WAKEUP\_SOURCE == 5)  
// set wake up Gtimer0 sleep duration, 5s  
#define SLEEP\_DURATION 5  
#define WAKUPE\_SETTING SLEEP\_DURATION  
#else  
#define WAKUPE\_SETTING 0  
#endif

char ssid = “POCO”;  
char pass = “123456789”;

void setup()  
{  
Serial.begin(115200);  
Serial.println(“Standby Mode Demo!”);  
//mikettest-2024-07-17------

 

**```
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
}**

**```**

 

//mikettest-2024-07-17------

```
PowerMode.begin(STANDBY_MODE, WAKEUP_SOURCE, WAKUPE_SETTING);

for (int i = 5; i > 0; i--) {
    Serial.print("Enter Standby Mode by ");
    Serial.print(i, DEC);
    Serial.println(" seconds.");
    delay(1000);
}

PowerMode.start();
// the default RTC start at 1970.1.1 00:00:00
// customize the start time by PowerMode.start(1970, 1, 1, 0, 0, 0);

Serial.println("You won't see this log");
while (1)
    ;

```

}

void loop()  
{  
delay(1000);  
}

//log:  
15:34:42.074 → Boot Loader \<==

15:34:42.074 →

15:34:42.074 → == RAM Start ==

15:34:42.074 → Build @ 14:48:33, Jun 6 2024

15:34:42.118 → $8735b\>Standby Mode Demo!

15:34:42.118 → interface 0 is initialized

15:34:42.118 → interface 1 is initialized

15:34:42.118 → cfg\_size\_lib = 33, cfg\_size\_user = 33

15:34:42.118 →

15:34:42.118 → Initializing WIFI …[Driver]: [HALMAC]

15:34:42.118 → 11692M HALMAC\_MAJOR\_VER = 1

15:34:42.118 → HALMAC\_PROTOTYPE\_VER = 4

15:34:42.118 → HALMAC\_MINOR\_VER = 20

15:34:42.118 → HALMAC\_PATCH\_VER =

15:34:42.118 → [Driver]: The driver include MP

15:34:42.164 → [Driver]: Ver = libwlan:2024.06.06.15.18\_bBranch\_c9ac9463\_a4bceabfd2147eb65f520240ea916875e8c1791b

15:34:42.164 → RFE type = 0

15:34:42.209 → start\_addr=(0x4000), end\_addr=(0x8000), buffer\_size=(0x4000), smp\_number\_max=(2048)

15:34:42.241 →

15:34:42.241 → WIFI initialized

15:34:42.241 →   
15:34:46.640 →

15:34:46.899 → [Driver]: association success(res=16)

15:34:46.935 →

15:34:46.935 → [Driver]: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4)

15:34:46.970 →

15:34:46.970 → [Driver]: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1

15:34:46.970 → (0) Scan: 1, Auth: 1, Assoc: 1, 4way: 1, connect: 1, reason: 0

15:34:46.970 →

15:34:47.623 → Interface 0 IP address : 192.168.36.153

15:34:47.658 → GPIO IRQ init OK!

15:34:47.658 → Enter Standby Mode by 5 seconds.

15:34:48.237 → [Driver]: random drift

15:34:48.237 →

15:34:48.237 → Enter Standby Mode by 4 seconds.

15:34:49.671 → Enter Standby Mode by 3 seconds.

15:34:50.632 → Enter Standby Mode by 2 seconds.

15:34:51.670 → Enter Standby Mode by 1 seconds.

15:34:52.634 → You won’t see this log

15:34:59.303 → [Driver]: random drift

15:34:59.303 →

15:34:59.303 → [Driver]: random drift

15:35:11.281 →

15:35:11.281 → [Driver]: TSFValue = 2653799749, tsf = 0, shift\_set= 0x8000, bcn int = 100

15:35:23.244 →

15:35:23.244 →

---

<div class="post-metadata">

**Author:** ![Lun](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/lun/32/2269_2.png) [@Lun](https://forum.amebaiot.com/u/Lun)\
**Post date:** [September 18, 2024, 9:32am UTC](https://forum.amebaiot.com/t/amb82-mini-wifi/3134/2 "2024-09-18T09:32:25Z")

</div>

Did you already fix it?

Under the standby mode, I am curious whether wifi works fine or not.  
I didn’t find any document about it.

Does anyone have this experience to share?  
Thanks

---

<div class="post-metadata">

**Author:** ![M-ichae-l](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/m-ichae-l/32/33_2.png) [@M-ichae-l](https://forum.amebaiot.com/u/M-ichae-l)\
**Post date:** [September 24, 2024, 2:54am UTC](https://forum.amebaiot.com/t/amb82-mini-wifi/3134/3 "2024-09-24T02:54:39Z")

</div>

Currently there is no standby mode for WiFi under Arduino
