Arduino: 1.8.10 (Windows 10), Board: “AI Thinker ESP32-CAM”
sketch_nov04a:276:2: error: expected unqualified-id before ‘-‘ token
Multiple libraries were found for “WiFi.h”
Not used: C:\Program
exit status 1
expected unqualified-id before ‘-‘ token
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.
I am totally new to using any coding language so please bear with me. Looking at the sketch for the tutorial I am working on there seems to be more opening curly brackets than there are closing brackets. I am not sure what kind if error this would throw if any.
What project are you trying to run?
That seems to be a syntax error. That usually happens when our readers forget to copy some part of the code. Please ensure that you have copied all the lines to your Arduino IDE.
I have tried to run two projects, esp32-cam to take a picture and save to micro sd card and also the project utilizing a web server. I copied the entire sketch so that I did not miss anything. I did notice that some of the code does not utilize both an opening curling bracket and an ending bracket. There again I don’t pretend to know much about coding. Thanks for your quick response.
Do you have that same error on both sketches?
I’ve tried to compile the sketches and they worked fine.
Can you tell me some lines that you see that don’t have both opening and closing curly bracket?
Which version of Arduino IDE are you using? Can you update your Arduino IDE and see if that solves the issue?
Thanks for the response. I have tried the sketch for the ESP32-CAM Video streaming web server(works with Home Assistant) randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/ and the tutorial ESP32-32 take photo and save to microsd card https://randomnerdtutorials.com/esp32-cam-take-photo-save-microsd-card/#more-85920
In the first sketch and at at end you will notice that there is a closing curly bracket but no opening bracket in the six lines above it. Above that one about 45 lines there is another one that is doubled.
The next sketch does not have as many, but one is near the bottom and at least on about a third of the way down. Thanks again.
I’ve tested the sketch and everything is working fine.
Can you copy the code from here: https://raw.githubusercontent.com/RuiSantosdotme/ESP32-CAM-Arduino-IDE/master/ESP32-CAM-Video-Streaming/ESP32-CAM-Video-Streaming.ino
Also, which version of Arduino IDE are you using?
When you get the error, it should highlight the line that is having the trouble. Can you see that line?
I found the biggest problem, that being a dash at the very bottom of the window. I am not sure when or why I put it in. Probably due to the medications I am on after rolling my car. I had video stream for a while but lost it. Is it possible to reload the sketch without damaging the esp32 card? Also I am using Arduino IDE version 1.8.10
I’m so sorry for your accident. I hope everything is getting good now.
Yes, you can reload the sketch. If you press the ESP32-CAM reset button, the esp32 restarts.
Or sometimes, you just need to refresh your browser and the video streaming continues.
To improve the quality of the video streaming and prevent lagging, I advise getting an external antenna for your ESP32-CAM, if it doesn’t have one already.
Thanks for the response. I will try an antenna when it gets here. I ordered a boat full of parts off the list your or Rui sent to me.Ok I am going reload everything and try that. Your the best!
Hi Sara, I did finally get the sketch to upload. I got the message \”leaving… Hard resetting via rts pin \” i removed the wire on the GPIO 0 and grd and pushed the reset button. The serial monitor printed some lines but not the ip address and after that a continuous stream of dots. I can push the reset button and the flash goes off like it is taking a picture but nothing is saved. Any ideas? Mike
If you have a stream of dots and nothing happens, it usually means that you’ve forgotten to insert your network credentials or you’ve typed them wrong.
Additionally, it may also mean that you are very far apart from your router and it is not able to get wi-fi signal.