I’m trying to implement the browser-based SoftAP setup for a Photon. I’ve almost completely got it sorted, except for two problems.
I have a Photon running the latest firmware (via npm update -g particle-cli && particle update).
I have been playing with @brewnerd’s browserified softap-setup branch, trying to implement a Photon setup interface
in-browser (using Meteor, if anyone’s interested in that.)
So the good news is I built such an interface, and it does work! But there are two main roadblocks I’ve hit, and which as far as I can tell may be specific to the firmware rather than the JS lib:
SoftAP.prototype.connect does transmit the WiFi configuration data correctly to the device. I know this because when it restarts, it connects to the AP successfully. But this .connect( cb_func ) command does not actually trigger the Photon to attempt to connect to the access point or restart. In other words, there is no real indication that new WiFi credentials have been transmitted, and it is up to the user to manually restart the device to try connecting with those credentials. I would expect the Photon to auto-restart or attempt an auto-connect on receiving this command.
If the password is incorrect, when the Photon is restarted and attempts to connect, it flashes green and then stays solid green. It does not re-enter beacon mode or turn red, or otherwise indicate failure.
The 2nd point - flashing green forever with an incorrect password. At present, that’s how the Core/Photon firmware works. It re-enters listening mode (blinking blue) if the device was already in listening mode after being given incorrect credentials. On reset, the device will not enter listening mode so long as credentials are present, since the reason for failure might simply be the wifi is presently out of range.
So I’ve found that this same problem happens with the iOS app.
The app successfully makes it through the “WiFi credentials” step, but then hangs on “Connecting to WiFi…” If I manually reset the Photon, it then connects to the WiFi on boot, and the iOS app reports the procedure is complete. But this connection should be happening automatically.
@msolters, @mdma: I am seeing the same “connect” issue… I give the Photon correct WiFi credentials via the http API, wait a few seconds for the settings to persist, then issue do a “connect-ap” API call. The Photon AP stops (i.e. my device is kicked off the AP) but the Photon stays pulsing blue. If I manually reset the Photon, it successfully connects to the configured WiFi.
I have noticed that there is sometimes a green flash on the RGB right after the the connect-ap call. I conclude from what you mention above that may be the AP stopping – but then it goes right back to pulsing blue. I don’t always see the green flash every time – it’s extremely fast.
I see this behaviour no matter what method I use to configure softap.