You are reading a single comment by @user158605 and its replies. Click here to read the full conversation.
  • In this case I guess you are already connected, check with wifi.getState()

  • Thank you for your answer. We have tested it; Command cannot be used correctly
    We also checked the connection information of the router and did not see any devices successfully connected

    var WIFI_NAME = "123";
    var WIFI_OPTIONS = { password : "123456789" };
    
    var wifi = require("Wifi");
    wifi.scan(function (err, networks) {
        console.log(err, networks);
        wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
          if (err) {
            console.log("Connection error: "+err);
            return;
          }
          console.log("Connected!");
        });
    });
    
    setTimeout(function() {
      console.log(wifi.getState());
    },4000)
    

    1 Attachment

    • Xnip2024-08-15_13-56-44.jpg
About

Avatar for user158605 @user158605 started