Finally... thank god...
Been having issues with wifi not tirning on for longer than 6 months now on my s4 i9500. Gave up, almost cried, even been depressed for a bit, having bought it when it just came out, my first android and an expensive one at that.
Tried everything on the forums. Nothing helped. Even became somewhat a noob expert at rooting, installing different roms, none of which helped.
Than I thaught, aw hell with it, will use it sometimes with 4g(really expensive in these parts)also no samsung servece center to invoke warranty, hence playing doctor myself. Installed an omega rom, an a few weeks in it started working by it self.
U wouldn't believe my happiness. Than in just 4 days, same issue. Whole cycle from sad to giving up again. This happened two or three times.
Got to think must be hardware issue, sought info, couole olaces said might be fixed for a couple 100$. I wasn't going to do that, would think myself to be dumb to do that.
5-6 days back I decided to go back to stock rom, and use the device unrooted. I didn't last 30 min. With no wifi, there was no fun to be had, so rooted, and for the heck of it deleted the wpa suppl.file, rebooted and to my eye poppin surprise, wifi was lit full green. Lasted for 12 hours

.
Tried the same, deleting wpa.supl, but it never gets restored. This is what happened also the previous times, the wpa suppl never got restored.
I even made a nandroid backup of when it was working. Still restoring the nandroid never got the wifi working. Makes you wonder, must be a setting nandroid does not cover.
Depressed as hell started searching the forums for new solutions, none came across that I hadn't already tried.
Came across i9500xxufnc1 stock rom for my s4, thought, what the hell. Flashed that rom. Rootes, deleted the wpa.sup file, and (knock on wood) it has been working till now, sending this message with it now

)).
So in short Installed stock rom xxufnc1
Rooted-philz touch- super su
Installed Es filexplorer Deleted wpa supplicant
Reboot
Voila!!
A couple a questions for the pro's:
Why doesn't nandroid backup the /data/misc/wifi folder?
Is there a way to back that up?(just copying it with es file explorer misses a few files,even with root acces)
Is it on a specific partition, that i can maybe make an image of, and restore it if it acts up again?
Can anyone deduct from what ive written what the exact cause of the problem might be?
Again mine is workinh fine now, but these things might help future me's.