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

Virtual functions in client.h are out of line with standard Arduino API #2755

Closed
SRGDamia1 opened this issue May 7, 2019 · 19 comments · Fixed by #3191 or #10776
Closed

Virtual functions in client.h are out of line with standard Arduino API #2755

SRGDamia1 opened this issue May 7, 2019 · 19 comments · Fixed by #3191 or #10776

Comments

@SRGDamia1
Copy link

Hardware:

Board: ESP32
Core Installation version: 1.0.2
IDE name: PlatformIO
Flash Frequency: N/A
PSRAM enabled: N/A
Upload Speed: N/A
Computer OS: Linux (TravisCI)

Description:

I am working on TinyGSM - a cross-platform GSM client. Because the client.h file in the current ESP32 core does not match the standard Arduino API (https://github.com/arduino/ArduinoCore-API/blob/master/api/Client.h) the library can no longer be compiled by esp32 users.

NOTE: The ESP8266 core introduced the same problem in version 2.5.0. They are fixing it for 2.5.1 (esp8266/Arduino#5969)

Sketch: (leave the backquotes for code formatting)

#include <Arduino.h>

#define TINY_GSM_MODEM_SIM800
#include <TinyGsmClient.h>

void setup() {
}

void loop() {
}

Debug Messages:

Unable to compile because of undefined virtual functions:

/tmp/tmpgkfUuk/src/test_build.ino:11:15: error: cannot declare variable 'client' to be of abstract type 'TinyGsmA6::GsmClient'
TinyGsmClient client(modem);
^
In file included from lib/TinyGSM/src/TinyGsmClient.h:65:0,
from /tmp/tmpgkfUuk/src/test_build.ino:8:
lib/TinyGSM/src/TinyGsmClientA6.h:44:7: note:   because the following virtual functions are pure within 'TinyGsmA6::GsmClient':
class GsmClient : public Client
^
In file included from /home/travis/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:157:0,
from /tmp/tmpdTm4GS:1:
/home/travis/.platformio/packages/framework-arduinoespressif32/cores/esp32/Client.h:31:17: note: 	virtual int Client::connect(IPAddress, uint16_t, int)
virtual int connect(IPAddress ip, uint16_t port, int timeout) =0;
^
/home/travis/.platformio/packages/framework-arduinoespressif32/cores/esp32/Client.h:32:17: note: 	virtual int Client::connect(const char*, uint16_t, int)
virtual int connect(const char *host, uint16_t port, int timeout) =0;
^

This was also mentioned in #2704.

@jozala
Copy link

jozala commented May 14, 2019

I've got the same problem. After downgrading to 1.0.1 it works again.

@thujer
Copy link

thujer commented May 15, 2019

Hardware

Board: WeMos WiFi and Bluetooth Battery
Platform: Espressif 32
Configuration: ESP32 240MHz 320KB RAM (4MB Flash)
IDE: VSCode 1.33.1
OS: Linux / XUbuntu

Description

We are working on multi communication device (Wifi, Ethernet, RS232, Bluetooth). Last week we cannot compile source codes, because there is some errors in Ethernet library, described bellow.

I tried to compile some basic Arduino examples (WebClient) in Arduino IDE and I got same resolution.

In file included from src/EthernetController/EthernetController.h:5:0,
from src/App/App.h:11,
from src/App/App.cpp:2:
.piolibdeps/Ethernet_ID872/src/Ethernet.h:258:2: error: invalid abstract return type 'EthernetClient'
EthernetClient available();
^
.piolibdeps/Ethernet_ID872/src/Ethernet.h:214:7: note:   because the following virtual functions are pure within 'EthernetClient':
class EthernetClient : public Client {
^

Screenshot_2019-05-14_17-03-19

Screenshot_2019-05-14_18-24-17

This was also mentioned in Arduino Libraries Issues
arduino-libraries/Ethernet#97

@misak113
Copy link

We're dealing with the exactly same issue. Could you please, please 👍 look at it? :)

@digitalwm
Copy link

Same issue here.

@brentru
Copy link

brentru commented May 30, 2019

Same issue with ArduinoHTTPClient and Adafruit IO Arduino, @me-no-dev will this change be reverted in a future 1.0.3 release similar to what happened with the Arduino ESP8266 core.

@thujer
Copy link

thujer commented Jun 10, 2019

We fixed this incompatibility by downgrading Espressif32 platform core from 1.8.0 to 1.7.0.

Just put line bellow into platformio.ini

platform = [email protected]

If some other libraries was updated and some errors will be show, then try downgrade libraries by the same way or put the old libraries code directly into the project directory and update #include directives.

Good Luck

Hardware

Board: WeMos WiFi and Bluetooth Battery
Platform: Espressif 32
Configuration: ESP32 240MHz 320KB RAM (4MB Flash)
IDE: VSCode 1.33.1
OS: Linux / XUbuntu

Description

We are working on multi communication device (Wifi, Ethernet, RS232, Bluetooth). Last week we cannot compile source codes, because there is some errors in Ethernet library, described bellow.

I tried to compile some basic Arduino examples (WebClient) in Arduino IDE and I got same resolution.

In file included from src/EthernetController/EthernetController.h:5:0,
from src/App/App.h:11,
from src/App/App.cpp:2:
.piolibdeps/Ethernet_ID872/src/Ethernet.h:258:2: error: invalid abstract return type 'EthernetClient'
EthernetClient available();
^
.piolibdeps/Ethernet_ID872/src/Ethernet.h:214:7: note:   because the following virtual functions are pure within 'EthernetClient':
class EthernetClient : public Client {
^

Screenshot_2019-05-14_17-03-19

Screenshot_2019-05-14_18-24-17

This was also mentioned in Arduino Libraries Issues
arduino-libraries/Ethernet#97

@brentru
Copy link

brentru commented Jun 10, 2019

@thujer Yep, you can downgrade to retain the old feature. Point is - the function signatures should be in-line with the Arduino API in a new release of the ESP32 BSP.

@brentru
Copy link

brentru commented Jun 13, 2019

@me-no-dev Any updates on this?

@eabase
Copy link

eabase commented Jul 19, 2019

Hi Guys!
Why not try to fix this? It just doesn't make sense to have to downgrade, since who knows what other crazy 2ndary bugs would get (re)introduced by doing such a thing.

We're also trying to implement an IoT solution that require an updated library when using TinyGSM, so it would be a bloody shame to have to abandon 2 libraries (and perhaps even more) just because this one won't play ball. Especially since several other things already depend on this.

I hope you can reconsider and prioritize this issue.

Cheers,
👍

@xvinny-zz
Copy link

I had to implement my own HttpClient (it is very simple, with support only for GET). Like @eabase said, why don't you prioritize this issue? It is simple to solve and it would help a lot of users!!

@brentru
Copy link

brentru commented Aug 12, 2019

@me-no-dev Any updates on this issue?

@hardmax
Copy link

hardmax commented Aug 30, 2019

Hi,

ArduinoHttpClient library has the same problem, please review to correct this..are a lot a libraries with problems

@kugelkopf123
Copy link

The Problem still exists with 1.0.3-rc3

@me-no-dev
Copy link
Member

Sorry guys! I get hundreds of emails daily and it's not possible to read them all. Please, stop by gitter (link in the readme) and drop a message if something is seriously wrong. I try to keep an eye there. Issue is fixed and will be in 1.0.3 final.

@xvinny-zz
Copy link

@SRGDamia1 the 1.0.3 final update was released!!!

@brentru
Copy link

brentru commented Sep 18, 2019

1.0.3 works with Adafruit IO Arduino and Adafruit MQTT, thanks @me-no-dev.

@SRGDamia1
Copy link
Author

Thanks!

@per1234
Copy link
Contributor

per1234 commented Dec 17, 2024

There was a regression of this bug in #10202

Examples of breakage caused:

@pennam
Copy link
Contributor

pennam commented Dec 17, 2024

It breaks also arduino-libraries/ArduinoMqttClient#112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet