Last night, after uploading some code (cosmetic changes to LED colours, nothing to do with wifi connectivity) and testing functionality, I powered it down and when I switched it back on this morning it didn't seem to be running its sketch (leds weren't doing anything and the web page it was hosting is inaccessible). The only indication it's powered is that the builtin LED flashes briefly about once every 5 seconds. This isn't something I've written in, as in my sketch that LED only illuminates for the duration of a client connection to the server. There is no 5000ms delay (or similar) anywhere in my code. The relevant Wifi connection part is in need of some improvement when I get round to it but until now seemed to be fine:
// Set web server port number to 80
WiFiServer server(80);
void WifiConnect(const char* net, const char* pass) {
// Connect to Wi-Fi network with SSID and password
WiFi.begin(net, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// Print local IP address and start web server
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
}
<snip>
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
Serial.begin(115200);
WifiConnect(ssid, password);
ParseOTA();
FastLED.addLeds<WS2812, strip, GRB>(leds, num_leds);
}
I've tried restarting my router and power cycling the board several times, in case there was any issue with any channels breaking or something. Every other device on the network seems fine though and they're all on 2.4GHz as far as I know.
Has anyone ever come across any similar behaviour and if so, how was it restored to expected operation? If I can't figure this out I'll try going back to updating "over the wire" but it would be nice to figure out why this has happened to prevent it happening again.
This question has also been posted at https://www.reddit.com/r/esp8266/commen ... ts_sketch/