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

Connection to api.pushbullet.com fails #6

Open
anuroopshannu opened this issue Jan 6, 2019 · 12 comments
Open

Connection to api.pushbullet.com fails #6

anuroopshannu opened this issue Jan 6, 2019 · 12 comments

Comments

@anuroopshannu
Copy link

Hey, I've been trying to get past this since a long time now. When I use this library it continuously fails at

if (!pb.checkConnection()) {
    Serial.println("Failed to connect to pushbullet.com");
    return;
  }

I've amended the ssid, password and api key wherever necessary and my esp8266 is successfully connecting to the internet too. Here's my code:

#include <ESP8266WiFi.h>
#include <PushBullet.h>
#include <WiFiClientSecure.h>


WiFiClientSecure client;

#define PORT 443

// wifi connection variables
const char* ssid     = "SSID";
const char* password = "PASS";

boolean wifiConnected = false;

int incomingByte = 0;
boolean connectWifi();

PushBullet pb = PushBullet("API", &client, 443);


void setup() {
  // Initialise Serial connection
  Serial.begin(115200);

  // Initialise wifi connection
  wifiConnected = connectWifi();

  if (!pb.checkConnection()) {
    Serial.println("Failed to connect to pushbullet.com");
    return;
  }

}

void loop() {
  // check if the WiFi connection were successful
  if (wifiConnected) {
    if (true) {
    
    
          Serial.println("Pushbullet note pushing");
          pb.sendNotePush("Hello, from me", "Message");
          delay(5000);
         
      
    }
  }
}

// connect to wifi – returns true if successful or false if not
boolean connectWifi() {
  boolean state = true;
  int i = 0;
  WiFi.begin(ssid, password);
  Serial.println("");
  Serial.println("Connecting to WiFi");

  // Wait for connection
  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    if (i > 10) {
      state = false;
      break;
    }
    i++;
  }
  if (state) {
    Serial.println("");
    Serial.print("Connected to ");
    Serial.println(ssid);
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP());
  }
  else {
    Serial.println("");
    Serial.println("Connection failed.");
  }
  return state;
}

and the following is printed on my serial console:

...
Connected to MY-SSID
IP address: 192.168.0.113
Failed to connect to pushbullet.com

Please let me know a get around for this.

@cattusuk
Copy link

Have exactly same problem. The host and port are as follows:

const char* host = "api.pushbullet.com";
const int httpsPort = 443;

It fails at:

if (!client.connect(host, httpsPort)) {
Serial.println("connection failed");
return;
}

and my console says:

03:46:06.820 -> WiFi connected
03:46:06.820 -> IP address:
03:46:06.820 -> 192.168.50.97
03:46:06.867 -> connecting to api.pushbullet.com
03:46:07.664 -> connection failed

Would be great if someone could give a hint :)

@ducktaperules
Copy link

also have the same problem

@Osmodia666
Copy link

I have the same problem. But I guess no one cares.

@uyan21
Copy link

uyan21 commented Jul 27, 2019

you have to varify by using thingspeak's fingerprint

@tha-uep
Copy link

tha-uep commented Oct 31, 2019

I have the connection problem, too. Also tried to verify the actual fingerprint which I read out of the browsers certificate and via grc.com.
Connection failed and certificate does not match :-(

Hope, anyone has an idea or can support me.

if(!pb.openConnection()) { Serial.println("Failed to connect to pushbullet.com"); //return; } // Use web browser to view and copy // SHA1 fingerprint of the certificate const char* fingerprint = "FA C0 BE 4E 64 B8 80 C7 B7 EC B6 D9 01 FF 61 0D AC 92 F5 A6"; //got it using https://www.grc.com/fingerprints.htm if (client.verify(fingerprint, "api.pushbullet.com")) { Serial.println("certificate matches"); } else { Serial.println("certificate doesn't match"); } if (!pb.checkConnection()) { Serial.println("Failed to connect to pushbullet.com"); return; }

@gomme600
Copy link

Fails for me too. The current fingerprint should be: C1 72 5A 7A 6C AE BC CD 0A 57 8E 3A DA 39 C8 47 26 36 C9 77. But this didn't work for me...

@HeinvdW
Copy link

HeinvdW commented Dec 11, 2020

Hi
api.pushbullet.com:443 is refused
https://api.pushbullet.com returns the expected answer:

cat "(=^.^=)"
happy_to_see_you true
message "Welcome to the Pushbullet API!"

So I expect the connection setup should be different than:
if (!client.connect(host,httpsPort)) {
Serial.println("connection failed");
return;
}

I have found the solution elsewhere in GitHub:
Just add
client.setInsecure();
in the line below
WiFiClientSecure client;

Resulting in:
WiFiClientSecure client;
client.setInsecure();

@Bighoneypot
Copy link

@anuroopshannu please close..

@froggerXR7
Copy link

froggerXR7 commented Jun 27, 2023

This Is Not Working : Compilation error: 'class axTLS::WiFiClientSecure' has no member named 'setInsecure'
6-27-2023

@froggerXR7
Copy link

froggerXR7 commented Jun 28, 2023

This Is Not Working Not Connecting to Pushbullet : Compilation error: 'class axTLS::WiFiClientSecure' has no member named 'setInsecure'
6-27-2023

@froggerXR7
Copy link

Found Prob. That was not Told The Arduino IDE 2.0.4 Dose Not Work, The 2.1.1 Works 7-7-2023

@Aman17Gupta
Copy link

Worked with Arduino 1.8.18 after adding " client.setInsecure();"

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