前提・実現したいこと
ESP8266モジュールからIFTTTのWebhooksを叩くために下記のコードを作成しました。
昨年までIFTTTへ接続できWebhooksを叩けてたのですが久しぶりに実行するとWiFi接続後のhttpsへ未接続でこけてしまいます。
IFTTT側のApplets自体は動作チェックは走ります。
原因を探りたいのですが何か確認する方法は御座いますか?
どうぞお力をお貸しください。
参考にしたURL先
https://netlog.jpn.org/r271-635/2018/07/ifttt_webhooks_perl_python_c.html
発生している問題・エラーメッセージ
Arduino
1..... 2WiFi connected 3192.168.0.10 4ERROR: https connect 5
該当のソースコード
/******************* IFTTT Webhookにhttpsでデータ送信 ******************/ #include <ESP8266WiFi.h> #include <WiFiClientSecure.h> const char* ssid = "SSID"; const char* password = "PASSWORD"; const char* IFTTT_EVENT = "EVENT"; const char* IFTTT_KEY = "KEY"; void setup() { Serial.begin(115200); delay(500); Serial.print(F("\n\nConnecting to ")); Serial.println(ssid); int error_count = 0; WiFi.begin(ssid, password); // Wifi接続成功 待ち while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print(F(".")); } Serial.print(F("\nWiFi connected\n")); Serial.println(WiFi.localIP()); // IFTTT接続処理 double val01 = 12.5; double val02 = -3.02; double val03 = 5500; WiFiClientSecure https; if (!https.connect("maker.ifttt.com", 443)) //IFTTTへ接続確認 { Serial.println(F("ERROR: https connect")); //エラー出力 } else { https.printf("GET /trigger/%s/with/key/%s?" "value1=%f&value2=%f&value3=%f HTTP/1.1\r\n" "Host: maker.ifttt.com\r\n" "User-Agent: ESP8266\r\n" "Connection: close\r\n\r\n" , IFTTT_EVENT, IFTTT_KEY, val01, val02, val03); https.flush(); while (https.connected()) { while(https.available()) { String line = https.readStringUntil('\n'); Serial.println(line); } } https.stop(); } delay(1000); } void loop() { delay(1000); }
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。