wifi working
This commit is contained in:
parent
161352f0ca
commit
d6057525f7
@ -9,20 +9,21 @@
|
||||
#define _TASK_STATUS_REQUEST // Compile with support for StatusRequest functionality - triggering tasks on status change events in addition to time only
|
||||
|
||||
// #define ENABLE_MQTT
|
||||
// #define ENABLE_WIFI
|
||||
#define ENABLE_WIFI
|
||||
// #define ENABLE_FS
|
||||
// #define ENABLE_PINFINDER
|
||||
#define ENABLE_COLORS
|
||||
|
||||
// #include <TaskScheduler.h>
|
||||
|
||||
#ifdef ENABLE_MQTT
|
||||
#include "MQTT.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_WIFI
|
||||
#include "Wifi.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MQTT
|
||||
#include "MQTT.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FS
|
||||
#include "FS.h"
|
||||
#include <LittleFS.h>
|
||||
@ -33,17 +34,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
void feedWatchdog(){
|
||||
// ESP.wdtFeed();
|
||||
}
|
||||
|
||||
bool blinkStatus = false;
|
||||
void blink(){
|
||||
blinkStatus = !blinkStatus;
|
||||
digitalWrite(LED_BUILTIN, blinkStatus);
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_LED
|
||||
#ifdef ENABLE_COLORS
|
||||
CRGB colorTable[] = {
|
||||
CRGB::Red,
|
||||
CRGB::Blue,
|
||||
@ -165,7 +156,7 @@ void setup() {
|
||||
|
||||
|
||||
void loop() {
|
||||
|
||||
|
||||
#ifdef ENABLE_MQTT
|
||||
MQTT_loop();
|
||||
#endif
|
||||
@ -178,15 +169,12 @@ void loop() {
|
||||
PinFinder_loop();
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_LED
|
||||
#ifdef ENABLE_COLORS
|
||||
colors();
|
||||
#endif
|
||||
|
||||
delay(1000);
|
||||
|
||||
return;
|
||||
|
||||
sleep(2000);
|
||||
|
||||
// Led_loop();
|
||||
|
||||
|
||||
11
src/Wifi.cpp
11
src/Wifi.cpp
@ -1,10 +1,6 @@
|
||||
#ifdef ENABLE_WIFI
|
||||
|
||||
#include <ESP8266WiFi.h>
|
||||
|
||||
#include <ESPAsync_WiFiManager.h>
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <WiFi.h>
|
||||
#include "WifiSettings.h"
|
||||
|
||||
|
||||
@ -26,6 +22,7 @@ void Wifi_setup_softap(){
|
||||
|
||||
void Wifi_setup(){
|
||||
|
||||
Serial.println("Wifi_setup()");
|
||||
WiFi.mode(WIFI_STA);
|
||||
//TODO:
|
||||
WiFi.begin(WIFI_ESSID, WIFI_PASSWORD);
|
||||
@ -40,6 +37,4 @@ void Wifi_setup(){
|
||||
Serial.println("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user