Neste tutorial, aprenderemos como obter o nome do host do ESP32, usando o núcleo do Arduíno.
A função que vai exibir o nome do host é WiFi.getHostname(), veja logo abaixo o código completo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | include "WiFi.h" const char* ssid = "yourNetworkName"; const char* password = "yourNetworkAddress"; void setup(){ Serial.begin(115200); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Connecting to WiFi.."); } Serial.println(WiFi.localIP()); Serial.println(WiFi.getHostname()); } void loop(){} |
Compre aqui sua placa para realizar os testes.....BANGGOOD