Hallo zusammen
Ich möchte mit dem YUN einen Access Point dedektieren.
Ich habe dazu ein Sketch etwas abgeändert, der aber nicht wie gewünscht funktioniert.
Bei diesem Sketch versucht der YUN eine Verbindung zu https://www.arduino.cc/asciilogo.txt ,
wenn dies gelingt schaltet er LED Pin 13 auf high,
wenn dies nicht gelingt auf Low.
Leider dauert es sehr lange bis er die LED high oder low schaltet, ich weis aber nicht warum.
/*
Yún HTTP Client
This example for the Arduino Yún shows how create a basic
HTTP client that connects to the internet and downloads
content. In this case, you'll connect to the Arduino
website and download a version of the logo as ASCII text.
created by Tom igoe
May 2013
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/HttpClient
*/
#include <Bridge.h>
#include <HttpClient.h>
void setup() {
// Bridge takes about two seconds to start up
// it can be helpful to use the on-board LED
// as an indicator for when it has initialized
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Bridge.begin();
delay(2000);
}
void loop() {
// Initialize the client library
HttpClient client;
client.noCheckSSL();
// Make a HTTP request:
client.get("https://www.arduino.cc/asciilogo.txt");
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
digitalWrite(13, HIGH);
}
else
{digitalWrite(13, LOW);
}
delay(200);
}
kann mir jemand sagen warum das bis zu ca. 1min. dauert?