我已经按照几个说明从 ESP8266 连接到 Pushbullet 这是一个代码片段
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
const char* ssid = ".......";
const char* password = ".......";
const char* host = "api.pushbullet.com";
const int httpsPort = 443;
const char* PushBulletAPIKEY = "..............."; //get it from your pushbullet account
// Use web browser to view and copy
// SHA1 fingerprint of the certificate
const char* fingerprint = "2C BC 06 10 0A E0 6E B0 9E 60 E5 96 BA 72 C5 63 93 23 54 B3"; //got it using https://www.grc.com/fingerprints.htm
void setup() {
Serial.begin(115200);
Serial.println();
Serial.print("connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
// Use WiFiClientSecure class to create TLS connection
WiFiClientSecure client;
Serial.print("connecting to ");
Serial.println(host);
if (!client.connect(host, httpsPort)) {
Serial.println("connection failed");
return;
}
它失败了!client.connect(host, httpsPort)
。
使用浏览器 api.pushbullet.com:443 失败
https://api.pushbullet.com返回一个不错的 JSON 代码
是否可以使用https://api.pushbullet.com进行连接?
有端口问题吗?
帮助表示赞赏。
PS 来自 RPI
curl --header 'Access-Token: o.abcdefghijklmnopqrstuvwxyz' \ https://api.pushbullet.com/v2/users/me
奇迹般有效。