How to make ESP-07 "slow" start?

I have built a number of electricity meter interface devices based on the ESP-07 module which uses an external antenna.
It is working fine in most instances but on my summer home I have a problem because following a power outage it will not start up properly.
It seems like the meter will not supply full power on startup if the connected device pulls too much off of the 5V line.
My device has 1000uF capacitor across the power pins to handle surges by WiFi operations and I guess that this capacitor causes the power line block on connection to the electricity meter.

When I am on location I can walk over to the electricity connection box on the power line pole where the device is located and hook up a power bank using the USB connector on the power bank and a cable I have modified to have a black and red connector on the 5V lines, which fit on pins on my board.
With that connected I can start the ESP and it will read the data from the HAN output of the meter.

But it is an inconvenience to say the least especially when I am not on location or (as now) I have forgotten the power bank and the cable back home....

So is there a software way to make the ESP-07 startup NOT enable power hungry functions on the ESP-07 until some later time when the power has stabilized and the 1000uF cap is fully charged?
What on the ESP-07 is software-controllable power-wise during startup and can be delayed until later? I suspect the main culprit here is the WiFi system initializing....

The main culprit is usually the attempted WiFi connection to a network, that is the one that draws up to 280mA temporarily. Still if that amount of current is not available, the ESP should not just crash.

The ESP is powered by 3.3v, i suspect through a linear regulator, that may provide less than 3.3v if it doesn't get the full 5v. Anyway, while i am writing this, i was thinking first to use a 555 timer circuit to drive the CP_PD pin (or RST, but the ESP-07S, which i suspect you may have) Has a PULLUP resistor on that, (the CH_PD / CE it is also called sometimes, may also have one i am thinking now.)
Then i thought, "How about an AtTiny13a to do what you can do with a 555 timer ? " It will start up from the 5v system early enough, and if you drive the ESP CH_PD through a voltage divider to reduce the voltage back to 3.3v you will be fine. You can start out with a 10 second delay, which probably will easily suffice.

a 555 timer will also work, but will require external parts and the timing will be partly dependant on the provided voltage.

Your big cap can be the problem here, drawing too much current when suddenly recharging.

A big delay statement as the first statement of startup, but that big CAP will still have an effect.

This is not exactly clear to me. If you need a 1000uF cap to handle the WiFi power surges, that actually is just an indication that you are anyway not providing quite enough current. The cap is a patch to the problem, and solves the WiFi issue, but the startup issue is a symptom of the same problem. The AtTiny13 patch will do the trick, you could also just run it at 3.3v, probably a better idea to have it on the 3.3v line, but you are just treating symptoms.

Well, after reading the replies/suggestions here and thinking a bit more on this I realized that my device board has a push-button on the reset line so I could simulate the delay on start by holding the button down when inserting the HAN cable into the electricity meter.

So I went out and tried that and by holding it down for half a minute after signal cable connect and then releasing it I saw the correct sequence of blinks on the LED on the board.
After I released the button I saw the normal startup which took 12 seconds (which mostly is the WiFi connect operation) and then the stable LED.
And when I returned inside I could see the MQTT data stream being logged!

So I am good for now but I need to harden the firmware by adding a long start delay on top of setup().

Yes, but the case I have here is that I cannot power the device from anything but the power lines in the HAN port of the meter itself.
In the meter box on the power-line pole there is no other power source available and I have two installations (the one discussed here and the one at home) which have the same power feed system but the utility companies use different meter brands and they behave differently on the 5V power output....
The one at home has never done this so that meter is better than the one at the summer home....

Anyway now that it is running I can modify the f/w and upload it OTA for testing. It has been rock solid except for the power outage restart....

Thanks for all suggestions!

Try to estimate the current draw to your capacitor when it's discharged.

How about a more efficient 3.3v conversion ?

Well, the 5V supply comes from the electricity meter on its HAN port and there is nothing I can do about that. Different meter makers have different limits on the supply for add-on devices...
If the devices draw too much the supply may drop or behave "strangely"...
I drop this to 3.3 V using two diodes in series.

Anyway, I have now looked again at the code I use on these interface devices and I noted the following:

  1. setup() starts with a delay(2000) in order to let the power supply stabilize. This might be too short.
    I will test how a change to 20000 ms will work.

  2. In loop() there is a delay(1) on top which has the effect of reducing power drain of the ESP8266.
    When I added that I saw a reduction of current use of about 60-70%.
    See: [ESP8266 Web Server Saves 60% Power With A 1 Ms Delay | Hackaday]

But this has no bearing on the startup problems since it is used as a way to force low power mode in regular operation after successfully starting up...

well there are way more efficient ways of doing that. Some with up to 93% efficiency, but the method you are using now is terrible. I suggest you use at the very least a linear regulator, which will at least most likely have a bigger range. Those 2 diodes just create a constant drop while the maximum for the LM1117 3.3v to-220 will get you a stable 3.3v at 4.4v already. Your input capacitor will be fine at even 10uF but probably 100uF is better, and with a 1uF output capacitor you should be able to power the ESP without issue also during WiFi connection.

The 2 diodes will have a fluctuating voltage drop even just because of a current increase and are really not suitable for this kind of thing. This is your issue and it should be easily solved with a linear regulator.

As i said there are even more efficient voltage converters, but i think in this case a linear regulatr will suffice.

You are quite correct, but where I am now at the summer home I have no parts to do the modification yet.
I have ordered by mail so hopefully in a few days following the holidy I could test.
Meanwhile I have checked the MQTT output from my reader and it outputs the main voltage at regular intervals. Turns out that contrary to the device (same design) running back home thus reports a very high supply voltage of 4.09 V whereas the one back home reports 3.46 V using the same flawed power circuitry with the two diodes.
The meters apparently supply different 5V feed voltages...
Will correct it ASAP with the linear regulator on order.

Thanks for your input!

What about adding a soft start to your circuit?

Either a thermister, or you could go a resistor in series, with a mosfet which is enabled and bypasses the resistor once your circuit is powered up.

The surge is going to be the initial charge of the 1000uf capacitor up to your voltage

Well,
I cannot easily modify the circuit since I am now far away from my electronics tools and components. But what I had in mind is some way in f/w to delay all operations directly following the reset such that they will not be done until the power has stabilized.

Question:
What if anything happens when reset is released before one gets into the setup() function? I have this at the top of setup():

delay(2000);
//Other startup code follows:

I believed that 2 seconds would be enough to charge up the 1000 uF capacitor...
Will code execution reach this setup() directly or is there something else happening in the sketch prior to this which then fails?

Anyway, I have now placed a mail order for the linear regulator and some items making it possible to replace the diodes on the board to get to a stable 3.3V supply. But that would not help unless the reset can be extended past the charge-up time of the 1000 uF capacitor, right?

PS:
The RST pin is connected via a 10 nF capacitor to 0V and a 15K resistor to the 3V3 supply line.
DS

There is quite a lot happening before the first statement in setup() is executed.

It will make a huge difference, since the linear regulator will start to provide a stable 5v from the moment that the voltage exceeds 3.3v + dropout voltage, which is significantly below 5v. With the capacitor being charged with an inverted logarythmic curve, this change will be significant.

Ok, I assume you meant
"provide a stable 3.3 V from the moment that the voltage exceeds 3.3v + dropout voltage"

This means that the ESP8266 will have 0V supply until the regulator input gets to the 3.3V+dropout and then it will be switched to 3.3V, right?

The regulator will apparently solve the problems as noted earlier.

eh yes sorry about that

No not quite, A lower voltage will be provided, being the Vin - drop-out voltage, and if the output capacitor is missing or to small (minimum is 0.1 uF, do not exceed 10uF !) it would be unreliable, but with the capacitor charging up to 5v in a logarythmic way, the time it will take to reach that level will be so much less than when it would aim for 5v - volatgedrop of the diodes, that even with a 1000uF you should be fine. That combined with the increase in voltagedrop of the diodes when there is a current increase, like you have now, i am confident that your issue should be resolved, though normally speaking a 100uF input capacitor should suffice. A linear regulator will be unaffected by voltage fluctuations on the input side (as long as the voltage stays within the window) and current draw. Your current setup is affected by both. The voltagedrop is 'fixed', so when there is less voltage on the input side, you will lose just as much on the output side, compounding the issue is the increase in the (actually not so 'fixed') voltage drop when there is an increase in current (this may be very little depending on the diodes used)

FOLLOW-UP
I have now received the 3.3V linear regulator and replaced the diode pair with that. Additionally I have added a 1K bleeder resistor across the 1000 uF capacitor on the 3.3V line to make sure it will discharge reliably if input power is lost.
And for good measure I also added a 1K bleeder across the input voltage from the electricity meter.
With that in place the device starts up as soon as the connection to the meter HAN port is established and it seems to work reliably now.

So I guess now this is fully resolved.
Thanks for the input!

Thanx for the follow up !