B4R Question WiFi connection: error when compiling

GiG

Member
Hi All,

using ESP-01 I'm trying to get a WiFi connection to my router, I'm using this simple code:

B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private wifi As ESP8266WiFi
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    If wifi.Connect("legacy") Then
        Log("Connected to router.")
    Else
        Log("Failed to connect to router.")
        Return
    End If

End Sub

When compiling I get this long LOG error:
B4X:
B4R Versione: 2.51
Analisi del Codice.    (0.00s)
Compilazione del codice.    (0.01s)
Compilazione Progetto    (0.02s)
Compilazione & distribuzione del progetto Ino (WeMos D1 R1 - COM12)    Error
Sto caricando la configurazione...
Sto inizializzando i pacchetti...
Sto preparando le schede...
Sto verificando...
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\b4r_main.cpp:1:
rESP8266WiFi.h:89:23: error: cannot declare field 'B4R::WiFiSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   because the following virtual functions are pure within 'B4R::BufferedWiFiClient':
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RCore.cpp:1:
rESP8266WiFi.h:89:23: error: cannot declare field 'B4R::WiFiSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   because the following virtual functions are pure within 'B4R::BufferedWiFiClient':
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:11:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RCore.cpp:1:
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:29:21: note:     virtual int Client::connect(const IPAddress&, uint16_t)
         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;
                     ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:37:22: note:     virtual bool Client::flush(unsigned int)
         virtual bool flush(unsigned int maxWaitMs = 0) = 0;
                      ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:38:22: note:     virtual bool Client::stop(unsigned int)
         virtual bool stop(unsigned int maxWaitMs = 0) = 0;
                      ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RCore.cpp:1:
rESP8266WiFi.h:125:23: error: cannot declare field 'B4R::WiFiSSLSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   since type 'B4R::BufferedWiFiClient' has pure virtual functions
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:11:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\b4r_main.cpp:1:
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:29:21: note:     virtual int Client::connect(const IPAddress&, uint16_t)
         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;
                     ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:37:22: note:     virtual bool Client::flush(unsigned int)
         virtual bool flush(unsigned int maxWaitMs = 0) = 0;
                      ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:38:22: note:     virtual bool Client::stop(unsigned int)
         virtual bool stop(unsigned int maxWaitMs = 0) = 0;
                      ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\b4r_main.cpp:1:
rESP8266WiFi.h:125:23: error: cannot declare field 'B4R::WiFiSSLSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   since type 'B4R::BufferedWiFiClient' has pure virtual functions
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\src\src.ino:1:
rESP8266WiFi.h:89:23: error: cannot declare field 'B4R::WiFiSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   because the following virtual functions are pure within 'B4R::BufferedWiFiClient':
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:11:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\src\src.ino:1:
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:29:21: note:     virtual int Client::connect(const IPAddress&, uint16_t)
         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;
                     ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:37:22: note:     virtual bool Client::flush(unsigned int)
         virtual bool flush(unsigned int maxWaitMs = 0) = 0;
                      ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:38:22: note:     virtual bool Client::stop(unsigned int)
         virtual bool stop(unsigned int maxWaitMs = 0) = 0;
                      ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\src\src.ino:1:
rESP8266WiFi.h:125:23: error: cannot declare field 'B4R::WiFiSSLSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   since type 'B4R::BufferedWiFiClient' has pure virtual functions
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RStream.cpp:1:
rESP8266WiFi.h:89:23: error: cannot declare field 'B4R::WiFiSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   because the following virtual functions are pure within 'B4R::BufferedWiFiClient':
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:11:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RStream.cpp:1:
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:29:21: note:     virtual int Client::connect(const IPAddress&, uint16_t)
         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;
                     ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:37:22: note:     virtual bool Client::flush(unsigned int)
         virtual bool flush(unsigned int maxWaitMs = 0) = 0;
                      ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:38:22: note:     virtual bool Client::stop(unsigned int)
         virtual bool stop(unsigned int maxWaitMs = 0) = 0;
                      ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RStream.cpp:1:
rESP8266WiFi.h:125:23: error: cannot declare field 'B4R::WiFiSSLSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   since type 'B4R::BufferedWiFiClient' has pure virtual functions
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.cpp:1:
rESP8266WiFi.h:89:23: error: cannot declare field 'B4R::WiFiSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   because the following virtual functions are pure within 'B4R::BufferedWiFiClient':
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:11:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.cpp:1:
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:29:21: note:     virtual int Client::connect(const IPAddress&, uint16_t)
         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;
                     ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:37:22: note:     virtual bool Client::flush(unsigned int)
         virtual bool flush(unsigned int maxWaitMs = 0) = 0;
                      ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:38:22: note:     virtual bool Client::stop(unsigned int)
         virtual bool stop(unsigned int maxWaitMs = 0) = 0;
                      ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.cpp:1:
rESP8266WiFi.h:125:23: error: cannot declare field 'B4R::WiFiSSLSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   since type 'B4R::BufferedWiFiClient' has pure virtual functions
  class BufferedWiFiClient : public Client {
        ^
exit status 1
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RArduino.cpp:1:
rESP8266WiFi.h:89:23: error: cannot declare field 'B4R::WiFiSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   because the following virtual functions are pure within 'B4R::BufferedWiFiClient':
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:11:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RArduino.cpp:1:
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:29:21: note:     virtual int Client::connect(const IPAddress&, uint16_t)
         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;
                     ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:37:22: note:     virtual bool Client::flush(unsigned int)
         virtual bool flush(unsigned int maxWaitMs = 0) = 0;
                      ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:38:22: note:     virtual bool Client::stop(unsigned int)
         virtual bool stop(unsigned int maxWaitMs = 0) = 0;
                      ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RArduino.cpp:1:
rESP8266WiFi.h:125:23: error: cannot declare field 'B4R::WiFiSSLSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   since type 'B4R::BufferedWiFiClient' has pure virtual functions
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\Scheduler.cpp:2:
rESP8266WiFi.h:89:23: error: cannot declare field 'B4R::WiFiSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   because the following virtual functions are pure within 'B4R::BufferedWiFiClient':
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:11:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\Scheduler.cpp:2:
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:29:21: note:     virtual int Client::connect(const IPAddress&, uint16_t)
         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;
                     ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:37:22: note:     virtual bool Client::flush(unsigned int)
         virtual bool flush(unsigned int maxWaitMs = 0) = 0;
                      ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:38:22: note:     virtual bool Client::stop(unsigned int)
         virtual bool stop(unsigned int maxWaitMs = 0) = 0;
                      ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\Scheduler.cpp:2:
rESP8266WiFi.h:125:23: error: cannot declare field 'B4R::WiFiSSLSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   since type 'B4R::BufferedWiFiClient' has pure virtual functions
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\BufferedWiFiClient.cpp:1:
rESP8266WiFi.h:89:23: error: cannot declare field 'B4R::WiFiSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   because the following virtual functions are pure within 'B4R::BufferedWiFiClient':
  class BufferedWiFiClient : public Client {
        ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:11:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\BufferedWiFiClient.cpp:1:
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:29:21: note:     virtual int Client::connect(const IPAddress&, uint16_t)
         virtual int connect(CONST IPAddress& ip, uint16_t port) =0;
                     ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:37:22: note:     virtual bool Client::flush(unsigned int)
         virtual bool flush(unsigned int maxWaitMs = 0) = 0;
                      ^
C:\Users\NB\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266/Client.h:38:22: note:     virtual bool Client::stop(unsigned int)
         virtual bool stop(unsigned int maxWaitMs = 0) = 0;
                      ^
In file included from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\B4RDefines.h:25:0,
                 from D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\BufferedWiFiClient.cpp:1:
rESP8266WiFi.h:125:23: error: cannot declare field 'B4R::WiFiSSLSocket::client' to be of abstract type 'B4R::BufferedWiFiClient'
    BufferedWiFiClient client;
                       ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\rESP8266WiFi.h:56:8: note:   since type 'B4R::BufferedWiFiClient' has pure virtual functions
  class BufferedWiFiClient : public Client {
        ^
D:\DOCUME~2\2019B4~1\Example\WiFi\Objects\bin\sketch\BufferedWiFiClient.cpp: In member function 'virtual void B4R::BufferedWiFiClient::stop()':
BufferedWiFiClient.cpp:47:30: error: return-statement with a value, in function returning 'void' [-fpermissive]
   return wrappedClient->stop();


I'm using 2 libraries: rCore 2.0 and rESP8266WiFi(v1.33)

Arduino version is 1.8.8 and set to board "WeMos D1 R1"

What I'm doing wrong?

Thank you

GiG
 

GiG

Member
Hi,

here is the zip.

I discover that the compiling problem happend if I load rESP8266WiFi library even with a blank code, I mean even without use the library.

With other libraries there are non problems.
 

Attachments

  • WiFi-01.zip
    635 bytes · Views: 136
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should use esp8266 SDK v2.4.2. You are probably using the latest beta version.

SS-2019-01-08_11.09.51.png
 
Upvote 0
Top