# Fix sleep

## **Xác định phần cần** sửa

B1: Nhập code sau vào terminal&#x20;

```
pmset -g log | grep -e "Sleep.*due to" -e "Wake.*due to"
```

B2: Xem bảng sau để biết cần phần cần fix

| Wake \[CDNVA] due to GLAN: Using AC                                   | Vào cài đặt firmware tắt mục Wake on LAN đi                    |
| --------------------------------------------------------------------- | -------------------------------------------------------------- |
| Wake \[CDNVA] due to HDEF: Using AC                                   | Vào cài đặt firmware tắt mục Wake on LAN đi                    |
| Wake \[CDNVA] due to XHC: Using AC                                    | Vào cài đặt firmware tắt Wake on USB và patch GPRW, xem ở dưới |
| DarkWake from Normal Sleep \[CDNPB] : due to RTC/Maintenance Using AC | Lỗi này thường gặp do power snaps                              |
| Wake reason: RTC (Alarm)                                              | Lỗi này thường do 1 ứng dụng, hãy thoát nó trước khi bạn sleep |

## **Chuẩn bị**

B1: Chỉnh mục Power Management trong Hackintool:&#x20;

> Mở Hackintool, vào tab Power

<figure><img src="https://lh5.googleusercontent.com/Ud3dJFNTR_eNGjR3y-Ya-mS4McG8iZX7HTF1wBPl32kUruuvBx3LBf76VkUCcv4auAveok1t9GqJTkVdGo4ryqa-HVZgVOImociGIjgdJwPdCL7C5Q0nU9uuho3v52fbiPEyIZkk=s0" alt=""><figcaption></figcaption></figure>

&#x20; B2: Nhấn vào dấu ![](https://lh6.googleusercontent.com/ssk0miuDyfm8Pdy47a5ngMW9M6i1XOzt2J45qVvd9TweppzXHBw72h1Wc2TW5AhPUiTXvnkqMXP6Xvzw24EAMKVoRrx1_N694RNho2P3UIoybeTz7UYeUbH9oDu4nIDrJvdroId-=s0) để sửa các mục trong Power Management thành `0`

> Hoặc dùng kext [hypernation fixup](https://github.com/acidanthera/HibernationFixup/releases)

B3: Dán lần lượt các lệnh sau vào terminal

```
sudo pmset autopoweroff 0
sudo pmset powernap 0
sudo pmset standby 0
sudo pmset proximitywake 0
sudo pmset tcpkeepalive 0
```

## Tiến hành patch

* [Map USB](/usb-fix/map-usb.md)
* [Fix GPRW/UPRW/LANC](/universal/fix-sleep/gprw-uprw-lanc.md)
* [Fix power management](/universal/fix-power-management.md)
* [Fix wake keyboard](/universal/fix-sleep/fix-keyboard-wake.md)
* [Fix dark wake](/universal/fix-sleep/fix-darkwake.md)
* [Fix PTS wake TTS](/universal/fix-sleep/hotpatch-pts-wake-tts.md)

> Nếu như các bạn quá bối rối không biết nên chọn patch nào thì mình khuyến khích sử dụng comboo sau
>
> * Map USB
> * Fix GPRW
> * Disable DGPU
>   * Laptop
>   * Desktop


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://basic.heavietnam.com/universal/fix-sleep.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
