Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telnet: buffered output for AsyncTcp server #1929

Merged
merged 10 commits into from
Oct 9, 2019
2 changes: 2 additions & 0 deletions code/espurna/config/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

*/

#include <core_version.h>

#ifdef USE_CUSTOM_H
#include "custom.h"
#endif
Expand Down
5 changes: 5 additions & 0 deletions code/espurna/config/dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,8 @@
#undef MDNS_CLIENT_SUPPORT
#define MDNS_CLIENT_SUPPORT 0 // default resolver already handles this
#endif

#if not defined(ARDUINO_ESP8266_RELEASE_2_3_0)
#undef TELNET_SERVER_ASYNC_BUFFERED
#define TELNET_SERVER_ASYNC_BUFFERED 1 // enable buffered telnet by default on latest Cores
#endif
5 changes: 5 additions & 0 deletions code/espurna/config/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@
#define TELNET_SERVER TELNET_SERVER_ASYNC // Can be either TELNET_SERVER_ASYNC (using ESPAsyncTCP) or TELNET_SERVER_WIFISERVER (using WiFiServer)
#endif

#ifndef TELNET_SERVER_ASYNC_BUFFERED
#define TELNET_SERVER_ASYNC_BUFFERED 0 // Enable buffered output for telnet server (+1Kb)
// Helps to avoid lost data with lwip2 TCP_MSS=536 option
#endif

// Enable this flag to add support for reverse telnet (+800 bytes)
// This is useful to telnet to a device behind a NAT or firewall
// To use this feature, start a listen server on a publicly reachable host with e.g. "ncat -vlp <port>" and use the MQTT reverse telnet command to connect
Expand Down
7 changes: 6 additions & 1 deletion code/espurna/config/prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <functional>
#include <vector>
#include <memory>
#include <core_version.h>

extern "C" {
#include "user_interface.h"
Expand Down Expand Up @@ -32,6 +31,12 @@ extern "C" {
#include <lwip/init.h> // LWIP_VERSION_MAJOR
}

// ref: https://github.com/me-no-dev/ESPAsyncTCP/pull/115/files#diff-e2e636049095cc1ff920c1bfabf6dcacR8
// This is missing with Core 2.3.0 and is sometimes missing from the build flags. Assume HIGH_BANDWIDTH version.
#ifndef TCP_MSS
#define TCP_MSS (1460)
#endif

uint32_t systemResetReason();
uint8_t systemStabilityCounter();
void systemStabilityCounter(uint8_t);
Expand Down
Loading