Pattern not working - Locked out of phone I have an Android 6 device.

Since this morning when I woke up, my pattern is no longer working and the wifi mobile hotspot was turned off during the night (it was on when I went to sleep).

After a few tries and waiting 30 secs, it lets me access the phone thru the backup pin, but if i try to change the pattern (settings -> security -> security lock) or to reset the settings, it asks for the pattern again, which of course no longer works.

Any ideas what to do about this situation? Would prefer not to lose all my apps / settings / data.
First of all, you'll NEED to root your device if you haven't done that (You didn't specify what device you have, so Google "(device's model number here) root")
But READ this post: https://www.quora.com/What-are-the-disadvantages-of-rooting-Android-devices/answer/Ashwin-Afhen before rooting your Android device

Now, download THIS terminal emulator AFTER rooting your Android device: https://play.google.com/store/apps/details?id=jackpal.androidterm, open it up and type these commands:

su
rm -f /data/system/locksettings.db*
rm -f /data/system/gesture.key


And now, REBOOT your Android device and you SHOULD see no pattern lock or a pattern lock that can be unlocked with ANY pattern (and then, unlock your device and set a new pattern)

And unroot your Android device

That's all I can say for now