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);
}
}