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:
}
ESP Node Name in SoftAP Mode
Re: ESP Node Name in SoftAP Mode
After much searching and experimenting I found the setup sequence that works:
WiFi.mode( WIFI_AP );
IPAddress ip( 1, 2, 3, 4 );
IPAddress gateway( 1, 2, 3, 1 );
IPAddress subnet( 255, 255, 255, 0 );
WiFi.softAPConfig( ip, gateway, subnet );
WiFi.softAP( "MyNodeName" );
Now I can see MyNodeName among the wireless devices I can connect to and I can talk to the EPS32 via Telnet from an app on my laptop.
WiFi.mode( WIFI_AP );
IPAddress ip( 1, 2, 3, 4 );
IPAddress gateway( 1, 2, 3, 1 );
IPAddress subnet( 255, 255, 255, 0 );
WiFi.softAPConfig( ip, gateway, subnet );
WiFi.softAP( "MyNodeName" );
Now I can see MyNodeName among the wireless devices I can connect to and I can talk to the EPS32 via Telnet from an app on my laptop.
Re: ESP Node Name in SoftAP Mode
I have the same issue here.
Solution proposed by DougK2 works, ... but does not take into account the password if you set one :
WiFi.softAP( "MyNodeName", "mypassword" );
Considering the numerous examples on the Web, I guess some people got it to work ... can anyone confirm ?
N.B. I'm using ESP32 TTGO with Lora & OLED
Solution proposed by DougK2 works, ... but does not take into account the password if you set one :
WiFi.softAP( "MyNodeName", "mypassword" );
Considering the numerous examples on the Web, I guess some people got it to work ... can anyone confirm ?
N.B. I'm using ESP32 TTGO with Lora & OLED
Re: ESP Node Name in SoftAP Mode
The call with password does not work, probably because your password does not met the criteria of being 8 digits or more.
I had this error at one point.
R
I had this error at one point.
R
Who is online
Users browsing this forum: No registered users and 123 guests