S4 doesn't detect any WiFi
Is it using a custom ROM or a modified stock ROM?

Flashing DjeMBeY's pre-rooted S4 ROMs has issues with Wi-Fi, esp. for those higher than MGA. They have a Wi-Fi fix, but I still encountered issues (e.g. intermittent mobile data, loss of audio / sound). So, I downgraded back to MGA.

Hopefully reading the thread in XDA might give you some ideas. Do share your answer if you find something useful, or a solution.