What do you mean by "connect the Photon to the RaspberryPi or to the Spark 3? My understanding is that the photon p1 is the chip inside the Spark 3–so you wouldn’t need to/be able to connect them unless you had dissembled the Spark 3 and disconnected the photon p1 chip.
That said, there are two ways to set up wifi on the spark 3/photon p1. Both require putting the spark 3/photon p1 into listening mode by holding the setup button on the side (might need a paperclip) for a few seconds until the LED starts flashing navy blue. Then the first option allows you to use the particle app on your phone to connect to the photon and configure wifi. Recently I haven’t had much luck with this. The second option is to download and install the particle CLI on a computer with a usb port. You could use the pi, but I usually just use my main computer. After installing it (might require digging into OS-specific instructions), plug the spark 3 into this computer with a decent USB cable (cheap ones might not work), make sure it’s in listening mode, use the “serial wifi” command with the particle CLI program (For me I type the command “sudo ~/bin/particle serial wifi” but this will be OS-specific) and follow the prompts to set up wifi.
That’s the general idea (as detailed on the wikihttps://wiki.brewpi.com/how-to-setup-wifi-on-the-brewpi-spark, but specific instructions will depend on which OS you are using.
If this is what you think you did while it was connected to the pi and you didn’t see any errors, than you are probably good. If the LED on the spark 3 is slowly breathing green then you were successful.
Hope this helps.