I wanted to share what I’ve found while working with an ESP32-CAM with an ESP32-CAM-MB board. I posted(Edge-impulse-deamon timeout (ESP32-CAM, Raspberrypi)) two weeks about about timeout issues I experienced with edge-impulse-daemon and my ESP32. Since then I’ve gone deep into a rabbit hole and this is what I’ve found.
The TLDR version is that the ESP32-CAM-MB board uses DTR and RTS to reboot the ESP and control which mode it boots into. If DTR is on and RTS is toggled on then off, it boots into ‘code upload’ mode. If DTR is off and RTS is toggled on then off, the ESP boots into normal mode. If RTS is on, no output from the serial port is seen.
You can see this by using GTKTerm on a Raspberry Pi - it allows direct control of DTR/RTS. I was also able to replicate these results by using a short Python program:
#!/usr/bin/env python3
import serial
if __name__ == '__main__':
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1, rtscts=False)
ser.reset_input_buffer()
ser.setDTR(True)
ser.setRTS(True)
ser.setRTS(False)
while True:
if ser.in_waiting > 0:
line = ser.readline().decode('utf-8').rstrip()
print(line)
Could edge-impulse-daemon and edge-impulse-uploader be updated to include a flag that would result in DTR/RTS being manipulated in this fashion? That would be a huge assist for those working with the ESP32 and these boards.
thx
Hi apineda
I’m using the AI-Thinker ESP32-CAM. The edge-impulse-daemon did not find the board - it doesn’t return anything on the serial port as long as RTS is held high.
Sorry, I didn’t pay attention to your ESP32 model very closely.
I tried to manually toggle the buttons on a plain ESP32 while the daemon was trying to connect. I did not have any luck in getting it to work.
Thank you for the recommendation. We likely will not be able to add this ability, as we only officially support the ESP-EYE for now. There are a few options that I recommend:
You can manually trigger the bootloader by tying IO0 to GND. Please see this tutorial: How to Program / Upload Code to ESP32-CAM AI-Thinker (Arduino IDE) | Random Nerd Tutorials. On my AI Thinker ESP32 board, I added a button between IO0 and GND and a power switch. That way, I can hold the button and toggle power to enable bootloader mode before programming. This has worked well for me (programming via Arduino and from ESP-IDF).