I have a HP 14-AN001NA laptop. It came with Windows 10 installed on which the wifi worked fine anywhere in the house. However I removed windows 10 and installed Ubuntu 16.04 instead and since I have had terrible wifi anywhere aside from about three foot away from the router. I don't know if it's relevant but my wifi is not called wlan0 but wlo1 for some reason (I didn't change it).
lspci -knn | grep Net -A3 I get the following output:
05:00.0 Network controller : Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723] DeviceName: Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter [103c:81c1] Kernel driver in use: rtl8723be Kernel modules: wl, rtl8723be