Browse Source

added wifi manager

master
Vladimir Smagin 5 months ago
parent
commit
8c53d96c36
2 changed files with 9 additions and 7 deletions
  1. 9
    4
      tm1640-ntp.ino
  2. 0
    3
      wifi.h.sample

+ 9
- 4
tm1640-ntp.ino View File

@@ -6,7 +6,9 @@
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

#include "wifi.h"
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>

#define ONBOARDLED 2 // Built in LED on ESP-12/ESP-07

@@ -77,9 +79,9 @@ void setup() {
digitalWrite(ONBOARDLED, HIGH);

//Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.hostname("clock-x16");
WiFi.begin(YOUR_WIFI_SSID, YOUR_WIFI_PASSWD);
//WiFi.mode(WIFI_STA);
WiFi.hostname("clock-x16-01");
//WiFi.begin(YOUR_WIFI_SSID, YOUR_WIFI_PASSWD);

pinMode(ONBOARDLED, OUTPUT); // Onboard LED
digitalWrite(ONBOARDLED, HIGH); // Switch off LED
@@ -93,6 +95,9 @@ void setup() {
e2 = WiFi.onStationModeDisconnected(onSTADisconnected);
e3 = WiFi.onStationModeConnected (onSTAConnected);
digitalWrite(ONBOARDLED, HIGH); // Switch off LED
WiFiManager wifiManager;
wifiManager.autoConnect("clock-x16-01");
}

void starting() {

+ 0
- 3
wifi.h.sample View File

@@ -1,3 +0,0 @@
#define YOUR_WIFI_SSID "supapupamegawifi"
#define YOUR_WIFI_PASSWD "sexdrugsrickroll"


Loading…
Cancel
Save