ESP8266 intelligent distribution network

ESP8266 Intelligent Distribution Network Reconnect after Power Off

#include bool autoConfig( ){ WiFi.begin(); for (int i = 0; i <20; i++) {int wstatus = WiFi.status(); if (wstatus == WL_CONNECTED) {Serial.println("AutoConfig Success"); Serial .printf("SSID:%s
", WiFi.SSID().c_str()); Serial.printf("PSW:%s
", WiFi.psk().c_str()) ; WiFi.printDiag(Serial); return true; //break;} else {Serial.print("AutoConfig Waiting......"); Serial.println(wstatus); delay(1000);}} Serial. println("AutoConfig Faild!" ); return false; //WiFi.printDiag(Serial);}void smartConfig(){ WiFi.mode(WIFI_STA); Serial.println("
Wait for Smartconfig"); WiFi. beginSmartConfig(); while (1) {Serial.print("."); if (WiFi.smartConfigDone()) {Serial.println("SmartConfig Success"); Serial.printf("SSID:%s
 ", WiFi.SSID().c_str()); Serial.printf("PSW:%s
", WiFi.psk().c_str()); WiFi.setAuto Connect(true); // Set up automatic connection break;} delay(1000); // This place must be delayed, otherwise it will easily crash and restart}}void setup(){ Serial.begin(115200); if (! autoConfig()) {Serial.println("Start module"); smartConfig(); }}void loop(){ delay(1000); Serial.println("loop");}

Reference link

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4180 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.