I am on Windows and am running into a bit of a problem flashing my cores.
My code collects data, logs it to the web, then stays awake for 5 seconds just for the purpose of being available to be flashed. (all totaled the core is awake about 35 seconds) Then goes into SLEEP_MODE_DEEP mode for a long duration.
Obviously the core needs to be awake to be flashed. What I had worked out was a simple python program that would read my logged data and calculate when to send a flash command via the command line and dfu-util, it was working great at first (30 or more times no problems) now I get 3 possible behaviors
the command being entered on the command line is (spark flash my_deviceID path_to_my_bin)
-
response from the command - > (flash core said {“id”:“my_deviceID”,“status”:“Update started”})
The core is flashed with new code and everything is great -
response from the command - > (flash core said {“id”:“my_deviceID”,“status”:“Update started”})
The core seems to start the flashing process then hangs during it and eventually starts
running again with the old code. -
response from the command -> ({“code”:“ECONNRESET”})
The core seems to start the flashing process then hangs during it and eventually starts
running again with the old code.
Clearly 2 & 3 are what is killing me. When I flashing via the cloud using the Spark Dev IDE it almost always works. Does anyone have any ideas what is different between the Spark Dev IDE and the dfu-util command line programs that would lead to the difference? Is there something I should be doing at the command line before issuing the spark flash command?
Any help would be most appreciated.