These are the products I’m working with: AI-Thinker (&clones) plus Programmer
… and while it works as a programmer, I can’t use the programmer as a carrier & PSU.
This is because, I think that the CH340 UART is holding the GPIO0 line low (in programme mode) via the DTR control (Pin13).
I understand that the Arduino IDE has instructions to manage the UART DTR & RTS line.
Are there similar controls hiding deep within the ESPHome environment?
My apologies. Please let me add to the above introduction.
I would like to use the ESP32-CAM while it is sitting in the programmer as that offers a convenient USB socket. However, by trial and error I have found that this works:
Note: Now (the blue wire) is connecting the GPIO0 lines between the programmer and the CAM.
Based on the information here, it seems that the ESP32-CAM-MB drives the GPIO0 line from Pin13 (DTR) of the CH340 UART chip.
I could cut the GPIO0 track on the programmer board. But a more sophisticated approach may be to control the DTR line from within the ESPHome code?
I also note that the Logger Component has an optional configeration variable called deassert_rts_dtr: true|false. I have not been able to change the behaviour of the CH340 DTR pin using this command.
This is my yaml:
# Enable logging
logger:
level: VERBOSE
#tx_buffer_size: 256
deassert_rts_dtr: true # ... or false - has no effect?
logs:
status_led: NONE #Hide the on/off message from the GPIO33 status led
Is this the (only) way to control the DTR pin or am I doing it all wrong?
I cannot work out why you want to connect the two boards after the first flash. At that point you don’t need the programming board. Updates are via WiFi. Logging is via WiFi.
I would suggest to use any 5V wall adapter and simply strip any USB cable and (using one of the many spare dupont connectors) connect GND and 5V (to Vin) to the ESP32-CAM board.
Keep in mind some USB wall adapter want the two USB datalines shorted together to work.
Programmers like these are not intended to be integrated with the final project, but to be used many times for all the projects you wanna make!
Edit: all ESPs have current spikes while exchanging wireless data, but especially the CAM versions since video streaming is particularly energy intensive. If you notice sporadic behaviors, consider adding the biggest capacitor you have between GND and 3V3