Firmware Reset
During the wifi configuration tutorial I described a method to provide a firmware reset in the case that you forget the user name and password using an additional button (or wire loop). I also lamented the problems of the Wemos D1 board not being able to distinguish between a power cycle and a button reset. Today I'm going to discuss another way to achieve a firmware reset of the device without the requirement for any additional hardware. The method itself is quite simple and we have already used all required parts for the wifi configuration program. The first thing the device should do when it starts up, is set a flag in the non volatile memory and after a given period of time it should clear this flag again. Now if the device is reset before it has the chance to clear the flag we can tell that the reset button has been pushed twice in quick succession and use that as an indicator that we want to perform a firmware reset. There are a few items to declare at the start of