Listening mode on the Photon cannot work reliably in current implementation

@elco, you have well explained the ongoing SoftAP issue which is a sore point for some.

I have been in the process of completing a long winded (read years of work) commercialising a codebase which is filled to the brim.

Have had many posts on this topic through the years and now that I am nearing completion, wish to get SoftAP functioning again.

Had to perform the following to get it to work: Using Soft AP example - can't connect to HTTP, which was fine under DeviceOS 1.4.4 but failed under DeviceOS 1.5.0 due to the heap memory issue.

In the interim have simply disabled SoftAP and use another “user friendly” method of generating a configuration barcode and reading that in (obviously using an onboard barcode reader which is at my disposal).

Re a fix: I broke up setup() into two parts, setup() and setup2(); setup2() is called once in loop(), not setup().

I placed objects in setup2() that allocate their own heap memory in their begin() methods. Upon entry, setup2() first checks to see if it is in listening mode, if so, it exits without calling the begin() methods.

Of course, you have missing functionality, but this is acceptable because you are in SoftAP configuration mode, which means that you need to reset once you have finished using SoftAP, ie no big deal.

Hope this has been helpful. Keep up the investigations!

PS - Really impressed with your memory analysis work. Phenomenal!