Esp32-cam cannot load the program

Hi I'm Yago, I have an Esp32-cam with wifi module and I can't load the program. I have followed the steps of this web: https://pasionelectronica.com/esp32-cam-configuracion-previa/.
The error that appears in arduino is the following:

A fatal error occurred: Could not open COM6, the port doesn't exist
Failed uploading: uploading error: exit status 2

attached image

The loaded arduino prgorama is the example of arduino esp32 --> camera --> webcam. with the modifications explained on the web.

Does anyone know what I can do? Thanks

Hi @18yago01. ```markdown
Please tell us which USB to serial adapter chip your ESP32-CAM board has. This is a black chip near the USB socket.

The chip will usually be identified by writing on the top. This might say something like "WCH CH340G" or "SILABS CP2102".

Examples:

WCH CH340

📷

SparkFun - CC BY-SA 4.0 (cropped)

Silicon Labs CP2102

CP2102

📷

SparkFun - CC BY-SA 4.0 (cropped)


If it isn't clear, alternatively you can provide the link to where you bought the board from and we'll see if we can determine the chip from the product listing.

Adjunto fotografias y el enlace de compra de la esp32-cam. no consigo ver ningun codigo en el chip cerca de la pressa USB.

https://www.amazon.es/dp/B08X3GRK22/ref=sspa_dk_detail_3?pd_rd_i=B08X3GRK22&pd_rd_w=Jq7V7&content-id=amzn1.sym.9c67f205-18e7-4d34-beb2-37ec708092ed&pf_rd_p=9c67f205-18e7-4d34-beb2-37ec708092ed&pf_rd_r=Y3H9PVK8V2Z3H8ANKVNA&pd_rd_wg=5ghYE&pd_rd_r=4b395dec-9393-497d-a1ba-ddb34a64e79f&s=computers&sp_csd=d2lkZ2V0TmFtZT1zcF9kZXRhaWw&th=1



@18yago01 please use English when posting in the English language categories of the forum. You are welcome to compose your posts in Spanish and then use an automatic translation service like Google Translate to convert the post text to English before publishing your post.

If you prefer to use Spanish, there is a dedicated forum category for that language: Español


Now back to your problem. From the IC package, I can identify the chip as a CH340. Recently we have seen many reports of a driver problem causing unexpected upload errors occurring specifically when uploading to the boards that use the WCH CH340 USB chip (and apparently only specific batches of those chips).

When uploading to a board with an AVR microcontroller using the AVRDUDE uploader tool, we see the distinctive "can't set com-state for ..." error message. I haven't determined what error message might be produced by the equivalent problem occurring while uploading using a different upload tool such as the esptool tool used to upload to your ESP32 board. So I'm not 100% certain that your "the port doesn't exist" error has the same cause. The fact that your CH340 chip is unlabeled is further evidence that your error might be caused by this driver problem because the affected users often report their chips are also unlabeled.

The problem only occurs when using the latest version of the CH340 driver. The affected users have reported that doing a "roll back" to an older version of the driver was an effective workaround. You can give that a try.

I'll provide instructions:

  1. Open this tutorial from SparkFun in your browser:
    https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all#drivers-if-you-need-them
    We are using this tutorial as a source for an older version of the CH340 drivers. Generally I recommend only obtaining drivers from the manufacturer of the device, but WCH does not provide older versions of their drivers and SparkFun is trustworthy.
  2. Click the "Windows (EXE)" link you see in red under the "Drivers (If You Need Them)" section of the tutorial.
  3. Wait for the download to finish.
  4. Run the downloaded CH341SER.EXE file.
  5. A "User Account Control" dialog may now appear asking "Do you want to allow this app to make changes to your device?". Click the "Yes" button.
  6. A "DriverSetup(X64)" dialog will appear. Click the "INSTALL" button in the dialog.
  7. Wait for the driver installation to finish, as indicated by the appearance of a "Driver install success!" dialog.
  8. Click the "OK" button in the "Driver install success!" dialog.
  9. Click the X icon at the top right of the "DriverSetup(X64)" dialog to close it.
  10. Close Arduino IDE if it is running.
  11. Connect the Arduino board to your computer with a USB cable.
  12. Open the Windows Device Manager.
  13. Select View > Devices by type from the Device Manager menus.
  14. Open the "View" menu.
  15. If there is a to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
  16. Open the "Ports (COM & LPT)" section of the Device Manager tree.
  17. You should see a port identified as "USB-SERIAL CH340 (COM_n_)" under the "Ports (COM & LPT)" section (where "COM_n_" is some serial port e.g., COM4). Right click on that item.
    A context menu will open.
  18. Select the "Drivers" tab of the "USB-SERIAL CH340 (COM_n_) Properties" dialog.
  19. You will see a "Roll Back Driver" button in the dialog. If it is not clickable, perform the following instructions:
    1. Select "Update driver" from the context menu.
      An "Update Drivers Device - USB-SERIAL CH340 (COM_n_)" dialog will open.
    2. Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COM_n_)" dialog.
    3. You should now see the driver installation wizard update the driver. Wait for the update to finish, as indicated by the message "Windows has successfully updated your drivers" in the dialog.
      :exclamation: It is possible you will instead see the message "The best drivers are already installed". If so, please stop following the instructions here and reply on the forum thread to let me know. I'll provide alternative instructions you can follow.
    4. Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COM_n_)" dialog.
  20. Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COM_n_) Properties" dialog.
    The "Driver Package rollback" dialog will open.
  21. Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
  22. Click the "Yes" button.
  23. Click the "Close" button in the "USB-SERIAL CH340 (COM_n_) Properties" dialog.

Now start Arduino IDE again and repeat whatever you were doing before when you encountered that error before. Hopefully this time you will not encounter that "the port doesn't exist" error during the sketch upload.

Hi, I'm stuck at step 19, I get The best drivers are already installed.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.