1

Microprocessor Arduino YUN is working when i use HTTP, but not working HTTPS client.get("https://me.example.com/ajax/robot?command=1");

How to make HTTPS work?

#include <Bridge.h>
#include <HttpClient.h>

String result = String("");
void setup() {
  delay(5000);
  pinMode(2, OUTPUT);  
  Bridge.begin();  
  digitalWrite(2, HIGH);
}

void loop() {
  HttpClient client;

  // PIN 2
  //client.get("http://me.example.com/ajax/robot?command=1");
  client.get("https://me.example.com/ajax/robot?command=1");
  result = "";
  while (client.available()) {
    char c = client.read();
    result = result + c;
  }
  if(result.indexOf("reboot") >= 0) {
    digitalWrite(2, LOW);
    delay(3000);
    digitalWrite(2, HIGH);
  }

  delay(7000);
}

0 Answers0