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

User avatar
By pablopablo
#80436 Hi everybody,

I have an idea for a project and wanted to ask if it is possible and if anyone can point me in the right direction?

I would like to have an ESP8266 that when powered on broadcasts a specific SSID (EG APPLE) and then after a couple of seconds (without powering it off) it automatically renames the SSID (EG BANANA) and so on...

It is not neccasry for anybody to connect to the ESP/WIFI nor is a password needed

I'm assuming that some sort of loop might work...

Any advice greatly appreciated etc.
Last edited by pablopablo on Tue Feb 05, 2019 12:36 pm, edited 1 time in total.
User avatar
By torntrousers
#80437 Something like this perhaps (note, I've not actually tried this on an ESP!):
Code: Select all#include <ESP8266WiFi.h>

void setup() {
  WiFi.persistent(false);
  WiFi.mode(WIFI_AP);
}

int counter;

void loop() {
  WiFi.softAP("SSID"+counter, "somePswd");
  delay(2000);
}
User avatar
By pablopablo
#80438
torntrousers wrote:Something like this perhaps (note, I've not actually tried this on an ESP!):
Code: Select all#include <ESP8266WiFi.h>

void setup() {
  WiFi.persistent(false);
  WiFi.mode(WIFI_AP);
}

int counter;

void loop() {
  WiFi.softAP("SSID"+counter, "somePswd");
  delay(2000);
}



Thanks for the quick reply...I now realise I may have worded my op wrongly/confusingly!

So, it's not actually a number (I just did it as a (bad) example!)

Something like this:

SSID is at first Apple, then after 10 seconds changes to Banana, then after another 10 seconds changes to Orange...and so on.

Also, no need for passwords...

Thanks again and sorry for confusion!
User avatar
By torntrousers
#80440
Code: Select all#include <ESP8266WiFi.h>

String ssids[] = { "Apple", "Banana",  "Orange"};
int howManySsids = 3;
 
void setup() {
  WiFi.persistent(false);
  WiFi.mode(WIFI_AP);
}

int i;

void loop() {
  WiFi.softAP(ssids[i++].c_str());
  if (i >= howManySsids) i = 0;
  delay(10000); 
}