martinayotte wrote:The CH340 is also controlling the GPIO0 to activate upload mode. In the case of DeepSleep WakeUp, only RES becomes LOW by the GPIO16, so it is resetting in normal mode. It is then up to you code to determine the reason of the reset if you need to distinguish normal power-up and wakeup using ResetInfo.reason.
Thanks for the response Martin. As a reminder, the problem I am having is that when I try to upload a sketch to the D1-mini while GPIO16 and RES are connected, I just get an error message. If I remove that connection, the upload works.
I expected that when I initiate sketch upload, the ch340 would pull RES low, waking the esp from deep sleep and allowing the sketch upload to continue. I don't understand why having the connection from GPIO16 to RES prevents this from happening. Is GPIO16 pulling RES up to 5V so hard that the CH340 chip is unable to pull it low?
At first, several days ago when you bring the issue, I've tried it on my own Wemos D1 Mini, but I didn't tried it "while been in deepSleep" ...
Now, I've tried it again, and you right ! Mine is doing that too ...
But I discovered a workaround : instead of placing only a wire, I've put a 1K resistor, that way the deepSleep is working and external reset too !
I though originally that GPIO16 was acting as OpenDrain, but it doesn't seem too : I've put my scope on GPIO16 and it is turning HIGH when deepSleep() command is issued !
EDIT : I've created a separate thread to warn users since this is not only true for Wemos D1...