Photon - how to provide new WiFi credentials


If the customers own iPhones, then yes they can Skip Authentication with the Particle App to setup the wifi.
Particle wants to add this feature to Android but doesn’t have a firm schedule for it.


The Photon also provides a SoftAP feature where it can act a WiFi access point and a user can connect to it with any WiFi client, navigate to which serves a HTTP page to enter new credentials.


We wouldn’t have the wifi credentials prior to shipping.
Additionally: ‘SoftAP HTTP Pages is presently an advanced feature, requiring moderate C++ knowledge.’
I suspect that I could get it going - but I’ve got enough to sort out already.

I’m surprised that the Android Skip Authentication function doesn’t exist yet.
From my viewpoint, Android is as much a used tool as IOS, and sending out pre-owned devices that need new credentials would surely be the norm for any business model except perhaps hobby use,
I can’t see why making it as simple as possible doesn’t already exist for a reasonably mature product.

Note: I seem to remember a few years back that someone in this community made a web application that cleverly provided the setup feature. Anybody know where that might be?


Without even moderate C++ knowledge, you’ll probably face more severe problems cobbling together any project on these devices.
When it comes to SoftAP, the example given in the linked docs is a drop-in, fully working project which can be taken as is and you’d only add your own code.

I think you are remembering SoftAP.


I can manage C and C++ enough to get things going. I’ll checkout the soft AP properly.

There was a contribution somewhere definitely that I could create an html webpage that did all the wifi credentials. I remember using it and someone having written the encryption stuff required.
It was several years ago.
It made the laptop connect to the photon and allow credentials to be entered. So yes, I guess it was the SoftAP mode - but I don’t think it needed to log in to a particle account. So in effect it could be hosted on our own webserver and the customer sent there to do the credentials.

I recall trying to whitelabel it without success, I think I was trying to hide reference to photon or particle at the time.

I’m guessing this is pretty much what the web setup does these days - without the white labelling ability?


This would be done in the HTML code that’s part of the SoftAP example.

And yes, SoftAP doesn’t require a Particle account to work.


Hi @rowifi -

@ScruffR advice of using SoftAP seems to be your best bet. If for some reason you cannot get that going, here is some code that have used recently:

STARTUP(WiFi.setListenTimeout(300)); // exits listen mode after 5 minutes 
unsigned long old_time = millis();            // setup WiFi connecting before entering Listening Mode

Void Setup();

//Your Code//

Void loop();

// == ENTER lstening mode if no current Wifi credentials are not valid == //
     if(millis() - old_time >= 20000 && millis()) {

Please refer to the full code here on Github as @ScruffR pointed out some errors in my code above :see_no_evil:

Once you you cleared WiFi credentials and you restart the device I will enter listen mode if it cannot connect to WiFi. This also helps for when your client have the WiFi credentials charged for some reason i.e. Password change, new router etc. Client can now use the Particle App to connect the device to new WiFi credentials.

SoftAP still sound like a more solid solution though :slight_smile: Full disclosure, I have very moderate knowledge of C++ and the Android Particle app. That said, this product was delivered to a Client with Android and they had no problems assigning new WiFi credentials.

ps: I also had a case where I had to deliver fully assembled (closed) and tested product to a client, but without any credentials and in listening mode. If this can help I will gladly send you the code.

Hope something makes sense. Best of luck!!


Thanks again everyone - I’ll plod on… gotta get the stuff ready for an exhibition this week!!


I believe this is the SoftAp web app that you were remembering.


Yes thats’s the one. Well done!


IIRC, that’s actually the one that’s featured in the docs :wink:
With the “difference” that his web page (with dependencies) is hosted on the device.


This post was flagged by the community and is temporarily hidden.