• 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

compilation warnings and error. ESP32-CAM Projects v1.3

Q&A Forum › Category: ESP32 › compilation warnings and error. ESP32-CAM Projects v1.3
0 Vote Up Vote Down
Bruce Develle asked 6 months ago

I received the following warning from the compiler about deprecated variable names. It occurs in the files:
Video_Streaming_Web_Server.ino
Video_Streaming_Web_Server_Sensor_Readings.ino
I had to change the variables in the code from:
config.pin_sscb_sda = SIOD_GPIO_NUM;
config.pin_sscb_scl = SIOC_GPIO_NUM;
to:
config.pin_sccb_sda = SIOD_GPIO_NUM;
config.pin_sccb_scl = SIOC_GPIO_NUM;
(i.e. …sscb… to …sccb…)
The warnings disappeared after the change.
Compiler warning:

D:\embedded_projects\Random Nerd Tutorials\Video_Streaming_Web_Server.ino: In function 'void setup()':
D:\embedded_projects\Random Nerd Tutorials\Video_Streaming_Web_Server.ino:302:10: warning: 'camera_config_t::<unnamed union>::pin_sscb_sda' is deprecated: please use pin_sccb_sda instead [-Wdeprecated-declarations]
302 | config.pin_sscb_sda = SIOD_GPIO_NUM;
| ^~~~~~~~~~~~
In file included from D:\embedded_projects\Random Nerd Tutorials\Video_Streaming_Web_Server\Video_Streaming_Web_Server.ino:9:
C:\Users\bruce\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-33fbade6\esp32/include/espressif__esp32-camera/driver/include/esp_camera.h:123:13: note: declared here
123 | int pin_sscb_sda __attribute__((deprecated("please use pin_sccb_sda instead"))); /*!< GPIO pin for camera SDA line (legacy name) */
| ^~~~~~~~~~~~

Also, an error occurs in Video_Streaming_Web_Server_Sensor_Readings.ino.
The following function produces an error because it is possible to not be able to return a String type if all the if-else statements are false. I put the statement  return String(0);  after the if-else statements to make the error go away, but is there a better way to handle it?

String processor(const String& var){
getReadings();
//Serial.println(var);
if(var == "TEMPERATURE"){
return String(temperature);
}
else if(var == "HUMIDITY"){
return String(humidity);
}
else if(var == "PRESSURE"){
return String(pressure);
}
}

 

Question Tags: compiler error, ESP32-Cam, warning
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 6 months ago

Hi.
Thanks for letting me know.
I’ll fix and update the codes.
 
You can simply add

  return String();

Thanks.

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.