Cloud flash issue - serial.begin fix

I have only had my spark cores for a few days. Truly brilliant job and congrats to the spark.io team on what is a great product.

In the first 24 hours I was only able to successfully flash to the device from the cloud on 1 occasion. I followed all the diagnostic on spark.io to no avail. I have a comparatively slow internet connection via Satellite where ping times are typically 750ms - you get use to it after a while, slow but reliable.

When trying to flash the core I would get magenta flashes every 2sec for approximately 4 minutes, followed by the boot up sequence - 3 white flashes, green flashes during WIFI joining followed by the cyan heartbeat, only to find the prior version of code still running.

In trying to diagnose the issue I wondered if anything was being sent to the USB serial device, so I added a Serial.begin(9600); to setup, then reflashed. This time after magenta flashes every 2sec for 4min, I then observed 2 series of fast magenta flashes and then the restart. Only this time the device was running the new code - success !. With Serial.begin in place every reflash has worked successfully, however each flash takes around 4min30sec.

I considered if the reflash had rectified a boot loader/base firmware issue, so I have factory defaulted the core and was unable to load new code without the Serial.begin in setup. I am assuming a factory reset results in the restoration of the shipping version of bootloader/base-firmware ?

I also wondered if some form a USB signally was effecting the flash so I have tired this with the core powered from a usb mains charger. The result is the same as if powered from my iMac USB port.

So there seems to be some underlying issue which I assume only manifests itself over slow connections given then has not been previously observed. Let me know if there is anything else needed to identify the cause.

What size is the payload for a reflash ? and is the process a single or multiple TCP connection as whilst Satellite is slow I am struggling to understating why it takes 4 min. As an example http://spark.io frontpage loads roughly 40 seconds.

Thanks, Dean

Thanks! @deancs

Let me see if I can replicate that behaviour on our end. Will report back shortly!

Hi @mohit any update not this. With the changes implemented over the weekend I am now unable to flash from the cloud at all.

Hi @deancs,

Apologies, I made a timeout change designed to make this more robust for most users, and I realized the second I pushed the change that it might cause issues on extremely high latency connections. I need to test some code, but I’m hoping to rollout a fix for this tomorrow if possible. I’ll post back here when it’s done.

Thanks,
David