-
Notifications
You must be signed in to change notification settings - Fork 738
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
During comilation example WebClient.ino on ESP32 got error "cannot declare variable 'client' to be of abstract type 'TinyGsmSim800::GsmClient' #269
Comments
The problem occurs only when using GSMClient class. Everything work ok without using it. The error is the same. On the Arduino Mega 2560 compiled without problems. Someone has managed the problem? |
I have the same problem, for now I change my Arduino ESP32 Board Version form 1.0.2 to 1.0.1...With this I can compile now |
This is a problem only for the esp32 hardware, to solveit I comment in C:\Users\Max\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32\Client.h This two lines: //virtual int connect(IPAddress ip, uint16_t port, int timeout) =0; After that I can compile, but It is not the correct solution... |
Thank you for the solution. But, I suppose it's a too rough way to solve the problem. Every time you need to remember, that after ESP32 lib updating you need to fix Client.h |
I solved the problem with compilation adding this block of code into TinyGsmClientSIM800.h #ifdef ESP32 || ESP8266 virtual int connect(const char *host, uint16_t port, int timeout) #ifdef added since on Arduino boards everything compiles ok. I've made pull request to implement this piece of code in the TinyGsmClientSIM800.h. 85368d1 |
Same problem here while compiling on a ESP8266 / WeMos D1. I tried Warlib1975 fix to no avail. Compiliation breaks at the TinyGsmClient client(modem) - Line 81 in the webclient.ino. |
Try to remove ifdef section of the fix. I'm not sure that in case of different ESP8266 boards this clause works properly. |
Thanks Warlib1975 for the idea - sadly no luck there :( |
This really should be fixed on the ESP32 side, not by TinyGSM. They added/modified virtual functions to the Client.h that are out of line with the standard Arduino API. They should have been aware of this, but I created a new issue on their side just in case (espressif/arduino-esp32#2755). The ESP8266 core created the same problem in version 2.5.0. On the ESP8266 side, it appears to be fixed for the yet-to-be-released 2.5.1. |
As mentioned in #220, you should be able to compile by rolling back to core version 1.0.1 for the ESP32. For the ESP8266 you could roll back to 2.4.2 or use pull the core from git. |
The compiler problems with the ESP32 and ESP8266 should now be fixed. The timeout functions are now fully implemented for all modems. |
During compilation on ESP32 board the example WebClient.ino got the error
GSM_SIM800L.cpp:39:15: error: cannot declare variable 'client' to be of abstract type 'TinyGsmSim800::GsmClient'
TinyGsmClient client(modemGSM);
In file included from C:\Users\Fedorov_A\Documents\Arduino\libraries\TinyGSM_ID1287\src/TinyGsmClient.h:15:0,
C:\Users\Fedorov_A\Documents\Arduino\libraries\TinyGSM_ID1287\src/TinyGsmClientSIM800.h:50:7: note: because the following virtual functions are pure within 'TinyGsmSim800::GsmClient':
class GsmClient : public Client
In file included from C:\Users\Fedorov_A\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32/Arduino.h:157:0,
C:\Users\Fedorov_A\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32/Client.h:31:17: note: virtual int Client::connect(IPAddress, uint16_t, int)
C:\Users\Fedorov_A\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.2\cores\esp32/Client.h:32:17: note: virtual int Client::connect(const char*, uint16_t, int)
Multiple libraries were found for "WiFiClient.h"
I couldn't find any solution here. The issue #220 is similar for ESP8266
The text was updated successfully, but these errors were encountered: