You are reading a single comment by @nhlives and its replies. Click here to read the full conversation.
  • I open a web server to get the SSID and password. Once the WiFi successfuly connects, I send a "connected" page and then i want to close the access point and stop listening on the web server. What is happening is the AP closes before the page is received or the event doesn't fire at all. I've tried "response.on('finish') " and as below "response.on('close') .

     console.log(SSID + '  ' + password);
                      SSID = SSID.trim();
                      password = password.trim();
                      console.log(SSID + '  ' + password);
                      options = {password: password };
                      wifi.connect(SSID,options , err => {
                        if (err !== null) {
                          msg = err;
                          index(response);  
                          throw err;
                        }
                       
                        wifi.getIP((err, info) => {
                          if (err !== null) {
                            throw err;
                          }
                          print("ESP8266 IP: "+info.ip); 
                          connected( "response.on('close') );
                          response.on('close', () => {
                            console.log('Stopping web server and AP');
                            server.close();
                            wifi.stopAP();
                        });
    

    Right-click seems to work. BTW, the manual control is for a caregiver or as a backup if the internet is not available.

    BTW, I've order a ESP32 development kit.

About

Avatar for nhlives @nhlives started