So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Meyotch
#68775
rudy wrote:How did you change it? You need to show us what you did in order to tell you where it went wrong.


Sorry if I wasn't clear. All I meant was that now when I try to change the SSID, the code is only different in the parameter given in WiFi.softAP(). i.e. the first time I got the AP working with the SSID "name1", but when I modify that parameter to "name2" the code seems to upload but it keeps broadcasting "name1"

Code snippet below.


Code: Select all 
#include <ESP8266WiFi.h>

WiFiServer server(80);

void setup() {

WiFi.mode(WIFI_AP); //Our ESP8266-12E is an AccessPoint
WiFi.softAP("name2", ""); // Provide the (SSID, password); .
server.begin(); // Start the HTTP Server

.....

User avatar
By Meyotch
#68776
yoursunny wrote:ESP8266WiFi library by default operates in "persistent" mode where the SSID and PIN setting for AP and STA are saved to the flash storage. The main benefit of this is that the ESP would start connecting to WiFi even before your sketch start running.
As a result, if you flash a new sketch that does not modify WiFi parameters, the previous saved parameters would take effect, and cause your ESP appears to be running the old sketch. In fact, it's just broadcasting the SSID, but the old sketch is gone.

I typically include
Code: Select allWiFi.persistent(false);
in my sketch so this does not happen.



Hmm, I tried that in setup() and it is still broadcasting the SSID.

Full code below:

Code: Select all#include <ESP8266WiFi.h>
 
void setup() {
  WiFi.persistent(false);
  pinMode(BUILTIN_LED, OUTPUT);  // initialize onboard LED as output
}
 
void loop() {
  digitalWrite(BUILTIN_LED, HIGH);  // turn on LED with voltage HIGH
  delay(1000);                      // wait one second
  digitalWrite(BUILTIN_LED, LOW);   // turn off LED with voltage LOW
  delay(1000);                      // wait one second
}
User avatar
By yoursunny
#68803
Meyotch wrote:
yoursunny wrote:I typically include
Code: Select allWiFi.persistent(false);
in my sketch so this does not happen.


Hmm, I tried that in setup() and it is still broadcasting the SSID.
[/code]


WiFi.persistent(false); is to be placed in the original sketch where you created the AP, so it doesn't get remembered.
I don't know how to clean up the mess if the underlying fireware has already remembered the SSID.