0
votes

I cannot upload to various Wemos D1 mini or ESP32CAM boards from my desktop. Tried different USB ports, cables and upload speeds. I can upload without issue to Arduino Uno, and Lolin D32 Pro.

All boards upload fine using my laptop. Both machines are linux mint.

On the failing desktop, with the ESP32CAM connected through Sparkfun FTDI Basic, I see in dmesg:

[179321.007480] usb 6-1: New USB device found, idVendor=0403, idProduct=6001
[179321.007484] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[179321.007485] usb 6-1: Product: FT232R USB UART
[179321.007487] usb 6-1: Manufacturer: FTDI
[179321.007488] usb 6-1: SerialNumber: AH00SB1U
[179321.020711] ftdi_sio 6-1:1.0: FTDI USB Serial Device converter detected
[179321.020762] usb 6-1: Detected FT232RL
[179321.025589] usb 6-1: FTDI USB Serial Device converter now attached to ttyUSB1

The Arduino IDE fails to upload with "Timed out waiting for packet header" message.

The FTDI 5V pin shows 4.93 volts, when connected to the ESP32CAM.

I tried using an Arduino Uno with the Atmel chip removed as an FTDI, and get:

python ~/.arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 /home/bill/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/partitions/boot_app0.bin 0x1000 /home/bill/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/bin/bootloader_dio_80m.bin 0x10000 /tmp/arduino_build_491896/WiFiScan.ino.bin 0x8000 /tmp/arduino_build_491896/WiFiScan.ino.partitions.bin 
esptool.py v3.0-dev
Serial port /dev/ttyACM0
Connecting........_____....._____....._____..
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 8c:ce:4e:8a:b0:78
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
A fatal error occurred: Timed out waiting for packet header
A fatal error occurred: Timed out waiting for packet header

When it was doing "Connecting.................._____..", I pressed the ESP32 reset button.

Any ideas?

1

1 Answers

0
votes

I think it is your desktop having weak power on the USB port. The voltage might look OK on a multimeter but if you were to look at it with an oscilloscope you will likely see short duration dropouts. I have encountered a similar problem programming EspCam from a small laptop. I would suggest trying these options:

  1. A low ESR electrolytic of about 100uF between the 3.3V pin and ground
  2. Try using a better USB cable.
  3. Use a powered USB hub as an intermediate between the PC and the FTDI
  4. Make sure the leads from the FTDI to the ESP are short and not very thin.

You could also place the electrolytic on the 5V pin instead of the 3.3V. It would be better for the ESP but the PC might not like it as it exceeds the value allowed by the standard, so it may work but it may even cause the USB port to lock up and require a restart to get it working again.