Photon stuck in "soft AP" mode

My system, which includes a Photon, used to run fine. Now it is does not connect to a wifi and appears stuck in soft AP. That is, it continuously broadcasts an SSID of “Photon-9SD2”.

The program used to work fine. It runs in MANUAL mode. When we run in the field, the Photon is not cloud connected and uses a wifi which we provide from a NanoLoco. When we want to debug, we type a command via the serial link to our program and it does a Particle.connect so we can download new firmware.

There are 4 wifi nets in the credentials list. I wanted to add another. So I ran “particle setup”. I don’t quite know what “soft AP” mode is (and probably don’t want to!) but my understanding is that part of the particle setup process is that it puts the Photon into soft AP mode, does its thing, and then presumably returns the Photon to what I’d call “normal operation mode”.

Because my program blinks some lights for 5 seconds when it starts, to let the user know it’s kinda alive, I am sure it’s running for those 5 seconds. More specifically it does a Wifi.on, then Wifi.connect, then drops into the 5 second light blink loop. From there things go downhill. Instead of our program continuing running, I get an SOS one dot. If I go to safe mode, I get the magenta blink and then blue blink. But I still cannot run particle setup or flash my program.

I need to get out of this problem to get back to operating properly. Can anyone point me in a direction? I don’t think I have used CLI and I have only used “particle” for setting new creds. Maybe one or two other things also.

Maybe “all” I have to do is a total reset somehow?

Thank you.
–jim

Keyboard output from particle setup:

hahn:~ jimhahn$ particle setup
                  _   _      _        _
 _ __   __ _ _ __| |_(_) ___| | ___  (_) ___
| '_ \ / _` | '__| __| |/ __| |/ _ \ | |/ _ \
| |_) | (_| | |  | |_| | (__| |  __/_| | (_) |
| .__/ \__,_|_|   \__|_|\___|_|\___(_)_|\___/
|_|                     https://particle.io/

> Setup is easy! Let's get started...
> It appears as though you are already logged in as hahn_02493@yahoo.com
? Would you like to log in with a different account? No

! PROTIP: Hold the MODE/SETUP button on your device until it blinks blue!
! PROTIP: Please make sure you are connected to the internet. 

> I have detected a Photon connected via USB.
? Would you like to continue with this one? Yes
! The Photon supports secure Wi-Fi setup. We'll try that first.

! PROTIP: Wireless setup of Photons works like a wizard!
! PROTIP: We will automagically change the Wi-Fi network to which your computer is connected.
! PROTIP: You will lose your connection to the internet periodically.

? Found "Photon-9SD2". Would you like to perform setup on this one now? Yes

! PROTIP: You will need to know the password for your Wi-Fi network (if any) to proceed.
! PROTIP: You can press ctrl + C to quit setup at any time.

> Obtained magical secure claim code.

! PROTIP: There was a network error while connecting to the cloud...
! PROTIP: We need an active internet connection to successfully complete setup.
! PROTIP: Are you currently connected to the internet? Please double-check and try again.

What happens if you place the device in DFU mode and do a particle flash --usb tinker?

I put device in DFU mode. Ran the command you suggested to load tinker. Photon stayed in blue blink mode, which I think is “listening”. Then again tried “Particle setup” command. Same output that I am not connected to Internet. See messages below.

Tried to flash but unsuccessful.

Powered Photon off, then on. Immediately goes to ‘listening’ blue blink. I guess that’s good: It means my original program is not there any more. Assume it’s been displaced by ‘tinker’.

Photon still broadcasting SSID “Photon-xxxx” which means, I think, it’s in soft AP mode.
–jim

OUTPUT:

particle flash --usb tinker
running dfu-util -l
Found DFU device 2b04:d006
checking file /usr/local/lib/node_modules/particle-cli/binaries/photon_tinker.bin
spawning dfu-util -d 2b04:d006 -a 0 -i 0 -s 0x080A0000:leave -D /usr/local/lib/node_modules/particle-cli/binaries/photon_tinker.bin
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
Opening DFU capable USB device...
ID 2b04:d006
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x080a0000, size = 3952
Download	[=========================] 100%         3952 bytes
Download done.
File downloaded successfully

Flash success!
hahn:~ jimhahn$ particle setup
                  _   _      _        _
 _ __   __ _ _ __| |_(_) ___| | ___  (_) ___
| '_ \ / _` | '__| __| |/ __| |/ _ \ | |/ _ \
| |_) | (_| | |  | |_| | (__| |  __/_| | (_) |
| .__/ \__,_|_|   \__|_|\___|_|\___(_)_|\___/
|_|                     https://particle.io/

> Setup is easy! Let's get started...
> It appears as though you are already logged in as hahn_02493@yahoo.com
? Would you like to log in with a different account? No

! PROTIP: Hold the MODE/SETUP button on your device until it blinks blue!
! PROTIP: Please make sure you are connected to the internet. 

> I have detected a Photon connected via USB.
? Would you like to continue with this one? Yes
! The Photon supports secure Wi-Fi setup. We'll try that first.

! PROTIP: Wireless setup of Photons works like a wizard!
! PROTIP: We will automagically change the Wi-Fi network to which your computer is connected.
! PROTIP: You will lose your connection to the internet periodically.

? Found "Photon-9SD2". Would you like to perform setup on this one now? Yes

! PROTIP: You will need to know the password for your Wi-Fi network (if any) to proceed.
! PROTIP: You can press ctrl + C to quit setup at any time.

> Obtained magical secure claim code.

! PROTIP: There was a network error while connecting to the cloud...
! PROTIP: We need an active internet connection to successfully complete setup.
! PROTIP: Are you currently connected to the internet? Please double-check and try again.
hahn:~ jimhahn$

When the device enters blue blinking in Safe Mode, it could be that you’ve either got no WiFi credentals (maybe the got lost) or your SETUP button might be flakey (or you get a GND contact on the respective solder pad underneath the Photon).

If your code kept clearing and setting the credentials it could well be that the respective flash area is worn out.

Try setting your credentials while in Listening Mode via

particle serial wifi

(no auto-scanning but manual entry)

That worked! Looks like I owe you ANOTHER beer. My tab keeps increasing - I owe you more and more.

I only program the Photon when I need to fix a bug or add some feature. Last time I had to do that was 6 months or so ago. When my creds got lost, my brain remembered “particle setup” and that did not work. In fact, maybe that’s what caused the creds to get lost. My wifi is flakey at my house and maybe that’s what caused particle setup to fail half way through. It left the Photon in soft AP mode. (Whatever that means.)

So now I know that “particle serial wifi” will unconditionally set the creds over the serial USB port Alternatively, “particle setup” must rely on the Photon having creds already set.

Since a brand new Photon will have no creds, it must be that “particle serial wifi” is required as a first step.

Thank you very much.
–jim hahn

SoftAP means that the Photon can act as Access Point (obviously), but the beauty of that feature is that you can have your Photon also act as "mini webserver" to hand out web pages while you are connected to the SoftAP.
The docs do show a demo implementation that allows you to enter the WiFi creds directly into the SoftAP web page and won't need CLI at all.

https://docs.particle.io/reference/firmware/photon/#complete-example


Not quite.
particle setup would do the same stuff as particle serial wifi but since it also does a bunch of other things, there's more that can go wrong. So for just re-setting the WiFi creds take the short cut via particle serial wifi (and avoid any of the automagic and stay in charge yourself :wink: )


Maybe a reason to visit Arizona one day :sunglasses:

You show up in Arizona (make it Phoenix) and I’ll pick you up in my car. You’ll get a fantastic meal although I’m not sure the restaurants are Michelin rated around here.

Let me know your flight numbers.

2 Likes