I had similar problem with my LG 49UH850T . Reset to initial setting tried as per the advice from LG support which didn't help. Since it is just out of warranty they logged support call and LG person came to home. He did some factory reset with his password and it started working. He also asked me to take AMC and also said if this happens again they may have to change the mother board etc.. After he lest and after 4-5 hours, problem again started. It just connects for a while when switched on and later after 2-3 minutes it disconnects .
I tried changing settings=> General => Quickstart=>Off which did not help
Finally changed settings => General=>Date and time=> deselect "Set automatically" and setting date and time locally helped and now the wifi connection is stable.
Hope it can help others also.
It was connecting just fine till two weeks ago. I've reset the tv, the modem, the network, contacted lg support, internet provider support, unplugged, plugged back on, blew on everything, sacrificed two chickens and a goat, and organized gladiator games. Nothing. My chromecast, tv and laptops connect just fine. help!