Git Product home page Git Product logo

telnetspy's Introduction

Telnet server for ESP8266 / ESP32


Cloning the serial port via Telnet.

GitHub Issues GitHub Pull Requests

๐Ÿ“ Table of Contents

๐ŸŽˆ Description

  • This module allows you to do "debugging over the air". So if you already use ArduinoOTA, this is a helpful extension for wireless development. Use TelnetSpy instead of Serial to send data to the serial port and a copy to a Telnet connection.
  • There is a circular buffer which allows to store the data while the Telnet connection is not established. So it's possible to collect data even when the WiFi and Telnet connections are not yet established.
  • It's also possible to create a Telnet session only if it is neccessary: then you will get the already collected data as far as it is still stored in the circular buffer. Data sent from Telnet terminal to ESP8266 / ESP32 will be handled as data received by serial port.
  • It is also possible to use more than one instance of TelnetSpy. For example - To send control information on the first instance and data dumps on the second instance.
  • Now a rudimentary implementation of the telnet NVT protocol (see RFC854) is included. You can use this functions in PuTTY via its menu "Special Command" i.e. for restarting the ESP.

๐Ÿš€ Usage

General

Add the following line to your sketch:

#include <TelnetSpy.h>
TelnetSpy LOG;

Add the following line to your initialisation block void setup():

LOG.begin();

Add the following line at the beginning of your main loop void loop():

LOG.handle();

Use the following functions of the TelnetSpy object to modify behavior

  1. void setPort(uint16_t portToUse)
  2. void setWelcomeMsg(const char* msg) / void setWelcomeMsg(const String& msg)
  3. void setRejectMsg(const char* msg) / void setRejectMsg(const String& msg)
  4. void setMinBlockSize(uint16_t minSize)
  5. void setCollectingTime(uint16_t colTime)
  6. void setMaxBlockSize(uint16_t maxSize)
  7. bool setBufferSize(uint16_t newSize)
  8. uint16_t getBufferSize()
  9. void setStoreOffline(bool store)
  10. bool getStoreOffline()
  11. void setPingTime(uint16_t pngTime)
  12. bool setRecBufferSize(uint16_t newSize)
  13. uint16_t getRecBufferSize()
  14. void setSerial(HardwareSerial* usedSerial)
  15. bool isClientConnected()
  16. void setCallbackOnConnect(void (*callback)())
  17. void setCallbackOnDisconnect(void (*callback)())
  18. void disconnectClient()
  19. void clearBuffer()
  20. void setFilter(char ch, const char* msg, void (*callback()) / void setFilter(char ch, const String& msg, void (*callback())
  21. char getFilter()
  22. void setCallbackOnNvtBRK(void (*callback)())
  23. void setCallbackOnNvtIP)(void (*callback)())
  24. void setCallbackOnNvtAO)(void (*callback)())
  25. void setCallbackOnNvtAYT)(void (*callback)())
  26. void setCallbackOnNvtEC)(void (*callback)())
  27. void setCallbackOnNvtEL)(void (*callback)())
  28. void setCallbackOnNvtGA)(void (*callback)())
  29. void setCallbackOnNvtWWDD(void (*callback)(char command, char option))

1. void setPort(uint16_t portToUse)

Change the port number of this Telnet server. If a client is already connected, it will be disconnected.

Default: 23

void setPort(uint16_t portToUse)

2. void setWelcomeMsg(const char* msg) / void setWelcomeMsg(const String& msg)

Change the message which will be sent to the Telnet client after a session is established.

Default: "Connection established via TelnetSpy.\n"

void setWelcomeMsg(const char* msg)
void setWelcomeMsg(const String& msg)

3. void setRejectMsg(const char* msg) / void setRejectMsg(const String& msg)

Change the message which will be sent to the Telnet client if another session is already established.

Default: "TelnetSpy: Only one connection possible.\n"

void setRejectMsg(const char* msg)
void setRejectMsg(const String& msg)

4. void setMinBlockSize(uint16_t minSize)

Change the amount of characters to collect before sending a Telnet block.

Default: 64

void setMinBlockSize(uint16_t minSize)

5. void setCollectingTime(uint16_t colTime)

Change the time (in ms) to wait before sending a Telnet block if it's size is less than (defined by setMinBlockSize).

Default: 100

void setCollectingTime(uint16_t colTime)

6. void setMaxBlockSize(uint16_t maxSize)

Change the maximum size of the Telnet packets to send.

Default: 512

void setMaxBlockSize(uint16_t maxSize)

7. bool setBufferSize(uint16_t newSize)

Change the size of the ring buffer. Set it to 0 to disable buffering. If buffering is disabled, the system's debug output (see setDebugOutput) cannot be send via telnet, it will be send to serial output only. Changing size tries to preserve the already collected data. If the new buffer size is too small, only the latest data will be preserved. Returns false if the requested buffer size cannot be set.

Default: 3000

bool setBufferSize(uint16_t newSize)

8. uint16_t getBufferSize()

This function returns the actual size of the ring buffer.

uint16_t getBufferSize()

9. void setStoreOffline(bool store)

Enable / disable storing new data in the ring buffer if no Telnet connection is established. This function allows you to store important data only. You can do this by disabling storeOffline for sending unimportant data.

Default: true

void setStoreOffline(bool store)

10. bool getStoreOffline()

Get actual state of storing data when offline.

bool getStoreOffline()

11. void setPingTime(uint16_t pngTime)

If no data is sent via TelnetSpy, the detection of a disconnected client has a long timeout. Use setPingTime to define the time (in ms) without traffic after which a ping aka a chr(0) is sent to the Telnet client to detect a disconnect earlier. Use 0 as parameter to disable pings.

Default: 1500

void setPingTime(uint16_t pngTime)

12. bool setRecBufferSize(uint16_t newSize)

Change the size of the receive buffer. Set it to 0 to disable buffering in TelnetSpy (there is still a buffer in the underlayed WifiClient component). Returns false if the requested buffer size cannot be set.

  • If the receive buffer is used and it is full, additional received data will be lost. But all telnet NVT protocol data and the "filter character" is still handled (see "setFilter" and the NVT callbacks below).
  • If no receive buffer is used and the received characters are not retrieved by your app, the handling of the NVT protocol and the "filter character" will not work. If no receive buffer is used, you cannot receive the code 0xff (it will be lost because of a limitation of the WiFiAPI).

Default: 64

bool setRecBufferSize(uint16_t newSize);    

13. uint16_t getRecBufferSize()

This function returns the actual size of the receive buffer.

uint16_t getRecBufferSize()

14. void setSerial(HardwareSerial* usedSerial)

Set the serial port you want to use with this object (especially for ESP32) or NULL if no serial port should be used (Telnet only).

Default: Serial

void setSerial(HardwareSerial* usedSerial)

15. bool isClientConnected()

This function returns true if a Telnet client is connected.

bool isClientConnected()

16. void setCallbackOnConnect(void (*callback)())

This function installs a callback function which will be called on every Telnet connect of this object (except rejected connect tries). Use NULL to remove the callback.

Default: NULL

void setCallbackOnConnect(void (*callback)())

17. void setCallbackOnDisconnect(void (*callback)())

This function installs a callback function which will be called on every Telnet disconnect of this object (except rejected connect tries). Use NULL to remove the callback.

Default: NULL

void setCallbackOnDisconnect(void (*callback)())

18. void disconnectClient()

This function disconnects an active client connection.

void disconnectClient()

19. void clearBuffer()

This function clears the transmit buffer of TelnetSpy, so all waiting data to send via a telnet connection will be discard.

void clearBuffer()

20. void setFilter(char ch, const char* msg, void (*callback()) / void setFilter(char ch, const String& msg, void (*callback())

This function allows to filter the character given by "ch" out of the receiving telnet data stream. If this character is detected, the following happens:

  • If a "msg" is given (not NULL), this message will be send back via the telnet connection.
  • If the "callback" is set (not NULL), the given function is called.
void setFilter(char ch, const char* msg, void (*callback())
void setFilter(char ch, const String& msg, void (*callback())

21. char getFilter()

This function returns the actual filter character (0 => not set).

char getFilter()

22. void setCallbackOnNvtBRK(void (*callback)())

This function installs a callback function which will be called whenever the telnet command "BRK" (Break) is received. Use NULL to remove the callback.

Default: NULL

void setCallbackOnNvtBRK(void (*callback)())

23. void setCallbackOnNvtIP(void (*callback)())

This function installs a callback function which will be called whenever the telnet command "IP" (Interrupt Process) is received. Use NULL to remove the callback.

Default: 1 (=> ESP.restart will be called)

void setCallbackOnNvtIP(void (*callback)())

24. void setCallbackOnNvtAO(void (*callback)())

This function installs a callback function which will be called whenever the telnet command "AO" (Abort Output) is received. Use NULL to remove the callback.

Default: 1 (=> disconnectClient of TelnerSpy will be called)

void setCallbackOnNvtAO(void (*callback)())

25. void setCallbackOnNvtAYT(void (*callback)())

This function installs a callback function which will be called whenever the telnet command "AYT" (Are you there) is received. Use NULL to remove the callback.

Default: NULL

void setCallbackOnNvtAYT(void (*callback)())

26. void setCallbackOnNvtEC(void (*callback)())

This function installs a callback function which will be called whenever the telnet command "EC" (Erase Character) is received. Use NULL to remove the callback.

Default: NULL

void setCallbackOnNvtEC(void (*callback)())

27. void setCallbackOnNvtEL(void (*callback)())

This function installs a callback function which will be called whenever the telnet command "EL" (Erase Line) is received. Use NULL to remove the callback.

Default: NULL

void setCallbackOnNvtEL(void (*callback)())

28. void setCallbackOnNvtGA(void (*callback)())

This function installs a callback function which will be called whenever the telnet command "GA" (Go Ahead) is received. Use NULL to remove the callback.

Default: NULL

void setCallbackOnNvtGA(void (*callback)())

29. void setCallbackOnNvtWWDD(void (*callback)())

This function installs a callback function which will be called whenever the telnet commands "WILL", "WON'T", "DO" or "DON'T" are received. Use NULL to remove the callback.

Default: NULL

void setCallbackOnNvtWWDD(void (*callback)())

๐Ÿ’ก Hint

Add the following lines to your sketch:

TelnetSpy SerialAndTelnet;
#define SERIAL SerialAndTelnet
// #define SERIAL Serial

Replace Serial with SERIAL in your sketch. Now you can switch between serial only and serial with Telnet by only changing the comments of the defines.

๐Ÿ”” Important

  • To connect to the Telnet server you have to:
    1. Establish the WiFi connection.
    2. Execute SerialAndTelnet.begin(WhatEverYouWant).

๐Ÿ’ก Note: The order is not important.

  • Everything you do with Serial, you can do with TelnetSpy too. But remember: Transfering data also via Telnet will need more performance than the serial port only. So time critical things may be influenced.

  • It is not possible to establish more than one Telnet connection at the same time. But it's possible to use more than one instance of TelnetSpy.

  • If you have problems with low memory, you may reduce the value of the define TELNETSPY_BUFFER_LEN for a smaller ring buffer on initialisation.

  • Usage of void setDebugOutput(bool) to enable / disable of capturing of os_print calls when you have more than one TelnetSpy instance: That TelnetSpy object will handle this functionality where you used setDebugOutput at last. On default, TelnetSpy has the capturing of OS_print calls enabled. So if you have more instances the last created instance will handle the capturing.

๐Ÿ“– License

This library is open-source and licensed under the MIT license.

Do whatever you like with it, but contributions are appreciated!

telnetspy's People

Contributors

anubisg1 avatar kylelobo avatar leojz avatar maxgerhardt avatar obrain17 avatar yasheena avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telnetspy's Issues

Issues when using platformIO

I just found this library and it suits my need. Thanks! I'm using platformio as my environment. It's really neat and way better than the arduino IDE. There are some issues with this library, however..

  1. There is no "max" defined.
void TelnetSpy::setMinBlockSize(uint16_t minSize) {
  minBlockSize = max(1, minSize);
}

So I had to include this in the code

#undef max
#define max(a,b) ((a)>(b)?(a):(b))

  1. There is no RingBuf.h
    You might want to update the readme to include something about which library is needed to be included. I used
    url=https://github.com/wizard97/ArduinoRingBuffer
    And it seems to work.

  2. in the example code and in the readme you have in the master branch you have:

This function installs a callback function which will be called on every telnet connect of this object (except rejected connect tries). Use NULL to remove the callback.
Default: NULL

void setCallbackOnConnect(void (*callback)());
and it's not there in the 1.1 tag. Maybe add something to the master branch readme to have it mention to use the 1.1 readme and example.

TelnetSpy.cpp: In member function 'void

C:\Users\ucupu\Documents\Arduino\libraries\TelnetSpy\TelnetSpy.cpp: In member function 'void TelnetSpy::setDebugOutput(bool)':
C:\Users\ucupu\Documents\Arduino\libraries\TelnetSpy\TelnetSpy.cpp:406:42: error: invalid conversion from 'void*' to 'fp_putc_t {aka void ()(char)}' [-fpermissive]
os_install_putc1((void
) TelnetSpy_putc); // Set system printing (os_printf) to TelnetSpy
^
In file included from C:\Users\ucupu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/include/os_type.h:28:0,
from C:\Users\ucupu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/include/user_interface.h:28,
from C:\Users\ucupu\Documents\Arduino\libraries\TelnetSpy\TelnetSpy.cpp:12:
C:\Users\ucupu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/include/ets_sys.h:219:6: error: initializing argument 1 of 'void ets_install_putc1(fp_putc_t)' [-fpermissive]
void ets_install_putc1(fp_putc_t routine);
^
C:\Users\ucupu\Documents\Arduino\libraries\TelnetSpy\TelnetSpy.cpp:415:50: error: invalid conversion from 'void*' to 'fp_putc_t {aka void ()(char)}' [-fpermissive]
os_install_putc1((void
) TelnetSpy_ignore_putc); // Ignore system printing
^
In file included from C:\Users\ucupu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/include/os_type.h:28:0,
from C:\Users\ucupu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/include/user_interface.h:28,
from C:\Users\ucupu\Documents\Arduino\libraries\TelnetSpy\TelnetSpy.cpp:12:
C:\Users\ucupu\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/include/ets_sys.h:219:6: error: initializing argument 1 of 'void ets_install_putc1(fp_putc_t)' [-fpermissive]
void ets_install_putc1(fp_putc_t routine);
^
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

Linker error when building for ESP32-C3

When building a project in PlatformIO targeting the ESP32-C3, the linker throws the following error:

Linking .pio\build\m5stamp-c3\firmware.elf
c:/users/a/.platformio/packages/toolchain-riscv32-esp/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: .pio\build\m5stamp-c3\libda1\libTelnetSpy.a(TelnetSpy.cpp.o): in function `TelnetSpy::debugWrite(unsigned char)':
G:\Documents\PlatformIO\Projects\Mux Controller/.pio/libdeps/m5stamp-c3/TelnetSpy/TelnetSpy.cpp:346: undefined reference to `ets_write_char_uart'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\m5stamp-c3\firmware.elf] Error 1

Based on this issue in the ESP-IDF repo, it seems ets_write_char_uart() is no longer available for the ESP32-C3. I've managed to bypass this error for now with setDebugOutput(false) and commenting out the debugWrite() and line 520 in TelnetSpy.cpp, but perhaps there is a better solution using the UART driver's uart_tx_chars() instead (I can't seem to find uart_tx_one_char() as suggested in the linked issue in the C3's API reference).

On another note, thank you for all your work on this library!

It is possible to use it without the ring buffer?

It is possible to use it without the ring buffer?

I mean: if I sometimes want to connect to the ESP8266 to se the actual debug messages and not the previous ones? Just like serial, if there is one connected sees the messages otherwise they are lost.

Possible bug in handle() method...

Hi,
First of all thank you for your library, it is just what I was looking for to incorporate in one of my projects.
I have however detected that if an active connection from a client happens to go down before or without properly disconnecting the server will always drop any new connection attempt.

**if (!started || serverClient) {
  telnetServer.available().stop();**
} else {
  serverClient = telnetServer.available();
  if (strlen(welcomeMsg) > 0) {
   serverClient.write((const uint8_t*)welcomeMsg, strlen(welcomeMsg));
   serverClient.flush();
  }
}

For now I have just made a change to stop/disconnect any active connection if a new one comes in but I think implementing a simple watchdog timeout on active data transfer to stop/disconnect would be a better solution.
If the intended behaviour is as it currently is, please forgive me and ignore this.

no matching function for call to 'TelnetSpy::begin()'

Hello,

Iโ€™m receiving no matching function for call to 'TelnetSpy::begin()' during compilation in Arduino IDE 1.8.10 with ESP32 board:


error: no matching function for call to 'TelnetSpy::begin()'

     LOG.begin();

               ^
libraries\telnetspy-master/TelnetSpy.h:208:8: note: candidate: void TelnetSpy::begin(long unsigned int, uint32_t, int8_t, int8_t, bool)

   void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false);

        ^
libraries\telnetspy-master/TelnetSpy.h:208:8: note:   candidate expects 5 arguments, 0 provided

no matching function for call to 'TelnetSpy::begin()'

Iโ€™ve added these code to my sketch:

#include <TelnetSpy.h>
TelnetSpy LOG;
Add the following line to your initialisation block void setup():

LOG.begin();
Add the following line at the beginning of your main loop void loop():

LOG.handle();

@yasheena
Any ideas what can be wrong?

newlines not rendered on Windows telnet

Thanks for the great library. I'm using it in one of my projects to replace some home grown telnet logging libraries. I noticed when using Telnet on Windows the newlines are not left-justified. I think this is because you need a '\r' after a '\n'. For example using your stock example code in a Serial window it shows correctly as:

Connecting to WiFi . Connected!
Ready
IP address: 10.10.10.28

Type 'C' for WiFi connect.
Type 'D' for WiFi disconnect.
Type 'R' for WiFi reconnect.
All other chars will be echoed. Play around...

but in the telnet window:

                                Connecting to WiFi . Connected!
Ready
IP address: 10.10.10.28

Type 'C' for WiFi connect.
                          Type 'D' for WiFi disconnect.
                                                       Type 'R' for WiFi reconnect.
All other chars will be echoed. Play around...

Telnet connection established.

Works fine using telnet from Linux, like an ubuntu shell in Windows10 though.

Example code doesn't compile on 1.8.13

/home/jwl/sketchbook/libraries/telnetspy-master/TelnetSpy.cpp: In member function 'void TelnetSpy::setDebugOutput(bool)':
/home/jwl/sketchbook/libraries/telnetspy-master/TelnetSpy.cpp:406:42: error: invalid conversion from 'void*' to 'fp_putc_t {aka void ()(char)}' [-fpermissive]
os_install_putc1((void
) TelnetSpy_putc); // Set system printing (os_printf) to TelnetSpy
^
In file included from /home/jwl/.arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/include/os_type.h:28:0,
from /home/jwl/.arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/include/user_interface.h:28,
from /home/jwl/sketchbook/libraries/telnetspy-master/TelnetSpy.cpp:12:
/home/jwl/.arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/include/ets_sys.h:219:6: error: initializing argument 1 of 'void ets_install_putc1(fp_putc_t)' [-fpermissive]
void ets_install_putc1(fp_putc_t routine);
^
/home/jwl/sketchbook/libraries/telnetspy-master/TelnetSpy.cpp:415:50: error: invalid conversion from 'void*' to 'fp_putc_t {aka void ()(char)}' [-fpermissive]
os_install_putc1((void
) TelnetSpy_ignore_putc); // Ignore system printing
^
In file included from /home/jwl/.arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/include/os_type.h:28:0,
from /home/jwl/.arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/include/user_interface.h:28,
from /home/jwl/sketchbook/libraries/telnetspy-master/TelnetSpy.cpp:12:
/home/jwl/.arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/include/ets_sys.h:219:6: error: initializing argument 1 of 'void ets_install_putc1(fp_putc_t)' [-fpermissive]
void ets_install_putc1(fp_putc_t routine);
^
Multiple libraries were found for "ArduinoOTA.h"
Used: /home/jwl/.arduino15/packages/esp8266/hardware/esp8266/2.7.1/libraries/ArduinoOTA
Not used: /home/jwl/sketchbook/libraries/ArduinoOTA
exit status 1
Error compiling for board Generic ESP8266 Module.

Error compiling on Arduino Nano ESP32 - cannot convert USBCDC* to HardwareSerial*

Had this error building synman/BME280 for an Arduino Nano ESP32 on PlatformIO.

lib/TelnetSpy/TelnetSpy.cpp:43:13: error: cannot convert 'USBCDC*' to 'HardwareSerial*' in assignment
Google suggested this compile flag:
platformio_options:
board_build.extra_flags:
- "-DARDUINO_USB_CDC_ON_BOOT=0"

Which didn't solve the problem because I put the entire section in, when it should have looked like:
build_flags =
-D PROJECT_NAME='"BME280 Sensor Publisher"'
-D HOSTNAME='"bme280-env-sensor"'
-D ELEGANTOTA_USE_ASYNC_WEBSERVER=1
-D ARDUINO_USB_CDC_ON_BOOT=0
-D BS_USE_TELNETSPY
-D BME280_LOG_LEVEL_BASIC

I kept searching and found an alternative fix...

https://www.esphome.io/api/uart__component__esp32__arduino_8cpp_source

There's this small section :
#if ARDUINO_USB_CDC_ON_BOOT
this->hw_serial_ = &Serial0;
#else
this->hw_serial_ = &Serial;
#endif

The build has the flag set to 0, which forces the serial value to &Serial which fails on the ESP32S3.
Changing the build flag to 1 has no effect.

So I tried changing the value of usedSer = &Serial to usedSer = &Serial0, that worked, but so did the compile flag when platformio.ini was configured properly, my bad.

The compile now runs to building a firmware image :-)

disconnect telnet client feature?

One idea to add is a function to close a telnet client session. For example in an active Telnet session, I would capture a ctrl-D (from a SerialAndTelnet.read()) which would exit the Telnet session, but keep the serial and everything else active. The only way I think you could do this now is by calling end() which kills both the server and client?

so like

void TelnetSpy::disconnectClient() {
    if (client.connected()) {
        client.flush();
        client.stop();
    }
    if (connected && (callbackDisconnect != NULL)) {
        callbackDisconnect();
    }
    connected = false;
}

Does not work in AP only mode (ESP32)

I was never able to establish a connection when using AP only mode on an ESP32 (never tried an 8266).

I have changed the code in handle() to do this about line 548 (commented out below) and I can now use a telnet client when using the AP connection:

```

if (!listening) {

wifi_mode_t currentMode = WiFi.getMode();
bool isAPEnabled = ((currentMode & WIFI_MODE_AP) != 0);
bool isSTAconnected = WiFi.status() == WL_CONNECTED;

// if (WiFi.status() != WL_CONNECTED) {
if (!isSTAconnected && !isAPEnabled)
return;
}

do I have to keep calling handle()

I am looking for a telnet logging method, that basically only send logging to the telnet client.
The code in which I want to implement it contains a very long running loop(), which will make the SerialAndTelnet.handle(); being called only once in a long time.
Is that handle() needed when I only want to SEND data TO the telnet-client and not receive data from the client? (for me it only needs to send at several points in the long loop)
And also, will it be possible for a telnet-client to connect when the loop is already running or is the handle() needed for a client to connect?

TelnetSpy.cpp:17:21: fatal error: RingBuf.h: No such file or directory

Compiling .pio\build\esp07\lib6c5\TelnetSpy_ID6236\TelnetSpy.cpp.o
.pio\libdeps\esp07\TelnetSpy_ID6236\TelnetSpy.cpp:17:21: fatal error: RingBuf.h: No such file or directory
......
 #include <RingBuf.h>
                     ^
compilation terminated.
*** [.pio\build\esp07\lib6c5\TelnetSpy_ID6236\TelnetSpy.cpp.o] Error 1

looks like a missing undocumented dependency

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.