diyhue / Lights

DIY lights with support for diyHue
https://diyhue.org/
172 stars 99 forks source link

Wifi AP #82

Closed gastonMM closed 4 years ago

gastonMM commented 4 years ago

Hello, I have 3 ESP8266, with the Generic_WS2812_Strip.bin firmware, and after connecting to the wifi network, the AP continues with the captive page.

Also try Generic_WS2812_Strip.ino, with the same result.

gastonMM commented 4 years ago

screenshot https://drive.google.com/file/d/1htc1saRM0LcGGdBxrgkBWMXJJTjErGyS/view?usp=sharing

Google Docs
Screenshot_20200612-081942.png
mariusmotea commented 4 years ago

This happens if the wifi was not ready during ESP8266 boot. Is an annoying bug. The issue is with wifimanager and at this line:

https://github.com/diyhue/Lights/blob/master/Arduino/Generic_WS2812_Strip/Generic_WS2812_Strip.ino#L623

GitHub
diyhue/Lights
DIY lights with support for diyHue. Contribute to diyhue/Lights development by creating an account on GitHub.
gastonMM commented 4 years ago

Do you have any template without wifi manager? that allows to put ssid and password

try to replace it with the following data but fail to load it

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

#ifndef STASSID
#define STASSID "your-ssid"
#define STAPSK  "your-password"
#endif

const char* ssid     = STASSID;
const char* password = STAPSK;

const char* host = "192.168.1.1";
const uint16_t port = 3000;

ESP8266WiFiMulti WiFiMulti;

void setup() {
  Serial.begin(115200);

  // We start by connecting to a WiFi network
  WiFi.mode(WIFI_STA);
  WiFiMulti.addAP(ssid, password);

  Serial.println();
  Serial.println();
  Serial.print("Wait for WiFi... ");

  while (WiFiMulti.run() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  delay(500);
}
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 2 days if no further activity occurs. Thank you for your contributions.

mariusmotea commented 4 years ago

Look here: https://github.com/tzapu/WiFiManager/

//first parameter is name of access point, second is the password wifiManager.autoConnect("AP-NAME", "AP-PASSWORD");

GitHub
tzapu/WiFiManager
ESP8266 WiFi Connection manager with web captive portal - tzapu/WiFiManager
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 2 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically closed as it has not had any recent activity. Thank you for your contributions.