Do you, by any chance, set the GPIO in the beginning of your code? Because that would explain why you think it does not work.
The DONE signal is exactly that: "I am done, you can power me off". It should be the last line of code in your NodeMCU.
OK, I did some digging and it seems there are several potential culprits.
- First, you are not alone having this problem. In fact, the Adafruit datasheet acknowledges a problem and recommends adding 47 uF capacitor to NodeMCU Vcc. Many people on forum say it is not enough and they needed at least 100 uF to make it work (I saw your posts there BTW).
Links to forum: one, two.
This is totally wrong IMHO. There should not be any huge power spike at startup (not at 80 mA draw!). The capacitor would only delay the rise time on power up and keep NodeMCU from proper shutdown on power down. It is rather "let's add the cap and see what happens" approach. Even if it works, it does not pinpoint the actual problem.
Also, if it really has anything to do with power line drop then it makes sense to add capacitor before the MOSFET. This way it won't delay the boot, it will supplement startup current instead.
- Second, this thread reminded me about one peculiarity of TPL5110/TPL5111 chips.
The normal operation is: timer activates DRV, MCU boots, does whatever it supposed to do and signals DONE, timer switches power off.
However if DONE is not received then timer forces DRV off 50 us before the end of period. Although datasheet is not clear on this, my understanding is it does this so it could activate DRV again when period ends, i.e. almost immediately (in 50 us).
So, if programmed period is short it would look like "blinking". In order to avoid this time period should be set long enough for MCU to boot, do its thing and still have enough time to signal DONE.
- Another potential candidate is ESP8266 itself.
It's bootloader dumps boot log to UART during startup. AFAIK this cannot be disabled completely. So, if you happen to use TX pin for DONE signal you are in trouble.
- Finally, and this is what I believe is real culprit for many people on Adafruit forum, some GPIO pins of NodeMCU triggered high during boot.
See here and here for some investigation of this problem (first link is dead ringer of your case). I must say, this is rather bizarre behavior for MCU. I always assumed that all pins stay in high-Z until I program them otherwise...
In short, you have to make sure you use "safe" pins for DONE signal. Interestingly enough, adding capacitor after MOSFET could mask this problem by keeping NodeMCU alive till next period, just as I said in the beginning (a working solution without understanding a problem).
OK, while all of the above can cause the observed behavior (especially choosing "unsafe" pin for DONE), the most probable culprit is high current draw of the ESP on startup. Here, I found an interesting article about it, claiming as much as 400 mA on startup, with possible lockup in this state if power rise slew rate is too slow.
Now that I knew what to look for, I found hundreds of pages about this issue, like this post on Espressif forum.
In conclusion: ESP draws huge current during boot. Furthermore, it can lock up in this condition if voltage is not rising fast enough. Adding capacitor before MOSFET solves both problems by instantly providing required power without reducing voltage rise time.