flash ESP32 or ESP32-CAM with arduino ide software

You are not alone if you meet a problem uploading a firmware bin file to an ESP32 development board. My advice is to try any suggestions that you find but then try something different altogether. Repeating the exercise on a different computer or PC/Mac is different altogether.

The following method is rarely suggested so I’ll record it here because it can work too.

Arduino IDE is one of a few software packages that lets us develop code for a writing on a chip. Explore its menu and we soon see it’s made to transfer a great many capabilities to a great many types of Arduino and ESP32 chips. The Arduino software might be dated but it’s also more mature. In topics nearby we use ESPHome to develop code, create firmware and then flash it to an ESP32. You can do that with Arduino IDE. (You also can do that with Visual Studio Code and the platformio plugin but I’ve found this hard to get this working).

connect your board and set your board parameters

Your ESP32 dev board (eg a mini MH-HT-LIVE) may already have a USB socket. If not, eg you have an ESP32-CAM, connect your to the computer USB with a FTDI UART module (pic below) – as you may have done before with ESPhome.

Go to the Arduino IDE Tools menu and set parameters to suit the chip you’re using. Set the ESP32 development board that you have and the frequency eg 40MHz and Flash mode eg DOUT. Turn on the serial monitor and if you can read the stuff there (when you press EN or Boot button, you’ve found a good upload speed). The Partition scheme will appear puzzling but either leave it at the default or look at the size of your firmware .bin file. If it’s huge choose the option for that size.

upload a BIN file to ESP32 using Arduino IDE

You can upload ESPhome firmware using Arduino IDE as an alternative using ESPHome Flasher (a process I outlined here). The ESPHome manual install option lets you download the firmware.bin file to your Desktop – do that first. In Arduino IDE first choose your board or simply choose ESP32 Dev module / Wrover module. Set the board parameters as in the section above.

See the pictures below: go to File > Examples and look for ‘OTA’ – you will at least find a basic webOTA program there. Scroll through the code and add your wifi credentials. Scroll further to find eg the default login credentials for the interface (eg user: admin/password: admin). Cross fingers and click the buttons to Compile / Upload the ‘sketch’ (program).

Turn on the serial monitor to see the stuff in the pic below. Go to your browser and enter http://192.168.1.x/ or whatever IP address shows there. Login (admin/admin) and Upload. Cross fingers. Share your advice in the comments below.

flash webcam software to an ESP32-CAM using Arduino IDE

Choose Camera webserver from Examples and you’ll see a window containing code. Continue as below.

The above shows how to connect an ESP32-CAM. A regular ESP32 board will have a USB socket.

Arduino IDE will have tons of example programs for your ESP32

Find your ESP32-CAM model in the code window shown above and make that model active (change the line to read from //#define to #define). Then add your home wifi and password. Validate the code and upload it to your ESP32. Within a few minutes your ESP32-CAM should appear on your network. Find its IP address and visit that IP address with a browser. For a clear tutorial see Rui Santos at Randomnerd or watch his helpful video below:

A remarkably easy to follow tutorial by Rui Santos who has published numerous tutorials and e-books.

Leave a Reply

Your email address will not be published.