Notifications
Clear all

ESP32-Cam not responding after successful compiling and download

32 Posts
3 Users
0 Likes
5,903 Views
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

The ESP32s-cam board is not AI Thinker but has a name “agoal”. 
I successfully compiled and downloaded the sketch that has the AI Thinker link. I disconnected the USB, removed the jumper, reconnected the USB and pressed the reset button. The video demo showed a new window revealing the WiFi IP address of the board but no box showed on my screen and nothing else happened so I don’t know if the camera is working.
Do I have to order an AI-Thinker brand ESP32-cam? How can I open the window showing the IP address?
I would appreciate and help or suggestions.
Thanks


   
Quote
(@davee)
Member
Joined: 3 years ago
Posts: 1606
 

The ESP32-CAM boards I bought were not labelled 'Agoal'; mine have an AI logo on the metal lid, so I can't offer direct experience on that aspect. However, a quick Google of reviews on Amazon, etc., suggested several people had made their 'Agoal' board work when 'AI thinker' was selected, so maybe that is a guide. However I noted most reviews were dated 2019, so things may have changed.

To your more specific question relating to the new window ... 

  • I suggest adding a couple of printf lines to the main CameraWebServer code, to show how far it has got in void setup(); function:
  • After 'Serial.setDebugOutput(true)'; put Serial.printf("CameraWebServer program starting \r\n");
  • Just before 'WiFi.begin(ssid, password);' put Serial.printf("Camera initialised ...  begining WiFi initialisation\r\n");

 

  • power up your board (after programming, and removing the programming select link)
  • go to Tools and click 'Serial Monitor' to open the window
  • go to the bottom right of the new window and select '115200 baud'
  • then click the reset button on the ESP32-CAM board

You should then see

  • about 10 lines of 'unfriendly' initialisation stuff
  • the two print lines you just added
  • a few dots followed by WiFi connected, etc including the http address to go to for the camera program

if you get a long list of dots after your '.... beginning WiFi initialsation message', then the ESP board is not managing to negotiate a connection with your router.

Bill's excellent YouTube 'ESP32 CAM - 10 Dollar Camera for IoT projects' is obviously the first place to look. However, if (like me), you haven't played with the ESP32 before, then his earlier YouTube 'Introduction to ESP32 - Getting Started' is also essential viewing.

I hope that you are now successful. Whilst faulty boards are always possible, the chances are the board is fine and you have a small problem to fix. Good luck!!


   
ReplyQuote
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

@davee

Thanks again

both prints showed

there Was a message of  Brownout detector was triggered

then it said the Detected camera not supported

Do I need a USB POWER SUPPLY 

OR SHOULD I SWITCH FROM 3.3 to 5 volts

thanks

Joel


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1606
 

My setup worked with just 3.3V, although there are sometimes a few 1 pixel height horizontal lines across the picture. I haven't proceeded beyond replicating Bill's video, so I have only limited direct experience of this product.

A 'quick and free' change I made, was to swap the power connection between the USB and ESP boards from the 3.3V pins to the 5V pins, but it made no discernable difference. Note the USB interface selector (usually a jumper on the USB board) should be left at 3.3V. Assuming your USB programming board has a 5V output pin, you could try that first. (Of course all that simple change is doing is using the 5V->3.3V regulator on the ESP card instead of the 5V-3V3 regulator on the USB card, to power the ESP card, but it might help.)

In your position, my next move would be to provide a separate supply, and as Bill points out in his video, USB hubs with power input are a simple way to achieve that.

Alternately, you might consider an independent 5V (or maybe 3.3V), supply going straight to the power input pin of the ESP board. In this case make sure the 3.3V or 5V connection between the ESP and USB boards is removed. You might have an old phone charger or maybe Raspberry PI supply that would be suitable? I wouldn't bother even trying any rated at less than 0.5A output, and obviously they need to be 5V, so it is down to luck what you have in the cupboard.

If it still fails with separate supply, I might consider adding some decoupling capacitor(s) to the power rails on the ESP card. My natural cynical approach is that larger capacitors cost more, so they will be skimped - but of course that maybe prejudice on my part. NB, it looks like the ESP card circuit is on the web... e.g. https://www.reddit.com/r/esp32/comments/b6wyjt/aithinker_esp32cam_schematic/ ... of course yours might be different but hopefully that is a guide.

Clearly you need to fix 'brownout warnings' first. If you clear them, but still get camera mismatch warnings, then I guess you are into software tracing to try to discover the nature of this mismatch.. but you are not there yet and it may all fix itself in one go.

And a 'safety/wealth note' when adding in other power sources - remember that the 5V line on the USB card connects into your PC, where it probably connects to many '5V' devices inside the pc .. so accidentally applying a voltage greater than 5V to this line could destroy your PC. (Check any external supply before connecting!)

Once again, I hope this helpful and wish you good luck.


   
ReplyQuote
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

@davee

most appreciated!

I tried connecting the 5 volt from the FTDI to the 5volt on the ESP32 but that didn’t work. I ordered a power hub to try to eliminate the brownout. I should have this tomorrow.
I have another ESP32-cam board with no name that I also got from Amazon but it has the same camera included. I’ll try that later.

As the ultimate I ordered a real AI Thinker board but it won’t be delivered for about 3 weeks.

I’ll keep you informed
Joel 


   
ReplyQuote
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

Hi again

I got rid of the brownout but now it says that the camera is not supported.

is the different software for different cameras?

I did order a real AI Thinker board but it wont arrive until June 17.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1606
 

Sorry to hear that you still have problems. As I said at the begining, my experience is limited to just one board (Geekcreit from Banggood), which seems to believe it is an AI Thinker, but clearly there are several alternates, and probably countless copies of these alternates. 

(NB I am adding spaces to Web URL refs below to try to stop this post autodownloading from the site.)

A discussion at https://    diyprojects.io/esp32-cam-pins-and-equipment-esp-eye-ai-thinker-ttgo-t-camera-m5stack-timer-camera/

compares a few types. Note it starts with "Even though all ESP32-CAM development boards share the same C ++ (Arduino) code, each manufacturer has connected the camera module to the pins of the ESP32 differently." It also gives a guide as to how some of the alternates differ in ability, price, etc. No doubt there are other guides as well. Wikipedia also mentioned Arducam.

---------

The above guide implies that your board might have the same camera module type, but connected to ESP32's IO pins in a different order. Hence, if the order for your board is different from AI Thinker order, then it is unlikely to pass the initilisation code checks when your code is configured for AI Thinker.

I have looked, but so far failed, to find a convenient method of determining which board you have. The Arduino script GetChipId lists the processor type, but the board module type refers to the connections of the processor to the rest of the module.

--------

I found some camera source code (which I assume is representative of downloaded code) at: https://  github.com/espressif/esp32-camera/blob/master/driver/esp_camera.c

...  at first glance this can detect a few different cameras ... but obviously, only if the connections are correct.

--------

If you decide to get another board,then obviously make sure it is one that matches to one of the '#define' lines!!

AT YOUR OWN RISK, you might adopt a 'try and see' approach for each of the short list of alternative '#defines' under 'Select Camera Model' at the start of CameraWebServer code, in the hope one will work. Obviously, this may break the camera and/or the ESP32 processor... or it may already be broken.

Alternately it might be possible to probe the connections, assuming you can identify the processor pins, but beware of putting a 'high' (compared to 3.3V) voltage from your multimedia when checking for continuity ... many multimeters use a 9V battery! That could involve writing some pin level debug software to identify the pins.

 


   
ReplyQuote
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

It works

I heard Bill say his power usb hub is 5 V so I moved the jumper on the FTDI board to 5v and changed the female connector to 5 v on the esp32-cam and the WiFi address for the camera came up on the Serial Monitor. 
thanks for your help and encouragement. 


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1606
 

@drjoelleon  Congratulations on getting it to work!

You may wish to move on from your success, but I am one of those people who can't resist trying to understand what is really going on, so I hope you won't mind if I share my thoughts and confusions. Please feel free to ignore them and apologies in advance for any errors in my musings ....

---

I haven't made any measurements of the signals ... and of course both the ESP and the FTDI boards were obtained from different suppliers, so may have different circuits ... but I think some further checking may be useful... and may help some others, in the future.

-----

All of the data I can find on the ESP32 chip e.g. https://  www.es.co.th/Schemetic/PDF/ESP32.PDF, suggests that it's expected to be powered by 3.3V, with absolute maximum voltage on I/O pins as 0.3V above the power voltage (3.6V).

The circuit for ESP32 CAM schematic (link below). So far as I can see, the 5V input is only supplied to the AMS1117 regulator - implying the rest of the circuit is a '3.3V'

https://  www.reddit.com/r/esp32/comments/b6wyjt/aithinker_esp32cam_schematic/?ref=share&ref_source=embed&utm_content=body&utm_medium=post_embed&utm_name=599633c777b4485abc49ac4bedef9054&utm_source=embedly&utm_term=b6wyjt

Hence, I am very suspicious of any suggestions that the interface signals (excluding the 5V power line) to the ESP32 board should exceed 3.3V

Now, if the Tx signal from the FTDI board to the ESP32 board is set to a 5V signal level, the ESP32 may 'survive' if the ESD protection diodes can draw enough current to clip the effective interface signal level down to about 3.6V. Of course, this will stress both the FTDI driver output and the ESP chip, so either may fail prematurely.

-------

You said that changing to a separate 5V power supply 'fixed' the brownout problem, but you were left with the program reporting that it failed to identify the camera.

This situation seems curious. I maybe mistaken, but so far as I can see, the FTDI interface does not use the Tx output when the camera program is running and the Rx is only used to print status messages to the monitor, so why should the camera detection part of the code be affected by the interface voltage, assuming you were powering the camera from a separate 5V supply in both cases?

We should also consider that a problem might have occured during the prior program upload phase, resulting in a corrupt program which cannot initialise the camera. I haven't discovered how thoroughly the programmimg step is checked, but I did notice that it reports a 'hash' check which I would hope detect any difference between the code on your PC and the code in the ESP chip. (I also think Bill mentioned in his video that the programming step seems more robust than when the program is running.)

Furthermore, from your description of the status monitor,  it sounded like the program was following a 'sensible' path .. ie reporting what was going on. Whilst certain changes like a data value might cause this effect, it is more common for a memory code corruption to completely disrupt the program flow.

--------

So what might be happening? A long shot suggestion is that power arrangement on the ESP board is marginal (e.g. poorly decoupled or regulated voltage dipping), and that applying 5V to I/O is actually supplementing the chip supply via the internal ESD protection diodes.

------

Please let me know you impressions and anything you discover.

Best wishes.


   
ReplyQuote
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

My knowledge of the boards is very limited but I can guess because I tried sooooo many variations.

I think that Bill said the WiFi consumes a lot of power but the rest of the board requires the 3.3 volts. So the program actually needs 3.3volts plus. When it needs more power, it can’t initialize the camera correctly and the system crashes. It actually never got to the WiFi because the assigned address never printed out. 
The esp32-cam may have a voltage regulator to protect itself otherwise why would it accept too much power that would damage itself. It’s been 50 years since I studied electricity but can the board need more amps at the 3.3 volts. There must be another factor at play. Maybe I’ll study up on current, E=IR?

I now have another problem to solve. I plan to use the camera in a dark hatch and need the LED to turn on with the camera. Any suggestions?


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1606
 

@drjoelleon  Hi again,

I quite understand you wishing to follow your main project scope, although I am concerned that your ESP32 may prematurely expire, which would be frustrating if you have physically embedded it into its surroundings and is difficult to replace. Unfortunately, I do not have enough information to predict whether 'premature' is 10 minutes or 10 years.

In response to your LED question, I had a quick Google and found https://  github.com/easytarget/esp32-cam-webserver/blob/master/README.md

It seems someone has hacked the camerawebserver code and included a number of improvements ... including a slider function to control the LED brightness. As you will already have spotted, the code visible in the Arduino editor is only the tip of the iceberg .. the main work is done in the precompiled C++ which this refers to, so if you are like me, and haven't yet ventured that deep into Arduino territory, there may be some discovery to do. Please let me know how you get on.

---

As it happens, the above reference includes the advice 'Be careful not to use a 5v serial adapter since this will damage the ESP32.', which concurs with my concerns. The following may not be of immediate interest, but  I hope will be useful in the future.

Briefly, most electronic chips include transistors with high impedance points (e.g.  gate input of a FET) which can easily be damaged by static electricity generating a sufficiently high voltage to permanently break down the insulation. The near universal solution is to connect each external I/O pin to two diodes, as shown in the sketch below labelled for a 3.3V chip.

ESD chip protection

You may remember a diode acts like a one valve, allowing current to flow when the voltage on the anode (back of the arrow) is positive compared to the cathode, but not when the voltage is negative. In practical terms, a silicon diode, of the type discussed here, will start conducting appreciable current when its anode is about 0.6V positive of its cathode.

 The idea is that in 'normal' operation, when the voltage on the input pin is between 0V and 3.3V, both diodes are 'reverse biased', so that they are not conducting, and 'ideally' do not affect the incoming signal. However, if the voltage on the input pin goes below 0V, or above 3.3V, then one of the diodes will become forward biased and divert current to the appropriate power rail, and hence attempt to 'clamp' the input pin to a range of roughly -0.6V to 3.9V. Of course, these diodes are relatively small, so if the incoming 'out of range' voltage is from a low impedance source, it may result in a large enough current to destroy the diodes and nearby structures in the chip.

A curious part is that if the Vcc pin has been left disconnected, so that its voltage is nominally zero, whilst the input pin is driven to near 3.3V by the external circuit, it is possible to partially power the entire chip. Obviously this is not 'recommended practice', but has been known to catch out the odd engineer when trying to debug a circuit!

The problem that these CAM boards appear to be prone to is that some parts of the ESP chip can demand high peak currents. This can result in the 3.3V supply momentarily dipping below 3.3V (Yes a case of  E=IR, where R is the impedance of the power supply path and E is the voltage drop across that path!!). Decoupling capacitors placed between 3.3V and 0V pins are needed to reduce the 'effective R'. It seems these have been skimped .. maybe some can be added if you can do the necessary microsurgery!

------

Good luck with your project!!


   
ReplyQuote
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

Dave

great information, thank you.

Tonight I will try using the power hub but leave the 3.3volt connection. I know I tried it before but perhaps I inadvertently modified the software since that first attempt. I’ll let you know.

Joel


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1606
 

@drjoelleon Joel,

  Thanks for your kind reply.

  Good luck with your trial!. Depending on how you get on, you might consider trying the board with just the 5V supply and the FTDI board disconnected. Obviously this means you will not have a monitor, but if the processor works properly you only need WiFi. I am assuming you can predict the IP address. For my test, I set my router to spot the CAM board's MAC address and allocate a specified IP address. To do this I manually spotted the MAC address in my router's admin program when it had auto-allocated an IP address.

At one point I saw a MAC address  on the Arduino monitor, but it didn't seem to be the same one, nor did it work! I didn't spend any time finding out why.- might have been user error

Alternately, you could try setting a fixed IP address by adding to the Arduino code. I have read, but not tried: https://  randomnerdtutorials.com/esp32-cam-static-fixed-ip-address-arduino/

By the way, a warning I meant to say earlier. Beware of using your main 'house router', at least in a long term arrangement. A number of the 'house security cams' have been cracked, including some market leaders They have then provided a means for the bad side of the Internet with a means of breaking into people's local network -- e.g. the intruders have managed to discover the router login password. I am not aware of any specific vulnerability but doubt if it has been checked.

Best wishes, Dave


   
ReplyQuote
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

@davee

ill let you know


   
ReplyQuote
(@drjoelleon)
Member
Joined: 3 years ago
Posts: 41
Topic starter  

@davee

I just got home. I changed the jumper on the FTDI BACK TO 3.3 and switched the wires on both boards back to 3.3, I did not recompile the software. It  Did NOT work. THIS IS CRAZY. 
Do you think Bill will see and comment on this problem?


   
ReplyQuote
Page 1 / 3