ESP Node Name in SoftAP Mode
Posted: Thu Feb 08, 2018 6:37 pm
I'm trying to set up an ESP32 in SoftAP mode so I can send simple ASCII commands to it without needing a separate WiFi router. I have been able to get that working but I cannot get the ESP name to show up correctly on my laptop. It is always ESP_234B01. I'm using the Wemos Lolin32 with the OLED. The simplified version of the code I'm using is below. The OLED works and shows 192.168.4.1 as the IP, but my laptop always shows ESP_234B01 as the node name. I'll be using this in an environment with multiple ESP32s, so I need to give each one a unique name that means something.
Any help would be greatly appreciated!
#include <WiFi.h>
#include <Arduino.h>
#include "SSD1306.h" // Header file for OLED
// Declare the OLED Display object
SSD1306 display( 0x3c, 5, 4 );
/* Set these to your desired AP credentials. */
const char *APssid = "APtest";
const char *APpassword = "APpass";
void setup() {
WiFi.softAP(APssid, APpassword);
WiFi.softAPsetHostname( APssid );
//WiFi.softAP("XYZ", "XYZ");
//WiFi.mode(WIFI_AP);
IPAddress myIP = WiFi.softAPIP();
display.init();
display.flipScreenVertically();
display.setFont(ArialMT_Plain_16);
display.drawString( 0, 0, myIP.toString() );
display.display();
}
void loop() {
// put your main code here, to run repeatedly:
}
Any help would be greatly appreciated!
#include <WiFi.h>
#include <Arduino.h>
#include "SSD1306.h" // Header file for OLED
// Declare the OLED Display object
SSD1306 display( 0x3c, 5, 4 );
/* Set these to your desired AP credentials. */
const char *APssid = "APtest";
const char *APpassword = "APpass";
void setup() {
WiFi.softAP(APssid, APpassword);
WiFi.softAPsetHostname( APssid );
//WiFi.softAP("XYZ", "XYZ");
//WiFi.mode(WIFI_AP);
IPAddress myIP = WiFi.softAPIP();
display.init();
display.flipScreenVertically();
display.setFont(ArialMT_Plain_16);
display.drawString( 0, 0, myIP.toString() );
display.display();
}
void loop() {
// put your main code here, to run repeatedly:
}