WiFi credentials lost after flashing new user firmware (photon)

Hey there. I’m running firmware version 0.4.2 on my release Photon, and now every time I flash new user firmware to the device my Wifi settings are lost (LED flashes green).

I have to re-enter Soft-AP mode and enter my credentials again in order to get my Photon to connect to Wifi.

Any ideas what’s happening here?

Does it also loose them on pushing the reset button briefly or powering off and on?

I don’t think the settings are lost, but the device is having difficulty connecting to WiFi. (We are currently investigating this, we believe it to be a problem with DHCP.)

As a test, when the device is flashing green:

  • hold setup for 3 seconds to enter setup mode (flashing blue LED)
  • connect to serial using a terminal (e.g. PuTTY on Windows, screen on Linux/OS X)
  • type ‘x’

The device should connect successfully to WiFi.

1 Like

I also had this problem and have temporarily downgraded to 0.4.1 which is more stable in this regard.

Everyone, please share details of your router model nr, router OS (DD-WRT/Tomato etc…), WiFi security type and DHCP settings. I hope with that info I can be more successful in reproducing the problem. Thanks :smile:

Sure @mdma

I have all my Particles on a separate Netgear WGR614v10 elcheapo 802.11/bg router. It provides DHCP with a 24 hour lease, and uses WPA2 Personal, channel 10, with 10.0.0.x addresses.

Cores have always been fine on this router and Photon on 0.4.1 is fine too.

Thanks, very useful info! :+1: I have a Netgear WGR614v8 here that I can try. What firmware are you running on the router?

Hi @mdma the router runs stock firmware–I have never updated it. The symptom is that if you are in breathing cyan, you can flash new firmware to the Photon (I was using the web IDE) but when it restarts after flashing it stays in blinking green despite resets and power cycling. As you said, in listening mode you could set the credentials and continue.

Or just press ‘x’ and exit without changing credentials.

1 Like

I can confirm that connecting via screen when in setup mode then pressing x causes the wifi to connect.

My router info:

  • Linksys E3000 running DD-WRT (v24-sp2)
  • WPA2 Personal security
  • 192.168.1.x addresses
  • 24h DHCP lease (more details)

I have two photons and one core on this network, the core and the photon with firmware 0.4.0 is working fine, whereas the photon with firmware 0.4.2 has this problem.


Some additional debugging information: when in this state (flashing green) my router reports that the photon is connected and has been successfully issued a DHCP lease.

1 Like

Thank you, that’s exactly what some folks on the team are seeing too.

If anyone has time to help us track down the code change that causes the bug, I’ve written up a brief How-To https://gist.github.com/m-mcgowan/29aea53676be785fb971.

So strange that it doesn’t happen for everyone. If I could reproduce this issue myself I would already be doing this.

Just tried this, and failed at the first hurdle!

Following these exact instructions:

git co v0.4.0
rm -rf build/target
cd modules
make PLATFORM_ID=6 all program-dfu COMPILE_LTO=n

My photon reboots and is stuck in the same “flashing green” state, even though I’m back on 0.4.0.

Are there any other variables I should reset here?

Additional data: The only way I can get back to “normal” on this particular photon is by following the instructions here: https://github.com/spark/firmware/releases/tag/v0.4.1

Thanks. Wow that’s indeed strange. The only difference between the compiled binaries on github release and those you build yourself would be the compiler versions used.

Could you try downgrading to 4.8.4 and rebuilding 0.4.0?
Sorry to ask more of you!


No problem mat, happy to help.

Just downgraded to gcc 4.8.4, checked out firmware v0.4.0, and did a clean build, still flashing green.

$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.8.4 20140725 (release) [ARM/embedded-4_8-branch revision 213147]
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
$ git status
HEAD detached at v0.4.0
nothing to commit, working directory clean
rm -rf build/target
cd modules
make PLATFORM_ID=6 all program-dfu COMPILE_LTO=n

Thanks so much! Ahhh…this is just super weird! What OS are you running on btw?

I wonder if we can have any luck with older commits. Any chance you could try older commits prior to 0.4.0? If you like I can pull out some key commits to try.

This is definitely one of the strangest bugs I’ve seen, yet I have the feeling the solution is going to be a one-liner!

Here’s a commit before 0.4.0, appreciate any feedback if this has the flashing-green problem or not! https://github.com/spark/firmware/commit/4609eee1ae4bd64287b1e59f1aa839659bb87e58

Thanks Mat, just tried that commit an I’m seeing the exact same issue:

$ git status
HEAD detached at 4609eee
nothing to commit, working directory clean

$ rm -rf build/target
$ cd modules
$ make PLATFORM_ID=6 all program-dfu COMPILE_LTO=n

Build completes and flashes successfully with no errors, device restarts and then flashes green.

I’ve just tested the same process on my other Photon (which was a fresh Photon) and I see the same issue.

I’m on a mac, here’s more system info:

  • OSX 10.10.4
  • dfu-util 0.8
  • arm-none-eabi-gcc 4.8.4 (also tried 4.9)

As before, flashing the pre-built single system_pad_BM-09.bin from the 0.4.1 release page gets everything working again, even though building and flashing myself from the v0.4.1 tag does not.

One more data point - flashing the pre-built 0.4.2 binaries (in 2 parts) from the 0.4.2 release page also causes the green flashing problem.

Random theory - could the fact that 0.4.1 is a single binary vs the “2-part” binary in 0.4.2 have an impact at all?

1 Like