• 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

Esp32 cam serial communication

Q&A Forum › Category: ESP32 › Esp32 cam serial communication
0 Vote Up Vote Down
John Walker asked 1 year ago

I am working with the Camera server and would like to print some data to the serial monitor.  Specifically I would like to transfer the x,y coordinates of the bounding box around a face.
when I insert a Serial.println statement I get an error stating that “Serial” is not declared in this scope.  Is there a way to serial print from the camera server or can data be passed to the main loop where Serial is declared?
Thanks John

Question Tags: Esp32-cam serial print
5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
Did you initialize Serial communication using:
Serial.begin(115200);
 
Regards,
Sara

0 Vote Up Vote Down
John Walker answered 1 year ago

Hi Sara
Yes I have Serial.begin.  I’m using the code as downloaded from your website.  The streaming service, Face ID etc is all working.
My first attempt was to insert a Serial.print statement at line 230 of app_httpd.cpp.
That returned the error that “‘Serial’ was not declared in this scope”

The second thing I tried was to declare an int variable ‘xpos up front in CameraWebServer.ino and then assigned it the value of x at line 230 of app_httpd.cpp. That returned the same error “xpos was not declared in this scope.
I can Serial.print a message in loop()
Thanks for any help
John

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
You need to include:

#include <Arduino.h>

at the top of the app_httpd.cpp file.
Then, call:

Serial.begin(115200);
Serial.print("TEXT YOU WANT TO PRINT");

 
To use variables across files, read this discussion:
https://forum.arduino.cc/t/passing-variable-froma-cpp-file/465076/2
 
I hope this helps.
 
Regards,
Sara

0 Vote Up Vote Down
John Walker answered 1 year ago

Sara
The #include statement did the trick.
Thank you!
John

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Great.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
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

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

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

Copyright © 2013-2025 · 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.