LennartHennigs / ESPTelnet

ESP library that allows you to setup a telnet server for debugging.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error: 'class IPAddress' has no member named 'isSet'

zenbooster opened this issue · comments

When compilling TelnetServerExample for esp32-wroom-32:

C:\Users\home\Documents\Arduino\libraries\ESP_Telnet\src\ESPTelnet.cpp: In member function 'bool ESPTelnet::begin()':
C:\Users\home\Documents\Arduino\libraries\ESP_Telnet\src\ESPTelnet.cpp:16:56: error: 'class IPAddress' has no member named 'isSet'
   if (WiFi.status() == WL_CONNECTED || WiFi.softAPIP().isSet()) {
                                                        ^

Ah, thanks again.
Yes, I encountered that before - the WiFi classes of 32 and 8266 are slightly different. That's quite annoying. Plus, it's not that well documented.

Will check how to determine wether an IP is (in)valid on a 32.

Hi @LennartHennigs , I was testing your library on an ESP32 and encountered this exact issue too.
Do you have an update ? Thanks!

This library could be the answer to my prayers.

However, I'm seeing the same isSet() error reported above using my ESP-32 WROOM32D. I'm using the DOIT DEVKIT V1 board template on Arduino 1.8.51 and the Library version shows up as Version: 1.2.1.

Thanks for any help you can provide

C:...\Arduino\libraries\ESP_Telnet\src\ESPTelnet.cpp: In member function 'bool ESPTelnet::begin()':
C:...\Arduino\libraries\ESP_Telnet\src\ESPTelnet.cpp:16:56: error: 'class IPAddress' has no member named 'isSet'
if (WiFi.status() == WL_CONNECTED || WiFi.softAPIP().isSet()) {
_________________________________________________________^
I encountered this conflict as well, running an esp32 Dev Module, Win 10 environment using Arduino IDE 1.8.16.

If I compile for the ESP8266 it compiles fine and if I switch to the ESP32, it fails.

I tried this in your code for now!

/* ------------------------------------------------- */

bool ESPTelnet::begin() {
ip = "";
// connected to WiFi or is ESP in AP mode?
#if defined(ARDUINO_ARCH_ESP8266)
if (WiFi.status() == WL_CONNECTED || WiFi.softAPIP().isSet()) {
server.begin();
server.setNoDelay(true);
return true;
} else {
return false;
}
#elif defined(ARDUINO_ARCH_ESP32)
if (WiFi.status() == WL_CONNECTED ) {
server.begin();
server.setNoDelay(true);
return true;
} else {
return false;
}
#endif

}

Telnet is a very cool feature for the ESP, great work!!
Thanks for your time!!
Nash.

Added a private function that either uses isSet() (for ESP8266) or looks at the toString() ip address (for ESP32)

Dear Friend,
I think you should add the prototype of the _isIPSet() helper function also to the header file. Without this I got the following error message:

/Users/szilva/Documents/Arduino/libraries/ESP_Telnet/src/ESPTelnet.cpp:14:38: error: no 'bool ESPTelnet::_isIPSet(IPAddress)' member function declared in class 'ESPTelnet'
bool ESPTelnet::_isIPSet(IPAddress ip) {
^

Hey, I published the code with v.1.2.2.
It should work now.