When in doubt, slow your ESP32 CPU down

I’m doing some work with this little thing. The aim is to make it work with my Bluetooth printer so that I can take pictures and print them. While I was getting it going I got frustrated by the way that the camera connection kept failing.

At first I thought it was a brownout problem caused by insufficient power over the usb connection. I’ve got a fix for that here.

But no, even with a healthy power supply the problem kept recurring. So I tried something different. I turned the speed of the CPU. My theory was that if the camera was being a bit slow responding to requests from the ESP32 it might be a good idea to slow those requests down a bit.

It worked a treat. You can see how to do it in the Arduino SDK above. This does of course mean that the program will respond a tad slower but I’ve not found that to be a problem. If you’ve got intermittent behaviour in your device you might like to try it. It has the added useful side-effect of reducing power consumption.