I am new to IoT devices and its uses and is struggling to get a small fix for my device for the deployment purpose. I have a nodeMCU and I have setup initial codes such that it can send data to ThingsBoard node. Also, instead of hard coding ssid and password I used wifi-manager library so that i can establish a connection manually. My concern is my device should work like just my phone in terms of connectivity, although I will run it into deepsleep mode for maximum time. I am struggling to put following scenarios at once in my device:
1. If it powers on it should automatically connect to the available wifi.
2, If it is not able to connect, it should go in station mode and allow user to configure the credentials.
3. If someone changed ssid and password, it should be able to identify this and go into station mode for reconfiguration. Maybe I blink an LED at certain frequency to indicate it is not connected to wifi.
4. If let us say there is power outage of 4-5 hours, it will go in deepsleep mode(this I know how to make it work), but when it should wake up and power is back, points 1, 2 and 3 should be taken care.
5. If some extreme scenario appears at the end user can just go and do hard reset, such that everything starts from new.
Any help would be highly appreciated especially for point 3 and 4, as I am struggling a bit into it and is not able to find answer from a month. Please feel free to ask for any clarification, and pardon if this is silly question, but seems problematic for me.
I have searched other links but none seems to be a perfect solution.
Thanks in advance.