Adding telnet for remote debugging purpose
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
// global config
|
||||
|
||||
#include "config.h"
|
||||
|
||||
//################# LIBRARIES ##########################
|
||||
#include <ESP8266WiFi.h>
|
||||
@@ -8,6 +11,8 @@
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Max72xxPanel.h>
|
||||
#include <time.h>
|
||||
#include "d_helper.h"
|
||||
|
||||
|
||||
//################# DISPLAY CONNECTIONS ################
|
||||
// LED Matrix Pin -> ESP8266 Pin
|
||||
@@ -53,7 +58,13 @@ void setup() {
|
||||
Serial.println(F("WiFi connected..."));
|
||||
Serial.println(WiFi.localIP());
|
||||
configTime(timezone * 3600, dstOffset * 3600, ntpServer); // First sync of time with (S)NTP
|
||||
|
||||
|
||||
#ifdef DEBUG_TELNET
|
||||
// Start the Telnet server
|
||||
telnetServer.begin();
|
||||
telnetServer.setNoDelay(true);
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
server.begin();
|
||||
Serial.println(F("Webserver started..."));
|
||||
@@ -73,6 +84,10 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
#ifdef DEBUG_TELNET
|
||||
// Handle Telnet connection for debugging
|
||||
handleTelnet();
|
||||
#endif
|
||||
server.handleClient();
|
||||
matrix.fillScreen(LOW);
|
||||
time_t now = time(nullptr);
|
||||
|
||||
Reference in New Issue
Block a user