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

pubsubclient sample cannot compile cannot declare variable 'awsWSclient' to be of abstract type 'AWSWebSocketClient' #49

Open
gunnicus opened this issue Dec 21, 2018 · 11 comments

Comments

@gunnicus
Copy link

gunnicus commented Dec 21, 2018

Here is the errors after I compile. I'm using a NodeMCU 1.0 (ESP-12E Module) board.

aws-mqtt-websocket-example-pubsubclient:44: error: cannot declare variable 'awsWSclient' to be of abstract type 'AWSWebSocketClient'

AWSWebSocketClient awsWSclient(1000);

                ^

In file included from D:\Arduino\Wifi\aws-mqtt-websockets-master\examples\aws-mqtt-websocket-example-pubsubclient\aws-mqtt-websocket-example-pubsubclient.ino:21:0:

sketch\AWSWebSocketClient.h:25:7: note: because the following virtual functions are pure within 'AWSWebSocketClient':

class AWSWebSocketClient : public Client, private WebSocketsClient {

   ^

In file included from C:\Users\water\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta1\libraries\ESP8266WiFi\src/WiFiClient.h:27:0,

             from C:\Users\water\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta1\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39,

             from D:\Arduino\Wifi\aws-mqtt-websockets-master\examples\aws-mqtt-websocket-example-pubsubclient\aws-mqtt-websocket-example-pubsubclient.ino:4:

C:\Users\water\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta1\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\water\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta1\cores\esp8266/Client.h:37:22: note: virtual bool Client::flush(unsigned int)

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

                  ^

C:\Users\water\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta1\cores\esp8266/Client.h:38:22: note: virtual bool Client::stop(unsigned int)

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

                  ^

exit status 1
cannot declare variable 'awsWSclient' to be of abstract type 'AWSWebSocketClient'

@b-n
Copy link

b-n commented Dec 23, 2018

I have just run into the same issue, however I believe this is due to the changes in the ESP8266 library. If you did what I did (cloned from their live github version) then you'll find the code isn't compatible for this library anymore. I would have thought that this would be a major version for them since they're changing the function declarations, but oh well.

My suggestion would be to checkout the 2.4.2 version of the ESP8266 repo, as that appears to compile alright with this library as it currently stands. Note, I needed to restart the arduino IDE in order to get this to verify

@BMAnush
Copy link

BMAnush commented Jan 9, 2019

I am facing the same issue.....What are the workarounds until the fix or next release?

@stavros-zavrakas
Copy link

@nzchicken that worked for me

@apicquot
Copy link
Contributor

latest version of the esp8266/arduino library is using different signatures for the flush and stop methods: just need to change the signature of these 2 methods. I will make a pull request with my code. Yuo can otherwise directly download the aws-mqtt-websockets from my fork.

@odelot
Copy link
Owner

odelot commented Feb 20, 2019

thank you @apicquot. Have you tested with esp8266 sdk version 2.5.0 beta? and about websockets library and pubsubclient library version? everything is ok? I won't have time to test it. But i will update the readme with your info ^.^

@apicquot
Copy link
Contributor

apicquot commented Feb 20, 2019 via email

@odelot
Copy link
Owner

odelot commented Feb 21, 2019

@apicquot I've tested today and I had strange behavior with 2.5.0 sdk. When I turned on the debug messages from websocket library I start to got memory exceptions and reboots. Maybe the changes between 2.4.2 and 2.5.0 are big and will demand a close study to make the library works with it.

then I come back to 2.4.2 and my project was back to work fine.

I will try to update the pubsubclient to version 2.7 and try the 2.5.0 sdk again later.

@apicquot
Copy link
Contributor

apicquot commented Feb 21, 2019 via email

@apicquot
Copy link
Contributor

apicquot commented Feb 22, 2019 via email

@saamirt
Copy link

saamirt commented Mar 14, 2019

Can someone link to the esp8266 library 2.4.2 version that helped solve some issues? I'm not sure which library the previous comments were referring to.

@apicquot
Copy link
Contributor

apicquot commented Mar 14, 2019 via email

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

No branches or pull requests

7 participants