The process is more involved than that. Edit line 1579 in gphoto_driver.cpp and change it to something like this:
index = gp_port_info_list_lookup_path(portinfolist, "ip:192.168.1.12");
or make that "ptpip:192.168.1.12" .. then compile and install. Then run the indi_gphoto_ccd driver and put a break point at that link (#1579) and press Connect in the driver. It should take you there. See if the rest of the code works fine or if returns any error.
If it is indeed as simple as this, then we can add an IP address property to the driver and if non-empty then we use it there.
I know this is an old thread, but I just landed here searching for my problem.
If anyone is having problems taking images with a Nikon Z-series, and restarting everything does not help, there is a nice little detail about the mirrorless Nikons. When you unplug the power while the camera is on, the camera closes the mechanical front curtain (I have an external power-supply instead of the battery). The front curtain stays closed after the next power-on until you manually press the release button on the camera. While the mechanical shutter is closed the camera will not take any pictures or open the front curtain from software commands. You only recognize this in EKOS from capture errors and permanent retries.
A nice side effect is, that you protect your sensor from dust when you unplug the power after an imaging session