Introduction: MASLOW: an Open WiFi Detector With ESP8266

About: Fundador de The Inventor's House Hackerspace, Movimiento Maker y Hardware Libre, DIY, Workaholic

English/Español

Hola amigos en esta ocasión le voy a enseñar como hacer un detector de redes abiertas con el modulo WiFi ESP8266, este detector nos notifica cuando una red WiFi cerca de nosotros esta abierta o no tiene cifrado WEP (que casi es lo mismo que abierta), cuando el ESP8266 detecte uno de estos tipos de redes inalambricas por medio de un parpadeo del led nos lo indicara y una vez nos haya notificado el ESP8266 entrara en modo sueño para ahorrar bateria.

Hello friends this time im gonna show you how to make a detector for open wifi with the module ESP8266, this detector notifies you when an open WiFi or non encrypted is near to you, when it detects one kind of this wireless net, through a LED it will indicate with blink and one time it notifies you the module will go to sleep mode in order to save battery.

Step 1: Material

English/Español

El material que necesitamos para crear nuestro detector de redes WiFi abiertas es:

  • NodeMCU v1.0 ESP8266 o cualquier versión superior a la versión 01 del ESP8266
  • BackPack NodeMCU v1.0 ESP8266 disponible en Tindie
  • Bateria LiPo de Adafruit

Este Backpack fabricado por nosotros puede encontrarlo en Tindie

Teniendo todo es hora de comenzar.

The material we need to make our open WiFi detector is:

  • NodeMCU v1.0 ESP8266 or any superior version than 01 of the ESP8266
  • BackPack NodeMCU v1.0 ESP8266 available on Tindie
  • Battery LiPo from adafruit

This Backpack made by us can be bought on tindie.

Step 2: Diagrama De Conexión

English/Español

Como queremos tener acceso al modo de sueño del ESP8266 nuestro diagrama de conexión es el siguiente, muy sencillo pero necesario es puentear el pin RST y el GPIO16

Cause we want to have acces to the sleep mode of the ESP8266 our conection diagram is the next, a very simple circuit but necesary, conect the RST pin to the GPIO16

Step 3: Codigo

English/Español

Una vez conectado todo es hora de programar, el código necesario para hacer funcionar nuestro detector de redes WiFi abiertas es el siguiente, este desarrollado para el ESP8266 con el IDE de Arduino.

Once that conection is done, its time to program. the necesary code to make our WiFi open detector works is the next, it was developed for The IDE of the Arduino with the module ESP8266.

https://github.com/sabas1080/OpenWiFiDetectorESP8266/blob/master/OpenWiFiDetector.ino
#include "ESP8266WiFi.h"<br>// Time to sleep (in seconds):const int sleepTimeS = 30;
void setup() {  Serial.begin(115200);
  // Set WiFi to station mode and disconnect from an AP if it was previously connected  WiFi.mode(WIFI_STA);  WiFi.disconnect();  delay(100);  pinMode(4, OUTPUT);  Serial.println("Setup done");
}  void loop() {  uint8_t sec;    analogWrite(4, 10);
  Serial.print(F("Scanning..."));  int n = WiFi.scanNetworks(); // WiFi.scanNetworks will return the number of networks found  Serial.println(F("scan done"));  if (n == 0)    Serial.println(F("no networks found"));  else  {    Serial.print(n); Serial.print(F(" network"));      if(n > 1) Serial.print('s');      Serial.println(F(" found:"));    for (int i = 0; i < n; ++i)    {      int sec = WiFi.encryptionType(i);              // Print SSID and RSSI for each network found        Serial.print(i + 1);        Serial.print(": ");        Serial.print(WiFi.SSID(i));        Serial.print(" (");        Serial.print(WiFi.RSSI(i));        Serial.print(")");        Serial.println(sec);        delay(10);
        if((sec == ENC_TYPE_NONE || sec == ENC_TYPE_WEP) && (WiFi.RSSI(i) > -95)) { // If open network and good signal...            // Switch LED to conspicuous 'open networks' flash immediately            analogWrite(4, 1023); // 1 sec            delay(1000);            // "Open hotspot" is as good as the indicator gets and the scan            // can stop now, get into power-saving sleep mode ASAP.            // If you're using the Serial console and want to see all            // networks displayed, comment out this line:            //Serial.println("Not security");            //Mode Sleep for ESP8266 Version 12 or model with pin16 avaible            //Necesary jump RST and GPIO16                        sleep_now(); // Function Sleep 30 seconds        }    }  }
}
//Mode Sleep for ESP8266 Version 12 or model with pin16 avaible
void sleep_now(){   Serial.print(F("Sleeping..."));  // deepSleep time is defined in microseconds. Multiply  // seconds by 1e6   ESP.deepSleep(sleepTimeS * 1000000);}</p>

Puedes encontrar mas información en el repositorio del proyecto

https://github.com/sabas1080/OpenWiFiDetectorESP82...

Step 4: Run an Open WiFi Detector With ESP8266

English/Español

Una vez cargado el sketch en el ESP8266 el led va parpadear cuando encuentre una red inalambrica abierta y entrara en modo sueño, ademas podemos ver en la depuracion via serial cada una de las WiFi encontradas.

Espero les haya gustado este instructable.

Gracias a mi amigo Wero por el apoyo llevado acabó para realizar este instructable

Versión en inglés gracias a Wero

Nos vemos en la proxima.

Once uploaded the sketch on the ESP8266, the LED will blink when it found's an open wireless net and it will go through sleep mode, also you can see by the serial monitor each one of the WiFi's found.

Thanks to my friend wero by his support to get done this instructable

English version by wero

Hope you liked this instructable
see you next time