Statistics: Posted by ESP_Faye — Fri Apr 14, 2017 5:29 pm
Statistics: Posted by Her Mary — Thu Apr 06, 2017 10:21 am
Statistics: Posted by stas1727 — Tue Mar 28, 2017 9:39 pm
Statistics: Posted by ESP_Faye — Wed Mar 22, 2017 2:03 pm
Code:
#define UDP_SERVER_AP_NAME "TEST-AP"
#define UDP_SERVER_AP_PASWORD "TEST-AP-PASS0001"
void user_init(void) {
wifi_set_opmode(SOFTAP_MODE);
struct softap_config* config = (struct softap_config*) zalloc(sizeof(struct softap_config));
sprintf((char*) config->ssid, UDP_SERVER_AP_NAME);
sprintf((char*) config->password, UDP_SERVER_AP_PASWORD);
config->authmode = AUTH_WPA_WPA2_PSK;
config->ssid_len = 0;
config->max_connection = 4;
wifi_softap_set_config(config);
}
Code:
void setup() {
pinMode(LED_PIN, OUTPUT); // set pin as output
Serial.begin(115200);
Serial.println();
Serial.print("Setting soft-AP configuration ... ");
Serial.println(WiFi.softAPConfig(local_IP, gateway, subnet) ? "Ready" : "Failed!");
Serial.print("Setting soft-AP ... ");
Serial.println(WiFi.softAP("TEST-AP", "TEST-AP-PASS0001") ? "Ready" : "Failed!");
Serial.print("Soft-AP IP address = ");
Serial.println(WiFi.softAPIP());
}
void loop() {
digitalWrite(LED_PIN, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(LED_PIN, LOW); // set the LED off
delay(1000); // wait for a second
}
Statistics: Posted by stas1727 — Fri Mar 10, 2017 7:29 pm