• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Error compiling sketch for esp-32-cam

Q&A Forum › Category: ESP32 › Error compiling sketch for esp-32-cam
0 Vote Up Vote Down
Mike McKinney asked 3 years ago

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”

Used: C:\Users\TheRa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi
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.

12 Answers
0 Vote Up Vote Down
Mike McKinney answered 3 years ago

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.

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Mike.
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.
Regards,
Sara

0 Vote Up Vote Down
Mike McKinney answered 3 years ago

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.

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Mike.

Do you have that same error on both sketches?

That’s weird.

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?

Regards,

Sara

0 Vote Up Vote Down
Mike McKinney answered 3 years ago

Hi Sara,
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.
Mike

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Mike.
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?
Regards,

Sara

0 Vote Up Vote Down
Mike McKinney answered 3 years ago

Hi Sara,
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

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi Mike.
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.
Regards,
Sara

0 Vote Up Vote Down
Mike McKinney answered 3 years ago

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!
Mike

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Thanks 😀
If you need further help, just ask.
Regards,
Sara

0 Vote Up Vote Down
Mike McKinney answered 3 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi 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.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.