Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

FirebaseCloudMessaging_Send_ESP8266 Error -1 :: connection refused #210

Closed
Waxok opened this issue Oct 7, 2016 · 12 comments
Closed

FirebaseCloudMessaging_Send_ESP8266 Error -1 :: connection refused #210

Waxok opened this issue Oct 7, 2016 · 12 comments

Comments

@Waxok
Copy link

Waxok commented Oct 7, 2016

Hi I tested the FirebaseDemo_ESP8266 example and it works correctly. but in the FirebaseCloudMessaging_Send_ESP8266 does not work gives me this error "Error-1 :: connection refused" (and configure the keys and ids). What could be the error, or have to make any additional settings on the console Firebase? Thank you

@proppy
Copy link
Contributor

proppy commented Nov 1, 2016

can you recompile with httpclient + ssl debugging on (Tools > Debug Level) and paste the log here?

Thanks in advance.

@Zalkya
Copy link

Zalkya commented Jan 25, 2017

Hi proppy i am having the same problem, i don't know either how to make the steps you advice on tour response, could you please explain better.
Thanks!

@proppy
Copy link
Contributor

proppy commented Jan 25, 2017

@Zalkya
Copy link

Zalkya commented Jan 25, 2017

@proppy the problem is that i am using a NodeMcu board called Lolin (NodeMcu 1.0 ESP-12E Module)

The options:
image

The board:
image

Maybe it doesn`t support this debug level i think....
Then o tried to compile and upload the sketch using the Generic ESP8266 option for the Board (like on the link that you send me is doing), but it gives this errors:

error: 'D1' was not declared in this scope

D1, // digital in
^
error: 'D1' was not declared in this scope

D1, // analog out
^
error: 'D0' was not declared in this scope

D0, // config mode button
^

PS: I din`t change the FirebaseCloudMessaging_Send_ESP8266 code. Just trying to make it work...

Apreciate your help! =)

@kiralikbeyin
Copy link

#250
Working example without <FirebaseCloudMessaging.h>
CLIENT_REG_ID and TOPIC works fine.

@gertvantslot
Copy link

I also received the "Error-1 :: connection refused".

I got this fixed using:

  • in file FirebaseCloudMessaging.cpp
    • replace the url http://fcm.googleapis.com/fcm/send by https://fcm.googleapis.com/fcm/send (now using https).
  • in file FirebaseHttpClient.h
    • change the value of kFirebaseFingerprint to 22374D5843F4A12412712B747AFC36FC24A0F09D
    • this is the fingerprint that Firebase uses this week.

Still the library crashes when sending more than 2 messages.

@kiralikbeyin
Copy link

Try this example #250

Google have alot of servers so https with a fingerprint is not a real solution. (Because fingerprints are not same for other servers in the world)

@davidvasicek
Copy link

Hello. Did anyone get the right solution?

I changed the URL in FirebaseCloudMessaging.cpp and fingerprint for FirebaseHttpClient.h today. But it does not work.

  • Mobile android apps are working properly (receiving notifications from my RPi JavaScript server )
  • FirebaseDemo with RealTime database works properly too.
    but .....
  • FirebaseCloudMessaging does not work. (Error: -1 :: connection refused)

SERVER_KEY = ProjectSettings -> Cloud Messaging -> Legacy server key
CLIENT_REGISTRATION_ID = Registration token after registering android device

thank you so much

@kiralikbeyin
Copy link

I didnt try, just an idea. If you configured a static ip adress for esp it can make problem with dns adress value.
Just dont write your gateway adress for dns (find your real dns from gateway) or dont use wifi.config(....

If you make connection you will have very low heap and probably you will not continue to your skecth. Esp with HttpS is not useful.

@kavinsharma
Copy link

#define SERVER_KEY "AIzaSyDBBlMT80************OVTiD6GGxzreq1" ------Legacy server key
#define CLIENT_REGISTRATION_ID "574370843934" -------------------- Sender ID

shows
Error:-1 :: connection refused

any idea how can i resolve this ??

and android app is working fine with direct firebase message sending

@proppy
Copy link
Contributor

proppy commented Jun 15, 2018

Sorry for the lack of followup, doing a cleaning swipe over "old" issues labeled as question.

If you still have the issue, feel free to comment or file a new issue.

@proppy proppy closed this as completed Jun 15, 2018
@proppy
Copy link
Contributor

proppy commented Jun 15, 2018

See also #250 and #347

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

No branches or pull requests

7 participants