witnessmenow / arduino-facebook-api

A wrapper around the facebook api for arduino
GNU General Public License v2.0
11 stars 10 forks source link

Problems With GetFriendsCount #5

Open sergeibellagamba opened 6 years ago

sergeibellagamba commented 6 years ago

Hi, I'm a complete amateur to this and I have tried following your instructions but I'm running in to this error in the Arduino IDE when compiling the code:

Arduino: 1.8.4 (Windows 10), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, 4M (1M SPIFFS), v2 Prebuilt (MSS=536), Disabled, None, 115200"

C:\Users\serge\Documents\Arduino\GetFriendsCount\GetFriendsCount.ino: In function 'void setup()':

GetFriendsCount:70: error: no matching function for call to 'FacebookApi::FacebookApi(WiFiClientSecure&, String&)'

api = new FacebookApi(client, FACEBOOK_ACCESS_TOKEN);

                                                  ^

C:\Users\serge\Documents\Arduino\GetFriendsCount\GetFriendsCount.ino:70:54: note: candidates are:

In file included from C:\Users\serge\Documents\Arduino\GetFriendsCount\GetFriendsCount.ino:8:0:

C:\Users\serge\Documents\Arduino\libraries\arduino-facebook-api\src/FacebookApi.h:36:5: note: FacebookApi::FacebookApi(Client&, String, String, String)

 FacebookApi(Client &client, String accessToken, String appId, String appSecret);

 ^

C:\Users\serge\Documents\Arduino\libraries\arduino-facebook-api\src/FacebookApi.h:36:5: note: candidate expects 4 arguments, 2 provided

C:\Users\serge\Documents\Arduino\libraries\arduino-facebook-api\src/FacebookApi.h:33:7: note: FacebookApi::FacebookApi(const FacebookApi&)

class FacebookApi

   ^

C:\Users\serge\Documents\Arduino\libraries\arduino-facebook-api\src/FacebookApi.h:33:7: note: candidate expects 1 argument, 2 provided

C:\Users\serge\Documents\Arduino\libraries\arduino-facebook-api\src/FacebookApi.h:33:7: note: FacebookApi::FacebookApi(FacebookApi&&)

C:\Users\serge\Documents\Arduino\libraries\arduino-facebook-api\src/FacebookApi.h:33:7: note: candidate expects 1 argument, 2 provided

exit status 1 no matching function for call to 'FacebookApi::FacebookApi(WiFiClientSecure&, String&)'

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

Any help would be much appreciated, thanks.

witnessmenow commented 6 years ago

Thanks for the report, this is a bug for sure.

As a temporary workaround can you please change this line

api = new FacebookApi(client, FACEBOOK_ACCESS_TOKEN);

to

api = new FacebookApi(client, FACEBOOK_ACCESS_TOKEN, "", "");

and see if that works

sergeibellagamba commented 6 years ago

HI Brian,

Thanks for the very prompt reply.

I have amended the code and it now seems to work. I am getting the following response in the serial monitor:

Failed to open config file JSON respnse was not as expected Facebook Friends: 89

And then after five mins I got:

JSON respnse was not as expected JSON respnse was not as expected Error getting friends count

This then repeated after another five mins.

I will unplug the ESP8266 and try again later to see what is returned.