# ESPHole Ad Blocker

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/111/149/medium800/feather_boards_esphole-6445.jpg?1651022550)

## How about nah?

Using the web can be incredibly distracting, or even outright dangerous thanks to ever-present advertisments and trackers. In [this EFF article](https://www.eff.org/deeplinks/2019/07/adblocking-how-about-nah) by friend-of-the-Fruit [Cory Doctorow](https://craphound.com/), the problem and solution are spelled out thusly:

> As the online world has grown more concentrated, with more and more power in fewer and fewer hands, it's become increasingly difficult for Web publishers to resist advertisers' insistence on obnoxious tracking ads.
> 
> But Internet users have never been willing to accept take-it-or-leave-it as the last word in technological self-determination. Adblockers are the new pop-up blockers, a way for users to do what publishers can't or won't do: demand a better deal from advertisers. When you visit a site, the deal on offer is, "Let us and everyone we do business with track you in every way possible or get lost" and users who install adblockers push back. An adblocker is a way of replying to advertisers and publishers with a loud-and-clear "How about nah?"

One solution is to say 'nah' with a [Rapsberry Pi-based PiHole](https://learn.adafruit.com/pi-hole-ad-blocker-with-pi-zero-w/install-pi-hole) -- these work great, and are very fully featured, but can be a bit involved to set up, and we're currently in the middle of an RPi shortage.&nbsp;

Here we offer a simpler, more readily available solution, the **ESP32-S2-based ESPHole** ad blocker, based on [this terrific project by rubfi](https://github.com/rubfi/esphole).

Our version has been customized for the TFT Feather ESP32-S2, so that you can see relevant info about connection, IP address, and the satisfying **Nahs!** count.

## Parts
### Adafruit ESP32-S2 TFT Feather - 4MB Flash, 2MB PSRAM, STEMMA QT

[Adafruit ESP32-S2 TFT Feather - 4MB Flash, 2MB PSRAM, STEMMA QT](https://www.adafruit.com/product/5300)
We've got a new machine here at Adafruit, it can uncover your deepest desires. Don't believe me? I'll turn it on right now to prove it to you! What, you want unlimited mozzarella sticks? OK well, that's not something we can provide. But we can provide your...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5300)
[Related Guides to the Product](https://learn.adafruit.com/products/5300/guides)
![Adafruit ESP32-S2 TFT Feather powered on by a USB- C power source displaying the product tittle in a red, yellow, green, white and blue. ](https://cdn-shop.adafruit.com/640x480/5300-06.jpg)

### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)
![Angled shot of a coiled black, USB-C to USB-A cable.](https://cdn-shop.adafruit.com/640x480/4474-02.jpg)

# ESPHole Ad Blocker

## Code the ESPHole

We've created a drag-and-drop UF2 file to make it easy to get your ESPHole up and running right away. If you'd like to tweak the code and upload via Arduino IDE, check out the [source code here](https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/main/ESP32S2_TFT_AdBlocker).

While the actual code you'll run is a compiled Arduino sketch, first, you will put CircuitPython on the Feather in order to create a file system accessible as a USB drive. This way, you can add the **secrets.json** file with login information for the local router. The firmware doesn't have the WiFi access point data, instead it's separated out into a json file that can be easily modified.

Then, you'll drag on the UF2 file of the compiled Arduino code. (Download link below).

## Create Filesystem, Add Files

1. Plug in Feather to your computer with a known good data cable.
2. Double-click the Feather board reset button to get to bring up the bootloader **FTHRS2BOOT** drive in your computer File Explorer/Finder.
3. [Download the latest release version of CircuitPython for this board](https://circuitpython.org/board/adafruit_feather_esp32s2_tft/).
4. Drag the CircuitPython .uf2 file onto **FTHRS2BOOT** drive ([more info here](https://learn.adafruit.com/adafruit-esp32-s2-tft-feather/circuitpython)).
5. After a moment **CIRCUITPY** drive will show up
6. Copy the **secrets.json** code below, paste it into a text editor on your computer and edit it to use your SSID and password for your WiFi router, then save the file to the **CIRCUITPY** drive.
7. Next, download the pre-compiled ESPHole UF2 file linked below.
8. Double-click the Feather board reset button to get to the bootloader AGAIN.
9. Drag the UF2 onto the **FTHRS2BOOT** drive to flash it with the **ESPHole** code.

```auto
{
    'ssid' : 'YOUR_WIFI_SSID',
    'password' : 'YOUR_WIFI_PASSWORD',
    'hostname' : 'esphole',
    'hostfile' : 'https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt'
}
```

[ESP_TFT_Hole.UF2](https://cdn-learn.adafruit.com/assets/assets/000/110/955/original/ESP_TFT_Hole.UF2?1650662269)
# ESPHole Ad Blocker

## Build the ESPHole Case

A case is recommended and a 3D printed case is very nice. Below are the steps to 3D print the case used.

Download the 3D files from the link below. You can then print them without support on your 3D printer. Some horizontal expansion settings may need to be tuned for the best snap fit action.

Slice with settings for PLA material.&nbsp;The parts were sliced using CURA using the slice settings below.

- PLA filament 220c extruder
- 0.2 layer height
- 10% gyroid infill
- 60mm/s print speed
- 60c heated bed

[Download 3D model files](https://www.thingiverse.com/thing:5369146)
![](https://cdn-learn.adafruit.com/assets/assets/000/111/144/medium800/feather_boards_esphole-6460.jpg?1651021773)

![](https://cdn-learn.adafruit.com/assets/assets/000/111/145/medium800/feather_boards_esphole-6459.jpg?1651021789)

![](https://cdn-learn.adafruit.com/assets/assets/000/111/146/medium800/feather_boards_esphole-6458.jpg?1651021795)

![](https://cdn-learn.adafruit.com/assets/assets/000/111/148/medium800/feather_boards_esphole-6456.jpg?1651021829)

# ESPHole Ad Blocker

## Use the ESPHole to say 'Nah!' to Ads

Now to set up ESPHole to block ads for your devices.

To use the ESPHole to tell advertisers "Nah!", you'll set the DNS (Domain Name Server) to the IP address listed on the ESPHole. In this case 192.168.1.33.

![feather_boards_esphole-6446.jpg](https://cdn-learn.adafruit.com/assets/assets/000/111/158/medium640/feather_boards_esphole-6446.jpg?1651077433)

In the example shown below, I've gone to my iPad's:

- **Settings \> WiFi**
- Click the SSID name
- **DNS \> Configure DNS**
- **Manual**
- Press **+ Add Server**
- Type in the ESPHole IP address as listed on the screen of the Feather TFT ( **192.168.1.33** )
- Press **-** and then **Delete** to remove any existing DNS server such as 192.168.1.1
- **Save**

Here you can see a split screen of the Automatic DNS settings (default) which allow a big banner ad to distract from a web site.

![](https://cdn-learn.adafruit.com/assets/assets/000/111/153/medium800/feather_boards_demoforbes1.jpg?1651077316)

With the ESPHole on and the iOS device configured to use it as DNS server, you can see the nice, clean content of the website. Hey banner ad, Nah!

![](https://cdn-learn.adafruit.com/assets/assets/000/111/154/medium800/feather_boards_demoforbes2.jpg?1651077329)

These same directions will work on other iOS devices such as iPhones, and you can do similar setups for your computers and other mobile operating systems.

Happy uncluttered web browsing to you!

![](https://cdn-learn.adafruit.com/assets/assets/000/111/161/medium800/feather_boards_esphole-6485_action.jpg?1651078203)

# ESPHole Ad Blocker

## Android Settings

Here's how to configure an Android device to use the ESPHole -- it's a little more complicated than on iOS, but not too tricky!

First, go to Android **Settings \> Connections**

![](https://cdn-learn.adafruit.com/assets/assets/000/114/653/medium800/projects_1.jpg?1661977938)

Click **Wi-Fi**

![](https://cdn-learn.adafruit.com/assets/assets/000/114/654/medium800/projects_2.jpg?1661977964)

Click the&nbsp; **gear icon** &nbsp;next to the SSID name of your network

![](https://cdn-learn.adafruit.com/assets/assets/000/114/657/medium800/projects_WWW.jpg?1661978360)

Click **Advanced**

![](https://cdn-learn.adafruit.com/assets/assets/000/114/659/medium800/projects_3.jpg?1661978408)

Change from **DNS** to **Static**

![](https://cdn-learn.adafruit.com/assets/assets/000/114/660/medium800/projects_4.jpg?1661978451)

![](https://cdn-learn.adafruit.com/assets/assets/000/114/661/medium800/projects_5.jpg?1661978474)

![](https://cdn-learn.adafruit.com/assets/assets/000/114/663/medium800/projects_6.jpg?1661978495)

In&nbsp; **Static IP Settings** , change the&nbsp; **DNS 1** &nbsp;to the IP address of the ESPHole that is shown on the TFT display.

Then, press **Save**

![](https://cdn-learn.adafruit.com/assets/assets/000/114/664/medium800/projects_7.jpg?1661978619)

That's it! Now, visit a website and watch the ads and other critters disappear.


## Featured Products

### Adafruit ESP32-S2 TFT Feather - 4MB Flash, 2MB PSRAM, STEMMA QT

[Adafruit ESP32-S2 TFT Feather - 4MB Flash, 2MB PSRAM, STEMMA QT](https://www.adafruit.com/product/5300)
We've got a new machine here at Adafruit, it can uncover your deepest desires. Don't believe me? I'll turn it on right now to prove it to you! What, you want unlimited mozzarella sticks? OK well, that's not something we can provide. But we can provide your...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5300)
[Related Guides to the Product](https://learn.adafruit.com/products/5300/guides)
### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)

## Related Guides

- [Adafruit ESP32-S2 TFT Feather](https://learn.adafruit.com/adafruit-esp32-s2-tft-feather.md)
- [Adafruit IO Basics: Digital Output](https://learn.adafruit.com/adafruit-io-basics-digital-output.md)
- [Integrating Color Sensors with itsaSNAP and HomeKit](https://learn.adafruit.com/integrating-color-sensors-with-itsasnap-and-homekit.md)
- [CircuitPython Web Workflow Code Editor Quick Start](https://learn.adafruit.com/getting-started-with-web-workflow-using-the-code-editor.md)
- [File Glider](https://learn.adafruit.com/file-glider.md)
- [Forecast the Weather at Home with a No-Code Barometer ](https://learn.adafruit.com/dps310-analog-barometer.md)
- [Getting Started with Microsoft Azure and CircuitPython](https://learn.adafruit.com/getting-started-with-microsoft-azure-and-circuitpython.md)
- [Blinka Says Tabletop Arcade Game](https://learn.adafruit.com/blinka-says-tabletop-arcade-game.md)
- [Introducing Adafruit Feather](https://learn.adafruit.com/adafruit-feather.md)
- [Adafruit IO Basics: Analog Input](https://learn.adafruit.com/adafruit-io-basics-analog-input.md)
- [Raspberry Pi Azure IoT Hub Dashboard with CircuitPython](https://learn.adafruit.com/raspberry-pi-iot-dashboard-with-azure-and-circuitpython.md)
- [Playing Animated GIF Files in CircuitPython](https://learn.adafruit.com/using-animated-gif-files-in-circuitpython.md)
- [PyLeap ESP32-S3 TFT Boxing Glove Tracker w/ Adafruit IO](https://learn.adafruit.com/esp32-s2-tft-boxing-glove-tracker-w-adafruit-io.md)
- [Mini Weather Station ESP32-S3 TFT](https://learn.adafruit.com/mini-weather-station-esp32-s2-tft.md)
- [Personal and Portable ESP32-S2 Web Server](https://learn.adafruit.com/wordle-personal-esp32-s2-web-server.md)
