Adding telnet for remote debugging purpose

This commit is contained in:
2017-12-22 14:36:26 +01:00
parent ceb16d97c5
commit bf253506f2
6 changed files with 115 additions and 1 deletions

View File

@@ -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);