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?