ESP32-C3 Adblock

github.com

176 points by jayhoon 19 hours ago


muti - 17 hours ago

Weird how the readme talks about hash collisions, but not in the way I would expect. Two blocked domains with the same hash isn't a problem, they both need to be blocked.

Where hash collisions matter is false positives, e.g. if hash(google.com) = hash(adserver.com). There does appear to be a web dashboard and /unblock api so should be straightforward to resolve.

yoavm - 13 hours ago

If you're ever thinking about getting an ESP32-C3, do yourself a favor and get the variant that you can connect an external antenna to. The normal C3 has a built-in antenna that is extremely weak, making it useless for most things I was planning using it for.

BLKNSLVR - 15 hours ago

I'm a bit of a paranoid freak that likes lists, so I've got a PiHole that has a total list of 14-16M blocked domains.

Great idea, and good for casual blocking, but I'm almost moving to an "allow list" mindset. This solution would probably work better for that, I wonder if the good parts of the internet would fit into an 140k list.

waysa - 12 hours ago

I think it could fit even more domains using a Bloom Filter or similar probabilistic data structure. With a chance of false-positives of course. But that's a trade-off the project already makes.

1vuio0pswjnm7 - 16 hours ago

Whitelist/allowlist is easier, e.g., it's smaller

Depends on the user but not everyone is visiting new websites everyday

Even for those that are, the number of domain-IP mappings needed will be relatively small

Definitely under 140,000

Most DNS data I use is "static", it rarely changes. As such most times I don't have to make DNS queries. I store the domain-IP mappings in proxy memory; this is faster than DNS

No "blocklist" needed

timvdalen - 13 hours ago

> The trick everyone misses:

Please just write the first sentence of your README yourself

anilakar - 14 hours ago

There's no point in using PlatformIO for ESP32 MCUs. The native ESP-IDF extension works much better.

I would only recommend using it instead of the standard Arduino Processing IDE.

bilekas - 9 hours ago

Nice project and poc maybe, but I'm not seeing the practical application of this in a real world env, surely the latency is a deal breaker ?

rubyfan - 9 hours ago

I really like this conceptually. However, multiple elements feel like slop and that’s throwing warning signs to me. The Claude readme file and the tiktok-ish fast cut youtube video felt like Vince the Sham-wow guy put them together. Ironically it feels like the product of the problem we’re trying to avoid.

fwip - 18 hours ago

Cool idea, latency might be too high, wish the docs weren't all AI vomit.

jolux - 14 hours ago

10ms? Good grief that’s slow.

jwillmer - 11 hours ago

pinhole is great but if the device fails your network is down. I swapped to nextdns because of that. maybe support of multiple devices would fix it - now that is this cheap it would not matter .

swiftcoder - 5 hours ago

Slop aside, I think this angle of hyper-optimising Adblock is interesting. I recently migrated my pihole from an intel minipc down to an OrangePI Zero 3. Saved ~5 watts of power, which lets me extend the battery backup duration of my network closet during a power outage.

- 15 hours ago
[deleted]
peter_d_sherman - 9 hours ago

>"The trick everyone misses: you don't need to keep the blocklist in RAM.

Store the domains as sorted 40-bit hashes in flash and binary-search them.

140,000+ domains fit in ~0.7 MB of flash..."

Brilliant! (Although, what about potential hash collisions with domain names that shouldn't be blocked? Those are probably few and far between, so the utility of the block overall far outweighs any few false positives that might arise -- so I reiterate my claim of "brilliant"!)

Also (if you're a compression nerd like I am), it may be possible to analyze this table of 40-bit hashes further to find the longest binary substring that repeats the most across all of them (or binary substrings that just repeat a whole lot), and design a Huffman-like (or other tree or tree-like) data structure around those, and possibly compress the data further...

Of course, then the simplicity and elegance of the Binary Search might be lost, but it might be an interesting optimization exercise to know just how far that data could be compressed... "Hey Claude, try to optimize the compression of this data using alternative compression data structures, and report back to me!" (Or something like that! You know, get the AI coding agents to try different things -- or attempt to code it on your own (always better for understanding!), etc., etc.!)

Anyway, brilliant!

nicman23 - 14 hours ago

i dont get pihole. just use a proper dns? if you want local, just use unbound?

rekoil - 14 hours ago

"They were too preoccupied with whether they could, they never stopped to think whether they should"

Jokes aside, very impressive that it works!

manlymuppet - 14 hours ago

Wow, this is an atrocious name for a project haha. Cool though.

shevy-java - 9 hours ago

I have a weird opinion: I believe adblocking must become a basic human right. Conversely Google trying to deny ublock origin and other extensions, should be fined many billions of euros as punishment. Then be disbanded if unable to pay. That money also should directly go back to The People, since they suffered from this evil malpractice of Google and others. You can see that currently the opposite is happening e. g. AI slop companies pushing ads down to people. That's why we must make adblocking a basic human right - free access to information at all times.

It may sound strange right now, but people in the future will ask why we did not push back against these evil leeching companies before. Those fines are no longer enough nor sufficient - CEOs that break human rights need to go to jail for mandatory 5 years minimum, without any way to weasel out their way via money. Right now money is a way to get out - that system is broken. Anyone wondered how Epstein got so much money in the first place? Hint: he did not build it up by himself only.

latencyharbor - 5 hours ago

[flagged]

aiXis - 14 hours ago

[flagged]

nazmul_ai - 9 hours ago

[flagged]