I understand that your iPhone doesn't connect to your Wi-Fi connection at a distance of five meters, it needs to be closer to your router to establish a connection.
First, is this happening with other devices, or just your iPhone? There are good steps that you can try in this support article: If your iPhone, iPad, or iPod touch won’t connect to a Wi-Fi network .
I also recommend looking at this article to identify sources of Wi-Fi interference: Potential sources of Wi-Fi and Bluetooth interference .
Let me know what happens.