HP laptop WIFI rtl8723be slow if none connexion

One week ago i was lucky enough to found at HP shop inside a mall an HP 348 G3 laptop without OS installed (just FreeDOS)
So I installed U-M 18.04.1 LTS and then
I wanted to connect to internet and here all the problems started, slow internet, i mean SLOW internet connection like max speed 40-50 Kb/s when it want to connect, because it always disconnect!

So i searched what’s wrong and discover that a lot of HP with rtl8723be wifi card have wifi issues
I tried many things for 2 days in a row and none of them worked, i did install so many things and run so many command that the max i got was a relatively stable connection but at 50 Kb/s big time.

the ant_sel=x i tried so many time or other similar things which did nothing.

in the beginning i did not have a file in /etc/modprobe.d/rtl8723be.conf at the end i had this file with so many options and others folders too that i told myself that it make no sense.

So i formated the HD and tried Linux Mint 19. MATE…
Surpringly WIFI almost worked out of the box, but was irregular sometime it goes to 500 Kb/s and sometime at 50 Kb/s only for long period.

But most important I did not found the way to put the Cupertino DE, so the Windows Microsoft alike Desktop = No way!
But i got the thought of “if LM 19 which is based on Ubuntu 18.04 makes it almost work good, it should be possible to make it working good on U-M 18.04 as well”

Re-format and Re-install U-M 18.04 and this time i was careful with the keywords while searching the rtl8723be wifi not working.

And TODAY i found almost the final solution, It’s working GREAT at full speed of my internet connection!
Yes you read well “almost” but it is working great, I will get back on this “almost”.

So what i had found and how i did manage to have a full speed internet connection with my laptop?
I discover that the kernel 4.15.33 has introduced a bug with rtl8723be and other wifi card
Kernel 4.16 did not solved the bug… (sorry i did not kept the link of the bug).

But I found this page:

first install all the dev tools you will need ( i am not a programmer too so just copy and past i did):

sudo apt-get install linux-headers-generic build-essential git

when it finished to install all the things i did what they said on that page:

git clone https://github.com/lwfinger/rtlwifi_new.git
cd rtlwifi_new
sudo make install
sudo modprobe -r rtl8723be
sudo modprobe rtl8723be

then nothing happen so i restarted my laptop (you never know)
Same as usual slow connectionas so i had the options they said on the same page and because i do not know vim i installed nano

sudo apt install nano

then

sudo nano etc/modprobe.d/rtl8723be.conf

then write

options rtl8723be ant_sel=1

then CTRL + x (to close)
then type Y (for yes like that it save the modif)
then press Enter

though, you can do it graphical (open any directory then go up to the root disk ./ then search the etc directory double click on it then search the directory modprobe.d on this one RIGHT click on it and select open as administrator then when asked enter your password, then the directory open with different colors than your theme , then right click on an empty space and create a new document that you call rtl8723be.conf and open it and write inside options rtl8723be ant_sel=1 (or =2)

and … nothing have changed… still slow connection

But simultaneously i was on this website :
https://ubuntuforums.org/showthread.php?t=2399293&s=6ed43410c207637c4be4fca8c3afb255

and on this website a guy ask another guy to try which one has the best quality signal with this codes

sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=0
iwlist scan | egrep -i 'ssid|quality'

I did try and the result was 24/70 so very low
then i enter with ant_sel=1 but redit all the sequence

sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=1
iwlist scan | egrep -i 'ssid|quality'

result also very low almost the same as before
the re-did ALL the sequence but with ant_sel=2

sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=2
iwlist scan | egrep -i 'ssid|quality'

and here i got a lot higher numbers and strangely my internet connection went crasy i got all 5 bars in the top panel i immediately try youtube (best to test the speed) and boom the speed was there!
I Checked the wifi icon and it even detect my neighbors’ wifi like my others computer (Desktop computer).

And … I restart to be sure that everything will work again…

and it was not working again. But i checked the file in:
etc/modprobe.d/rtl8723be.conf

and the options was ant_sel=1 so i changed it to 2
and re run the

sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=2
iwlist scan | egrep -i 'ssid|quality'

Yeah it’s working again!

So i restart my laptop
and now everthing is working full speed!

But this time i can only see the network my laptop automatically connect
That’s OK
but i would like to not run

sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=2
iwlist scan | egrep -i 'ssid|quality'

to see other network each time i am out of home or tell to my wife she need to run the below sequence in the terminal to connect to other network

sudo modprobe -r rtl8723be
sudo modprobe rtl8723be ant_sel=2
iwlist scan | egrep -i 'ssid|quality'

What can i do to make other networks definitively visible without opening the terminal each time if i want to see other network?