MASLOW: an Open WiFi Detector With ESP8266




Introduction: MASLOW: an Open WiFi Detector With ESP8266

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


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


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


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


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.
#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

Step 4: Run an Open WiFi Detector With ESP8266


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



    • Creative Misuse Contest

      Creative Misuse Contest
    • Water Contest

      Water Contest
    • Fix It! Contest

      Fix It! Contest

    12 Discussions

    Can this be used without connection to the terminal ?

    hello sabas, thank you for sharing such a cool project..
    maybe you can help me with what i'm trying to accomplish. i want to attach an esp12 and a cell phone battery (slim kind) to a cat collar. and set it as wifi network. in the mean time another esp12 searching for available networks, trying to find the cat collar one..
    once the signal strength is down to a certain level, it could turn on an LED or email you alerting that the cat is too far away.
    i'm not interested in gps locations or anything, just a simple signal creator and signal watcher setup. maybe the base esp can be a handheld device with a little screen, showing the numbers.
    hope it makes sense, let me know what you think.

    2 replies

    It can be done

    In Arduino exist the function

    WiFi.RSSI() for the signal strength

    i think we should collaborate on this idea as i lack the coding skills :)
    i have all the parts, i just need a simple code to test it out.. i have looked at the for more info but still can't get around it..
    here is what i have as hardware;

    cat collar.png

    I used to live making useful gadgets. I have Essential-tremors which have made it impossible to make anything like this. You have no idea how lucky you are. Keep making them, & hopefully you'll find something to copyright & make $$. I used to make the walkers that you can sit on, 25 years ago&I should have had it copyrighted. Check this out if it's already copyrighted or not. FYI ;The wish site has a lot of electronic pieces, but it comes from China and its like play roulette, but a cpu, resistors, switches etcc. Should be ok to buy from them.

    I like the dual language. I'm trying, very slowly, to learn Spanish myself. You should get a wider audience this way. I've got an ESP8266 with which I need to do something. This would be a fun one, it looks like.

    You can make this with the ESP8266-01, but you just won't get the deep sleep. I still was able to get mine (it shows SSID strengths on an OLED) into low power mode between scans which brings the draw down to .5mA for the ESP8266. I haven't tested the whole circuit yet for power draw though.

    If you do use the -01 just put a power switch on it and it will still last a really long time.

    Love the addition step to mslows needs!

    Nice project! The esp8266 module is also a programmable controller as I can see. where can you buy? (cheapest solution possibile) an arduino pro mini (or micro) with the esp8266 module alone would work the same?

    3 replies

    eBay have them. You can also program just the ESP8266 as a standalone. Yes, you can use the Arduino Nano and ESP8266 and it would work the same.

    Thank you. I think I'll go with arduino nano+esp8266 solution ;)