@KennyL,
I may have a problem understanding what you are saying, sorry. Lets try this.
Are you saying that you have the simple “blink led on D7” script loaded and running ok. Then if you disconnect power for a while (half hour), when you reconnect power, the program will not start running ? It should start running! Is this what you are seeing?
So to understand, the following is true?
You have loaded the “blink led on D7” into your core. It runs fine. you can hit reset and it runs fine again.
You disconnect power (usb cable to your computer), and
you reconnect power in 2 minutes, the “blink led on D7” starts running again, fine.
if you reconnect power in an hour, the “blink led on D7” script does not run.
Question: do you have good WiFi / internet connection? Is the core to far away from your WiFi?
Thanks for your patience.
@KennyL, sorry to hear of your problem and pity that @Jack’s endeavour to help you solve your problem didn’t bear any fruit.
I wouldn’t consider myself as smarter than anybody else on this forum, but I’d still contribute my twopence worth of insight
Judgeing by the title of your topic, you suspect your Core’s flash mem to lose its content.
To establish if this is the case or not (which I’d rather think), and if it is WiFi related or not, you could try a little offline sketch like this.
SYSTEM_MODE(SEMI_AUTOMATIC)
void setup()
{
pinMode(D7, OUTPUT);
pinMode(D0, INPUT_PULLUP);
}
void loop()
{
digitalWrite(D7, !digitalRead(D7)); // blink the on board LED
if (!digitalRead(D0) && !Spark.connected()) // way out of offline mode for OTA reaflashing
{ // to reconnect just pull D0 to GND
Spark.connect();
while (!Spark.connected())
{
SPARK_WLAN_Loop();
delay(500);
}
}
delay(500); // 2Hz LED blink
}
If this firmware keeps blinking even after you had the Core detached, your flash is OK.
If you can reconnect to the Cloud after this, you’re fine too.
If you have to answer any of these with “NO”, we’ll have to look further.
Meanwhile you could also check some common issues, like disable 5GHz band on your router, check DHCP address range of your router, since the router might keep hold to previously leased IPs but try to hand out a new one, when the Core comes back too late and hence running out of possible IPs in its DHCP range, …
This theory can be tested by leaving the Core alone, but reboot your router once you face this problem again.
Sorry to put you through all of this, but could you remove your Core from the breadboard.
Power the Core off a 5V wall wart.
Perform two or three (really!) factory resets in a row - no other flashing!
After this the Core should blink blue.
Try to connect the Core via SmartConfig to your network. If this doesn’t work, reattach the Core to your USB and provide the WiFi credentials via USB.
Disconnect the Core from USB and reconnect to 5V wall wart.
Try out Tinker (digitalWrite D7).
Thats great if it is now working. So @ScruffR thought to take the core off of the bread board, and use another power source (rather than the USB from the laptop) solved the problem? Which of the two does it look like was causing the problem?
I think I noticed a LED, and two resistors on the bread board. Could the LED being drawing too much current? What are the values of the resistors? Is the LED connected between D0 and D1, or just one of those?
Getting close to the reason for the problem I think.
I suspect that you really have the LED- going to ground through the two 1k resistors.
If you have the LED hooked between D0 and ground, without the resistors, it could be drawing to much current!
Just for the sake of other people experiencing something similar, have you got any idea what the actual source of the problem might have been?
It would be nice if you could quickly summarize - if possible