An application that makes heavy TCPClient usage apparently locks the Spark out with respect to further OTA flash programming. There is no way to recover except manual reset.
Full source for the test case is provided, see below.
I took the @bko Bitcoin sample code (great work) as a test case. It works properly as-is, and can be repeatedly OTA flashed without a problem, because it pauses waiting for operater intervention.
To cause the fault I take out the part where it waits for an operator CR to continue. This results in it continuously looping, spending about half the time talking with the bitcoin server, and half the time spewing out results to the serial port.
If (while it is in the part of the loop where it’s talking to the server), I start the CLI flash sequence, it will lock up. LED is still breathing cyan, but the core no longer outputs to the serial port, and will no longer respond to OTA requests. It must be manually reset.
CLI eventually responds with a ECONNRESET error.
I have incorporated @satishgn last weeks bug fix:
As a reminder, I’m running on a not so fast internet connection which may be contributing. Still it shouldn’t be happening.
I don’t see how to attach a zip file, so I’ve “temporarily” uploaded the whole project directory as a zip in order to facilitate debugging this:
Note: I use Serial1 for debug, so you’ll have to do a quick replace in files BitcoinApplication.cpp and rest_client.cpp.