Getting into SoftAPmode/listening mode without using the setup button

Wonder if there is a software call that will put the Photon into SoftAP mode? I am putting the Photon in a box, where
it is difficult to access the “setup” button, but I can put a button to a GPIO pin that can be accessed from outside of the box.


Hi Kenneth, Thank you very much for your link.
I used WiFi.listen(); in my application code. But how can I call WiFi.listen(false); when listening mode blocks my application code? Do I need to change my program to multi-threaded?
I then used WiFi.setListenTimeout(seconds); and it exited listening mode, but it struggles to come back to application mode.
After ListenTimeout has expired Photon blinks green, cyan, then yellow/red and it then repeat(without/less green).
I need to cold boot to get it up and running again.
Any suggestion as how to best solve the problem?

I seem to recall that having multi-threading turned out would allow application code to run while in listening mode.

@ScruffR is that the case?

Yes, with SYSTEM_THREAD(ENABLED) the user loop() keeps running while in Listening Mode.