• This is what I use

    function wifiConnect() {
      wifi = require('Wifi');
      wifi.connect(wifi_options.ssid, { password: wifi_options.password },
        (e)=> {
          if (e) {
            print("WIFI: " + e);
          }
      });
      wifi.on('connected', ()=> {
        print('WIFI:', wifi.getIP());
      });
      wifi.on('disconnected', ()=> {
        print("WIFI: Reconectando...");
        wifi.connect(wifi_options.ssid, {password: wifi_options.password});
      });
    }
    
About

Avatar for barbiani @barbiani started