- Mon Oct 29, 2018 7:56 am
#78933
vdetez wrote:I read that I need to do a digitalWrite(4,LOW); but nothing happens. I check the PIN 4 : CH_PD it's always at HIGH.
You've read where?
digitalWrite(4, LOW) sets GPIO4 to LOW, not pin 4 (these are NOT the same).
An ESP-01 doesn't even have GPIO4 available, only GPIO0, GPIO1 (AKA TX), GPIO2 and GPIO3 (AKA RX).

CH_PD needs to be pulled HIGH otherwise the ESP could never run.
In theory you can power down the ESP from code, but in that case you'll have to connect a free GPIO to CH_PD and pull that line LOW when power down is required.
In practice, though I've never done it myself, you can (for instance) connect GPIO2 to CH_PD and pull both HIGH with a resistor (~10k).
In code, you define GPIO2 as output and when necessary do a digitalWrite(2, LOW) when you want to power down.
But... please read my signature regarding using ESP modules when you're new to the ESP8266 (in short: don't).
Assumption is the mother of all f*ckups. At least: that's what I'm assuming.