Changing Wifi network to another stored network based on X thing

Some similar questions have been asked, but I haven’t quite figured out if this has been answered, just with wording that maybe I’m not understanding.

For reasons I’ll go into later if anyone is curious, I have an Argon connecting to a little mifi hotspot in a vehicle. When I get home and park, in certain cases I’ll want to switch networks from the mifi to my home wifi. For the most part I don’t really care, but in this particular case, I wanted to have the Argon talk to something using a specific IP address (I don’t want to port forward as the task is intended to be very simple and will not have much in the way of security).

I have both networks’ credentials stored and I believe the home network is first in the order, so if I reboot it, sometimes it’ll connect to the home wifi - but not always. I can speculate as to why, but rather than go into that part, I want to start with what should be an easy solution: have a cloud function to toggle between the two. I looked through the docs and it looks like WiFi.connect() only has one optional parameter. I’d like to tell it to (effectively) do: WiFi.connect(“homewifi”) etc. I saw someone mentioning clearing the credentials, but a follow up mentioned flash wear and I really have no idea how often I’ll be doing this - might be a couple times, might be a zillion if I come up with some other use case.

Is there a reasonable way to do this?

1 Like

Don’t set or clear credentials on EVERY boot because it can wear the flash. Instead clear and/or set whenever you wish to switch networks. If you do it that way, I doubt you’ll wear your flash out.

There currently is no other way than having only one set of credentials stored at any time to ensure connection to that particular WiFi.

But I see your need and I think this is a feature many people would like to see implemented.
This GitHub issue is going that direction - maybe commenting on that would help getting Particle’s attention

Done - thanks for the input (at least I’m not going nuts)