-Restart The WiFi router and mobile device to rule out simple errors.
-Check The MAC filter router to verify that the device is enabled.
-you Turn the power mode to save settings> energy savings.
Eliminates the WiFi connection you're trying to connect the HTC One M8 and reconnect to it.