lwks
lwks
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
Ok, thx for the tip
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
tks for help @Brody!!!!!
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
I looked it up, it's a good library
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
c++
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <ESP8266HTTPClient.h>

// Substitua pelos detalhes da sua rede Wi-Fi
const char* ssid = "SSID";
const char* password = "PASS";

// Endereço da API
const char* host = "API_URL";

void setup() {
Serial.begin(9600);
delay(10);

// Conecta-se à rede Wi-Fi
Serial.println();
Serial.print("Connecting to: ");
Serial.println(ssid);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println("WiFi Conn established!");
Serial.println("IP address: " + WiFi.localIP().toString());
}

void loop() {
// Use a conexão WiFiClientSecure
HTTPClient https;
WiFiClientSecure client;
client.setInsecure();
Serial.print("Connecting to: ");
Serial.println(host);
https.begin(client, host);
int httpCode = https.GET();
if (httpCode > 0){
String payload = https.getString();
Serial.print("Http code: ");
Serial.println(httpCode);
Serial.print("\nPayload: ");
Serial.println(payload);
}
delay(500);

// Verificar se a conexão é bem-sucedida
if (client.connected()) {
Serial.println("Conn sucess!");
} else {
Serial.println("Conn failed!");
return;
}

// Ler a resposta do servidor
while (client.available()) {
String line = client.readStringUntil('\r');
Serial.print(line);
}

Serial.println();
Serial.println("Conn Close!");
client.stop();

// Aguarda alguns segundos antes de fazer uma nova requisição
delay(5000);
}
c++
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <ESP8266HTTPClient.h>

// Substitua pelos detalhes da sua rede Wi-Fi
const char* ssid = "SSID";
const char* password = "PASS";

// Endereço da API
const char* host = "API_URL";

void setup() {
Serial.begin(9600);
delay(10);

// Conecta-se à rede Wi-Fi
Serial.println();
Serial.print("Connecting to: ");
Serial.println(ssid);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println("WiFi Conn established!");
Serial.println("IP address: " + WiFi.localIP().toString());
}

void loop() {
// Use a conexão WiFiClientSecure
HTTPClient https;
WiFiClientSecure client;
client.setInsecure();
Serial.print("Connecting to: ");
Serial.println(host);
https.begin(client, host);
int httpCode = https.GET();
if (httpCode > 0){
String payload = https.getString();
Serial.print("Http code: ");
Serial.println(httpCode);
Serial.print("\nPayload: ");
Serial.println(payload);
}
delay(500);

// Verificar se a conexão é bem-sucedida
if (client.connected()) {
Serial.println("Conn sucess!");
} else {
Serial.println("Conn failed!");
return;
}

// Ler a resposta do servidor
while (client.available()) {
String line = client.readStringUntil('\r');
Serial.print(line);
}

Serial.println();
Serial.println("Conn Close!");
client.stop();

// Aguarda alguns segundos antes de fazer uma nova requisição
delay(5000);
}
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
but with information about insecure mode, i'll try again with this lib
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
y, i tried too
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
i i'll put code here
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
that's works
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
im trying
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
hmmmm, how can i enable insecure mode?
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
i i'll try again
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
i think i tried use this lib
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
i tried a lot of examples and examples but none works
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
no, sorry just ESP8266WiFi.h
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
yes
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
i'm using https lib
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
just a sec
63 replies
RRailway
Created by lwks on 7/24/2023 in #✋|help
ESP 8266 Insecure Mode, Port, API, Code
cafofo.up.railway.app/dev_esp
63 replies