Acting as an access point
Is maybe not what you want That means is kind of playing the same roll as router Kind of.
You want the esp to access the router, So do you need both Station mode and Access Point mode.
The bigger problem is the router needs WiFi.begin(ssid, password); That means you are sending to a router.
This kind of means WiFi.softAP(ssid, password); your acting as a router in a simple way.
Whats the kicker you have to know the ssid and password.
It be nice if the esp8266 could auto connect to router with button . like somethings can.
But you have this the next best thing I guess AutoConnectWithHTTPServer
connect with my router.DHCP function
That kind of saying your not using the esp as access point.
The problem is access point give's out ip addresses and if you give out one that's the same as the esp guess what !! you can no longer see the esp it will look as if it stopped working.
What you really need to do is have the esp hooked to serial com and when it stops working it will dump the code that caused it to serial.
Or like mike said post your code and lets look at it. I run a relay for a month it still works