Skip to content

Instantly share code, notes, and snippets.

@r3wald
Created July 11, 2016 22:33
Show Gist options
  • Save r3wald/d09304a7575e0a2f62e6a981adfc286b to your computer and use it in GitHub Desktop.
Save r3wald/d09304a7575e0a2f62e6a981adfc286b to your computer and use it in GitHub Desktop.
create random access points with an ESP-8266
#include <ESP8266WiFi.h>
void setup() {
Serial.begin(115200);
delay(500);
}
void loop() {
int r = random(0, 9999);
char ssid[50];
sprintf(ssid, "WLAN-%04d", r);
Serial.print("ssid: ");
Serial.println(ssid);
WiFi.softAP(ssid);
IPAddress myIP = WiFi.softAPIP();
Serial.print("ip: ");
Serial.println(myIP);
delay(1000 * 60);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment