These tips had worked for a little while, but every so often I still get the issue of my phone continuously connecting and disconnecting to the WiFi network at my house, at friends houses, at work, school, etc. I have my frequency band to 2.4 GHz. My phone is renamed to HTC One. For a little bit I even tried HTC One SV (as that is my phone model). Still no success in getting to to stay connected. The connection would last for about an hour and if I stop using my phone for an extended period of time or open an internet required app after some time on sleep mode, the WiFi signal hops into connecting and disconnecting again. I'm looking for a way to permanently end this cycle. When I connect to WiFi I wish to stay on it.
For now I have been temporarily fixing the issue with forgetting the network, turning off WiFi, restarting phone, checking that frequency band and name are still 2.4 and HTC One (I've found it sometimes reverts to auto frequency), then turning WiFi back on and connecting again. This is a pain to do a few times every day though.