Can you try to better explain your issue? Can you provide more details?
I mean when we reboot Wifi or when there’s any power off, the IP change and we can’t connect to the ESP32CAM, with last IP before reboot from anywhere in the words.
In that case, you need to set a static IP address for your board.
See the ESP32-CAM eBook page 408 “ESP32-CAM Static IP Address”.