You are reading a single comment by @MaBe and its replies. Click here to read the full conversation.
  • try to get a list of Access Points but list is empty, any idea ?

    >reset();
    =undefined
     1v81.tve_unify_350abe6 Copyright 2015 G.Williams
    WARNING: the esp8266 port is in beta, do not expect everything to work
    Flash map 4MB:512/512, manuf 0xe0 chip 0x4016
    var wifi = require("wifi");
    =function () { [native code] }
    >// no crash if list is empty
    =undefined
    >wifi.scan(function(arrayOfAcessPoints) {
    :  if ( arrayOfAcessPoints != null) {
    :    for (var i=0; i<arrayOfAcessPoints.length; i++) {
    :      print("Access point: " + i + " = " + JSON.stringify(arrayOfAcessPoints[i]));
    :  }
    :  }
    :  else {
    :  print("no Access points found");
    :  }
    :});
    =undefined
    no Access points found
    > 
    

    connecting to a non hidden access point works

    >var esp = require("ESP8266");
    =function () { [native code] }
    >var wifi = require("wifi");
    =function () { [native code] }
    >wifi.connect("SSSID", "password", true, function(err, ipInfo) {
    :  if (err) {
    :  print("not connected to requested AP");
    :  }
    :  else {
    :  print("We are now connected!");
    :  print("ipInfo: " + esp.getAddressAsString(ipInfo.ip));
    :  }
    :});
    =undefined
    We are now connected!
    ipInfo: 192.168.0.100
    
About

Avatar for MaBe @MaBe started