So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By cold_matter
#86924 For the last several days I've been working with a (clone of a) Wemos D1 Mini and coding onto it to control some WS2812B lights. Initially I had it hard wired to a USB port and updated the firmware using the arduino IDE, then eventually set it up for ArduinoOTA and then switched again to writing in the PlatformIO environment which became more convenient. This has been working fine for several days, and I've been uploading new code to it very frequently as the project gets more and more complex. It's been power cycled and reset several times.

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:

Code: Select all// 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>

Code: Select allvoid 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/