Photon Wifi setup fails with Google Mesh Wifi devices

I have multiple Photons already on my network. They are setup in firmware to use static IP addressing.
Recently I started using Google’s New Mesh Wifi devices (3 of them) because I needed better range in my house.

The Photons already on my network with static IP’s still work.
HOWEVER, I cannot add a new Photon. Wifi setup fails using both the Mobile app and the CLI.
The Photon fails at the point that it tries to get an IP address from DHCP.
If I use the CLI to put the following startup code (static IP) in the Photon, it then connects to Wifi, but it hasnt been “Claimed” so I cant see it in the Particle cloud.

Serial.println("Wifi connecting");
WiFi.off();
STARTUP(WiFi.selectAntenna(ANT_AUTO));
IPAddress myAddress(192,168,1,212);

IPAddress netmask(255,255,255,0);
IPAddress gateway(192,168,1,1);
IPAddress dns(192,168,1,1);
WiFi.setStaticIP(myAddress, netmask, gateway, dns);
WiFi.useStaticIP();
WiFi.on();
WiFi.setCredentials("TJNet", "XXXXXXXX");

Serial.println("Wifi Connecting");
WiFi.connect();
while(WiFi.ready() == FALSE){
    Serial.println("Waiting for Wifi.ready");
    delay(500);
}
Serial.println("Wifi Connected");

I am very sure the issue is that the Photon cannot obtain an IP address from the Google Wifi access point during normal Wifi setup, but I dont know how to fix that.

Any help would be greatly appreciated otherwise I may have to revert back to my old Wifi router and extender just so I can use Photons :frowning:

Thanks,
TJ

If claiming is the problem, you can use particle device add <deviceID> or Web IDE to get a cyan breathing device assigned to your account.

BTW, the STARTUP() macro has no busines inside setup() but should be placed at the top of your code before any function implementation.
For logical reasons it also makes more sense to have WiFi.on() before “programming” the module. If we’d take WiFi.on() as powering-up the device a depowered device is usually hard to program :wink:

Hi ScruffR,

Thanks for the reply. I will try particle device add <deviceID>

I have tried setting static IP stuff before with Wifi.on, but it didnt take the static IP. It stayed on the dynamic IP that was already assigned. The only way I could get it to start using the static IP was to first Wifi.off, set static and then Wifi.on.

Why do you say the Wifi setup should not happen in the Setup()? All my existing Photons are running that way without issue.

Thanks Again,
TJ

When you are running non-AUTOMATIC mode and only call WiFi.on() but neither WiFi.connect() nor Particle.connect() the device won't join any network and hence won't have any dynamic IP to stick with.

I actually said

and the "reason" is is here
https://docs.particle.io/reference/device-os/firmware/photon/#startup-

It is meant to be executed before setup() (or any other function - even in SYSTEM_MODE(AUTOMATIC)) and hence has no business inside the function(s) it should actually precede

Hi ScruffR,

CLI particle device add <deviceID> worked!

I also moved STARTUP() to the top outside all functions.

I still hope to somehow solve the DHCP issue with my new Wifi access points, but dont know where to start.

Thanks,
TJ

Unfortunately I can’t help you with that.
I have the Netgear Orbi WiFi mesh devices (also 3) and never had any DHCP issues.