ESP server not responding

I am having an issue where my ESP will connect fine to my network but after a few mins sometimes a hour if I try to reach the esp I will get a message back saying the server is not responding, after resetting then I can connect again. Can anyone help please. I wanted to wire my air condition to come on on my way home from work, but esp will not stay connected after an hour or until I reset it. I would appreciate any help please.

it is an old and still not solved problem. you could try 2.5.0 which has this solved but has many other problems

Got it, completely understand, I have read many post that have addressed this issue with different code, but nothing I have tried works. I have installed the 2.5.0v but there is a beta 1, 2, and 3. Which would be the preferred one. Also my board settings, i'm not sure of. I will include my code and my board settings with this post. Thank you for your time

ESP_FROM_ANYWHERE.ino (2.26 KB)

ESP_FROM_ANYWHERE.ino (2.26 KB)

lp422003:
Got it, completely understand, I have read many post that have addressed this issue with different code, but nothing I have tried works. I have installed the 2.5.0v but there is a beta 1, 2, and 3. Which would be the preferred one. Also my board settings, i'm not sure of. I will include my code and my board settings with this post. Thank you for your time

Beta is pre-release. 2.5.0 is a release

Ok got it, I removed the only Json file I had and reinstalled it with the 2.5.0 version. I appreciate the help. Would you happen to have example code that you may have used that works for you, or could you look over my code and let me know if they is anything I may be missing. Thank you for all you help.