aws-mqtt-websockets icon indicating copy to clipboard operation
aws-mqtt-websockets copied to clipboard

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

Open gunnicus opened this issue 6 years ago • 11 comments

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'

gunnicus avatar Dec 21 '18 09:12 gunnicus

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

b-n avatar Dec 23 '18 09:12 b-n

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

BMAnush avatar Jan 09 '19 11:01 BMAnush

@nzchicken that worked for me

stavros-zavrakas avatar Feb 14 '19 23:02 stavros-zavrakas

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.

apicquot avatar Feb 19 '19 23:02 apicquot

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 ^.^

odelot avatar Feb 20 '19 12:02 odelot

I ll confirm to you the libraries version I am using tonight.

I posted an issue about erratic connection. Let me know if you have any clue about this.

Kind regards.

Sent from my iPhone

On Feb 20, 2019, at 7:27 AM, Fábio Toledo [email protected] wrote:

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 ^.^

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

apicquot avatar Feb 20 '19 14:02 apicquot

@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.

odelot avatar Feb 21 '19 04:02 odelot

Thank you Fabio. I did not a chance to do test yesterday. I ll let you know if I find anything. Not easy at this point to know what issue is related to 2.5 , I am using a staged version between 2.4.2 and 2.5

Best.

Sent from my iPhone

On Feb 20, 2019, at 11:52 PM, Fábio Toledo [email protected] wrote:

@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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

apicquot avatar Feb 21 '19 13:02 apicquot

I managed to get it work by changing the time source to Amazon _useAmazonTimestamp = true, thank you for tip.

I am using PubSubClient 2.6 AWS_SDK_Arduino master Arduino Websocket 2.1.1 esp8266/Arduino https://github.com/apicquot/Arduino.git tag=WebSocket_Working

Unfortunatly a bunch of error comes with current the current stage, probably a bunch more of pure virtual method to adapt.

Best.

On Thu, Feb 21, 2019 at 8:09 AM Alexandre Picquot < [email protected]> wrote:

Thank you Fabio. I did not a chance to do test yesterday. I ll let you know if I find anything. Not easy at this point to know what issue is related to 2.5 , I am using a staged version between 2.4.2 and 2.5

Best.

Sent from my iPhone

On Feb 20, 2019, at 11:52 PM, Fábio Toledo [email protected] wrote:

@apicquot https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/odelot/aws-mqtt-websockets/issues/49#issuecomment-465861347, or mute the thread https://github.com/notifications/unsubscribe-auth/AJikZR6AnZmItpVfV54XXphoDnOttzOuks5vPiYNgaJpZM4ZdnqY .

apicquot avatar Feb 22 '19 19:02 apicquot

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.

saamirt avatar Mar 14 '19 05:03 saamirt

You can pull it from my fork: https://github.com/apicquot/Arduino.git

from there you need to check out the branch Alex-Prod

On Thu, Mar 14, 2019 at 1:47 AM Aamir Tahir [email protected] wrote:

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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/odelot/aws-mqtt-websockets/issues/49#issuecomment-472712956, or mute the thread https://github.com/notifications/unsubscribe-auth/AJikZeED_K8awJ-zo7Hs-8R-7pcHprbvks5vWeKLgaJpZM4ZdnqY .

apicquot avatar Mar 14 '19 21:03 apicquot