yasheena / telnetspy

Telnet Server For ESP8266: Cloning the serial port via Telnet. "Debugging over the air"
MIT License
59 stars 31 forks source link

Issues when using platformIO #5

Closed jbuszkie closed 2 years ago

jbuszkie commented 5 years ago

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

2. 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.

3. 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.
nmaupu commented 4 years ago

I have the same problem... I am wondering, is this project still maintained ?

pfeerick commented 4 years ago

All of these problems are related to the fact that PlatformIO only has the latest tagged version of the code, namely v1.1, which is from Oct 23, 2017!!! max was resolved, no more external RingBuffer dependency, and documentation is correct for the version it relates to (Master branch is NOT v1.1!).

There are issues with the library post the last update to this library (related to changes from Sep 28, 2019 in the putc1 function in the ESP8266 Arduino core), which is why forks like strandaster/telnetspy exist. Best way to use these in PlatformIO now is to use the master branch as is, or tie it to a specific commit if you want to version lock it.

i.e. lib_deps = strandaster/telnetspy or lib_deps = strandaster/telnetspy#33b39d in your projects platformio.ini

yasheena commented 2 years ago

With version 1.4 all problems should be gone.