Wifi drops after ~ 5 minutes with RTL8821AE

if wifi quits working again execute the commands given again (you must do this everytime there is a kernel update)

Thanks to @Rinzwind I've found a way to solve the problem, just follow this guide:

  1. Download rtlwifi_new from here on GitHub and extract it to Desktop (or to your desired folder).

  2. Open Terminal and change your directory to the folder where you extracted rtlwifi_new zip file (here , Desktop/rtlwifi_new-master) by using the cd command, eg

    cd Desktop/rtlwifi_new-master 
    
  3. Now, run these commands in Terminal:

    make clean 
    make 
    sudo make install  
    
  4. If everything is alright, you will see the message Install rtlwifi SUCCESS. It means that rtlwifi has beeen installed successfully.

  5. Now, run this command:

    sudo modprobe rtl8723be 
    
  6. Amd run this command:

    echo “options rtl8723be ant_sel=2” | sudo tee /etc/modprobe.d/rtl8723be.conf
    

Then reboot and choose your wifi network to connect.