Is it possible to change the server IP on a Photon 2?

I have several photon 1s connected to a local cloud (using the Brewskey fork), and am hoping to do the same with some Photon 2s. I am working on modifying the server to get a UDP port open, but the first challenge I am running into is that I cannot get the Photon 2 itself to change the server host.

After running:
particle keys server ../spark-server/data/default_key.pub.pem --host 192.168.X.X --port 5684 -v
particle keys doctor [id]

The output from particle keys address still shows it pointing at the Particle server:
udp://$id.udp.particle.io:5684

As compared to the output from particle keys address on one of my photon 1s that does connect to the local cloud:
tcp://192.168.X.X:5683

There is a –deviceType tag for particle keys server, but it doesn’t include an option for photon2. I tried the p2 option, but that didn’t seem to make a difference.
Make sure your device is connected to your computer: Unknown device type photon2. Use one of core, gcc, photon, p1, electron, esp32, argon, boron, xenon, esomx, asom, bsom, xsom, b5som, tracker, trackerm, raspi, p2, msom, electron2, tachyon, linux, oak, duo, bluz

Am I missing something in my commands?
Are the Photon 2s blocked from changing their server ip?
Any help would be appreciated!

You can change the server host on a Photon 2, but where did you find a UDP local cloud server? The protocol is very, very different between TCP and UDP. Also, they keys are a different format between TCP and UDP, which I suspect is why the change is not sticking, You need different keys for UDP.

It is currently a TCP local cloud, and I was hoping to modify it to handle both TCP and UDP devices. My use case has a reliable local LAN, but can’t rely on consistent internet connection, which is why I switched to the local cloud in the first place. Now that the photon is discontinued, I’m trying to test whether the photon 2 will work as a replacement, or if I have to switch to a different microcontroller.

I did notice that particle keys doctor generated ec keys instead of rsa. (rsa was created when using this process on a photon 1)

New key 0a10aced202194944a053ccc_ec_new.der created for device 0a10aced202194944a053ccc

Writing key to device

Writing key 0a10aced202194944a053ccc_ec_new.der to device 0a10aced202194944a053ccc

Saved existing key to backup_ec_0a10aced202194944a053ccc_ec_new.der

Key 0a10aced202194944a053ccc_ec_new.der written to device

attempting to add a new public key for device 0a10aced202194944a053ccc

submitting public key succeeded!

Okay! New keys in place, your device should restart.

Is this what you’re referring to, or do you mean that my server key should be in a different format from default_key.pub.pem?

The UDP cloud uses DTLS over UDP. It's a completely different protocol than TCP which uses AES encryption over TCP.

Another option is to use local network mode (breathing green) over Wi-Fi only. In my house I use a mix of Gen 2, Gen 3, and Gen 4 devices that communicate over the local LAN using UDP multicast. They only connect to the real Particle cloud to do OTA so most of they time they don't need Internet.

That’s helpful, thanks. I see some libraries for setting up DTLS servers rather than just UDP, which I can try.

Local network mode could work, though I was hoping I’d be able to continue using the dashboard I had already built (using the Cloud API, and is compatible with my local device server).

Did you have any further thoughts on why I’m struggling to change the server host on the Photon 2? Or some other resources I could look at?
Documentation on the particle keys server seems hard to find, unless it’s regarding fixing the keys to point back at the Particle server.