vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.96k stars 726 forks source link

Can`t compile for ESP8266 (Nodemcu) as main board #220

Closed saloid closed 5 years ago

saloid commented 5 years ago

TinyGSM version: 0.3.5 ESP SDK: actual git clone from https://github.com/esp8266/Arduino

Hardware: Main board is ESP8266 (Nodemcu) with SIM800 connected to it.

Scenario, steps to reproduce

Try to compile any example sketch with TinyGsmClient for Nodemcu board

Expected result

Compilation success

Actual result

Compilation error:

WebClient:66:17: error: cannot declare variable 'client' to be of abstract type 'TinyGsmSim800::GsmClient'

   TinyGsmClient client(modem);

                 ^

In file included from C:\Users\Dmytro\Documents\Arduino\libraries\TinyGSM\src/TinyGsmClient.h:22:0,

                 from C:\Users\Dmytro\AppData\Local\Temp\arduino_modified_sketch_886307\WebClient.ino:25:

C:\Users\Dmytro\Documents\Arduino\libraries\TinyGSM\src/TinyGsmClientSIM800.h:53:7: note:   because the following virtual functions are pure within 'TinyGsmSim800::GsmClient':

 class GsmClient : public Client

       ^

In file included from C:\Users\Dmytro\Documents\Arduino\libraries\TinyGSM\src/TinyGsmCommon.h:25:0,

                 from C:\Users\Dmytro\Documents\Arduino\libraries\TinyGSM\src/TinyGsmClientSIM800.h:21,

                 from C:\Users\Dmytro\Documents\Arduino\libraries\TinyGSM\src/TinyGsmClient.h:22,

                 from C:\Users\Dmytro\AppData\Local\Temp\arduino_modified_sketch_886307\WebClient.ino:25:

C:\Users\Dmytro\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Client.h:37:22: note:   virtual bool Client::flush(unsigned int)

         virtual bool flush(unsigned int maxWaitMs = 0) = 0;

                      ^

C:\Users\Dmytro\Documents\Arduino\hardware\esp8266com\esp8266\cores\esp8266/Client.h:38:22: note:   virtual bool Client::stop(unsigned int)

         virtual bool stop(unsigned int maxWaitMs = 0) = 0;

                      ^
saloid commented 5 years ago

Partially fixed it here: #221

vshymanskyy commented 5 years ago

I think this is an issue, introduced in ESP8266 core 2.5.0. Need to investigate it further

laxman-spidey commented 5 years ago

I'm facing the same issue, is this solved yet? Does it work if i downgrade ESP8266 core to <2.5.0

saloid commented 5 years ago

Partially solved, look at my fix at the top. If you are using another GSM module - edit files for it

SRGDamia1 commented 5 years ago

I think the correct solution will be to wait for the ESP8266 core to fix the extra virtual functions it introduced: https://github.com/esp8266/Arduino/issues/5749

emi1988 commented 5 years ago

I'm facing the same issue, is this solved yet? Does it work if i downgrade ESP8266 core to <2.5.0

Yes, for me it works if I downgrade the ESP8266 core to Version 2.4.2

d-a-v commented 5 years ago

esp8266/Arduino#5969 adresses it

hardmax commented 5 years ago

Hi, the same problem with ESP32, I have to downgrade to 1.0.1 to works...

SRGDamia1 commented 5 years ago

The compiler problems with the ESP32 and ESP8266 should now be fixed.