Solved: ESP32 Sketch Won't Compile or Upload in Arduino IDE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
of all the microcontrollers i've used the esp32 was the most difficult to get working if you just bought an esp32 and can't get it to work then here are some things to try the first thing to do is to check your cable seriously the issue is that most mini b usb cables are manufactured just to supply power to usb devices most of the cables you have lying around your home are not designed to carry data therefore they will not work with the microcontroller this cable came with a pollution detector and this one came with a usb lamp the only one that actually worked for me was this one that came with my playstation 4. the next thing you need to do is to make sure you have the correct board selected in the arduino ide my particular esp32 is an az delivery room 32 bought from amazon i found that i had to add an additional board manager url by going to file then preferences and pasting in this url incidentally if you already have some urls in this box you can separate them by commas i'll put a link to the esp32 board manager url in the description below keep watching if you do already have board managers listed here later i'll explain why ide conflicts were the primary reason my esp32 wouldn't work so once you've added the new board url then go to tools then board and select the board manager type in esp32 and you should see the esp32 board listed make sure it's the expressive systems one if it's not installed then click on install the exact version shouldn't matter once it's installed you can go to tools and then board and select the esp32 arduino option this should give you a long list of vsp 32 boards have a good look through list list because you might be able to see your specific board listed if it's not then try the top one the esp32 dev module first this one worked for my amazon bought esp32 once you've selected your board it's time to compile a sketch and upload it to the esp32 do this by going to file examples and then esp32 there are quite a few examples listed but i recommend starting with either the hall sensor or the simple time one the whole sensor is easiest to get working just upload your sketch to the esp32 and open the serial monitor from the tools menu remember to change the baud rate in this window to 9600 if it works then you should see a long stream of numbers in this serial monitor window apparently you can see the numbers change if you wave a magnet near the esp32 but what the numbers mean isn't really important what's critical is whether the sketch actually uploaded and ran on the esp32 another good sketch to try is a simple time one just remember to edit the top ssid and password strings and put in your wifi's credentials once you upload this sketch you should see the current time listed in the serial monitor once that's working you're then ready to start exploring the esp32's powerful networking features unfortunately my dev environment was a complete mess so neither of these simple sketches would actually compile for me more on that later one huge issue you may encounter with the esp32 is that your computer can't connect to the esp32 via the usb cable i've already mentioned checking your cable in the arduino ide it's important to check you're using the right com port something i didn't know was that to upload a sketch to the esp32 you may have to hold down the reset or boot button on the device itself while you're compiling the code this is normally the button to the right of the usb power cable you can release it again once the code starts uploading to the esp32 one final issue i'll mention is weird errors while you're compiling a sketch these appear in the black part of the ide i didn't actually know this but if you drag part of the window up you'll see more details of the error i got this error message and the general consensus about these types of error is that they appear if the arduino ide's libraries are corrupted the way i resolved this was to completely uninstall the arduino ide and then reinstall it by the way after removing the ide using ad remove programs you'll also have to go into the c drive users directory and delete the arduino folder from the local subfolder of the app data subfolder under your particular windows username just remember to backup any of your sketches if you want to keep them after i did that and rebooted i reinstalled the arduino ide remembering to add in the esp32 board manager again by the way never use the windows app for arduino development the app is rubbish because it's impossible to locate where the files are stored always download the old installer and then install it into the program files directory i'll also suggest that you'll potentially make trouble for yourself if you use the arduino ide for developing on all kinds of boards it's probably a good reason to pick one particular board you like and then develop apps solely for that board while i love the arduino i was seduced by the esp32's wi-fi capabilities a much larger memory after watching this far i hope you've got your esp32 working with your pc and arduino ide if you're still having issues then drop a comment below and hopefully one of our viewers will point you in the right direction thanks for watching
Info
Channel: Coding With Brett
Views: 17,186
Rating: undefined out of 5
Keywords: arduino ide, arduino ide esp32
Id: 5RWVUrV5uvI
Channel Id: undefined
Length: 5min 1sec (301 seconds)
Published: Thu May 05 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.