-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcon_ufv.ino
44 lines (33 loc) · 863 Bytes
/
con_ufv.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <WiFi.h>
#include <HTTPClient.h>
#include <WiFiClientSecure.h>
#define EAP_ANONYMOUS_IDENTITY ""
#define EAP_IDENTITY "CPF"
#define EAP_PASSWORD "SENHA DO SAPIENS"
#define SSID "WIFI-UFV2"
const char* testURL = "https://www.google.com/";
void setup() {
Serial.begin(115200);
WiFi.begin(SSID, WPA2_AUTH_PEAP, EAP_ANONYMOUS_IDENTITY, EAP_IDENTITY, EAP_PASSWORD);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Conectando-se à rede Wi-Fi...");
}
Serial.println("Conectado à rede Wi-Fi!");
}
void loop() {
HTTPClient https;
WiFiClientSecure client;
client.setInsecure();
if (https.begin(client, testURL)) {
if (https.GET() > 0) {
String data = https.getString();
Serial.println(data);
}
else{
Serial.println('Error');
}
https.end();
}
delay(10000);
}