-
Notifications
You must be signed in to change notification settings - Fork 13.3k
accessing nest_api with http.get() #4300
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
Comments
Hi! I'm after the same project, did you finally find a solution? |
Please upgrade to BearSSL, and report back. |
Hi Polweiss. I'm sorry for my terrible late answer. In the end I searched for an other solution and switched to raspberry Pi 1 to run Python code on it. On the nest developers page you find beautiful easy examples on how to open a stream to your nest and get an update with every value that has been changed. |
Closing as no longer relevamt to OP, due to axtls being deprecated, and due to no feedback about bssl. |
Basic Infos
The goal is to let a switch respond on the data received from my nest Thermostad. I'm using the Nest_API to get the result
Hardware
Hardware: ESP8266
Description
I'm trying to access the Nest API without any success. I always get some kind of redirection error.
Or I get the 307 error code (redirection) or an 400. With the first one, there's no redirection location.
What do i do wrong? Is it possible that the library doesn't support HTPPS? Is there a solution for it?
Settings in IDE
Module: Generic ESP8266 Module
Sketch
#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
#define USE_SERIAL Serial
String accessurl = "https://api.home.nest.com/oauth2/access_token";
MDNSResponder mdns;
// My Network cred.
const char* ssid = "Blanked out";
const char* password = "Blanked out";
int gpio13Led = 13;
int gpio12Relay = 12;
void setup(void){
// preparing GPIOs
pinMode(gpio13Led, OUTPUT);
digitalWrite(gpio13Led, HIGH);
pinMode(gpio12Relay, OUTPUT);
digitalWrite(gpio12Relay, HIGH);
Serial.begin(115200);
delay(5000);
WiFi.begin(ssid, password);
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
if (mdns.begin("esp8266", WiFi.localIP())) {
Serial.println("MDNS responder started");
}
}
void loop(void){
Serial.println("Wifi Up - Test Start!");
delay(10000);
if((WiFi.status() != WL_CONNECTED)) {
Serial.println("wifi down");
return;
}
HTTPClient http;
//Here I gave the footprint along with the url. But I'm not sure if it works.
http.begin("https://developer-api.nest.com/", "87:CB:F2:E6:44:C0:AA:F2:4C:28:B2:97:85:70:18:92:45:1B:A4:57");
}
The text was updated successfully, but these errors were encountered: