I found this solution on Cnet which helped me with my tv wifi issue, i have a samsung UN55ES8000 TV
Problems: Ue65es8000
while doing wifi network search it would suddenly skip out or just close the menu completely ....
no connect to wifi or nothing comes up while scanning for wifi
in secret menu: sometimes i saw wifi MAC and sometime it show fail massage
solution :
turn tv off
with tv off press the following on the remote: info > menu > mute > power ( it is secret or service menu ) >>>> on my tv i had to press Mute>1>8>2>power to enter service mode
be careful, don't change others things
go to: Control > sub option and change "wifi region" and chose A
go back
go to: SVC > SVC reset
now your tv will restart again and ask you to config it
I hope it works for you too
Please report your test here