Running DOOM (Sort Of) On A Sonoff Smart Switch

It’s often said in this community that DOOM can be made to run on anything, and as time goes on, that’s becoming more and more accurate. We’re at the point now that every “normal” device seems to have some version of the iconic 1993 shooter, so now there’s nothing left but to start working on the more oddball targets.

As a perfect example, [piuppi] recently wrote in to share their efforts to get DOOM — or at least something that looks like it — running on the Sonoff Basic R2 smart switch. We say something that looks like it because the game you’re seeing in the video below isn’t actually DOOM. In fact, it’s not even really a full game. It’s essentially a tech demo that’s capable of rendering graphical data pulled from the game, but only within the confines of simplistic map. Still, not bad for something designed to turn lamps on and off.

The GitHub repo includes excellent documentation should you want to rip and tear on your own Sonoff device. As you might expect the process is a bit involved, and does require you to provide your own copy of DOOM for the script to extract the necessary data from. After it’s setup, you can hit the switch from any browser on the local network and take out your frustrations on the state of modern home automation on some imps. The best part is, even after the game is installed and running on the switch, the device still actually works as a switch.

But don’t worry. Even in the unlikely event that we run out of devices that can be hacked to run DOOM, there’s still a whole world of gadgets out there that need their own port of Duke Nukem 3D.

12 thoughts on “Running DOOM (Sort Of) On A Sonoff Smart Switch”

    1. Yep, pretty much :) The game logic and 3D view run on the Sonoff, using its limited RAM, while the assets, including the music, live in the ESP8285’s flash memory. The browser handles the UI, input and playback, but not the actual game engine. Squeezing all of that into an ESP8285 was basically the fun part with opus :)

  1. Haha, this is absolute brilliance!

    It’s incredible what people manage to squeeze out of an ESP8266! The fact that this tiny little chip—meant purely to flip a light switch on and off—is hosting a local web server, serving extracted DOOM map data, and still keeping its original relay functionality intact is peak Hackaday energy.

    Sure, the browser is doing the heavy graphical rendering lifted from the Sonoff’s data, but having a smart switch literally serve up DOOM over Wi-Fi takes home automation hacks to a whole new level.

    Huge props to [piuppi] for making “Does it run DOOM?” a reality for $5 smart plugs! Next step: Duke Nukem on a toaster? 🚀🔥🎮

    Unzip.

    1. Haha, thanks! :D Small detail… it’s actually an ESP8285, basically an ESP8266 with integrated flash (1MB) ,…and… hasn’t someone already made Duke Nukem run on a toaster? :)

    1. Yep, AI was part of the process, but getting everything to work on such limited hardware was the fun part. And yes, it’s a custom raycaster, not the original DOOM engine. The challenge was making it work on a Sonoff while keeping its smart switch functionality intact. :)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.