ESP32 Hosts A Public Website

If you wanted to host a website, you could use any one of a number of online services, or spin up a server on a spare computer at home. If you’re a bit more daring, you could also do what [Tech1k] did, and run one on an ESP32 microcontroller.

The site in question is available (or at least, should be) at HelloESP.com. The first revision ran entirely on an ESP32, serving pages from a SPIFFS filesystem. The device was also fitted with a BME280 environment sensor and an OLED screen. It had an uptime of 500 days before the board failed.

The site has since been relaunched, running on a board that is framed on [Tech1k]’s wall. It runs on an ESP32-WROOM-32D, paired with a BME280 again, along with a CCS811 CO2 and air quality sensor and a DS3231 RTC for accurate timekeeping. The ESP32 is setup to hold an outbound WebSocket to a Cloudflare worker, with the Worker routing HTTP requests to the site via that route. This avoids the need for port forwarding for the ESP32 to be visible to the outside world, and the Cloudflare Worker will also serve a static version of the page in the case of WiFi dropouts or other temporary failures.

It’s true that this isn’t a completely unheard of project—microcontrollers have been working as simple web servers for a long time now. Still, [Tech1k] did a great job of making this as robust as possible and more like a real functional webserver rather than just something that runs on a local network to serve up a config page. That’s worthy of note.

You can run webservers on all kinds of chips these days, even the Raspberry Pi Pico. If you’re doing web stuff on something weird, you know we always wanna hear about it on the tipsline!

16 thoughts on “ESP32 Hosts A Public Website

  1. and the Cloudflare Worker will also serve a static version of the page

    I wouldn’t count a site you need JS to display anything as “static”.

  2. i wouldnt count on SPIFFS being stable long term… it was dropped years ago for a more modern solution like FATFS or LittleFS…the flash going bad from SPIFFS is a known thing and is probably why his board died

  3. I have an ESP32-D1 mini, running Sinric Pro in a smart socket. (Belkin turned off the service.) You can access the webserver across the network, (not publicly) and play js games from it, or, use the inbuilt BASIC interpreter to control the IO, including the relay. It has OTA and http upgrade for the firmware.

  4. i’m reminded of the time i set up a series of “pirate web servers” on Macintosh IIsis (that’s a 20 MHz 68030, much weaker than an ESP32) in a University of Virginia computer lab and had them hosting a bunch forbidden material like the Anarchist’s Cookbook. they were only good for static pages, but it was easy to get them listed in Altavista and they had traffic — delivering several pages per minute.

  5. I used to run my entire website on an NSLU2 NAS; web site, email server, antispam processor, the lot. This was a 266MHz ARM with 32MB of RAM. It worked fine. The ESP32 has got much less RAM but runs at twice the speed, so I’m entirely unsurprised that a static web server works on it.

    1. The processor in the ESP32-WROOM-32D is clocked at 240MHz, it has two cores, so it might run some things near twice the speed, but overall, it’s still slower.

    1. Exactly. Also do you remember there was a web server with PIC16F876 or 877, using an RTL8019 ISA network controller? That was very cool at the time!

  6. That means a Lora equipped heltec Meshtastic / meshcore node , with an extra 3 dollar core, can run a web server for it’s meshtastic Lora chat and display popular chats and make it into like a social media network for meshtastic where you can actually see the stuff happening throughout the day locally but online …one esp32 for Lora and the other esp32 using WiFi to go online like this etc. You may even need 1 more esp32 lol

  7. Back in 1999 there was a project with PIC12C509 implementing a tiny web server hosting a public website. Greeting to those of us who were already alive at this time.

Leave a Reply to Jan PrägertCancel 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.