WiFi Web Server on BBC micro:bit and ESP-01 (ESP8266)

Create a micro:bit web server via AT commands which can respond to web browser requests over WiFi.

The project allows you to control your BBC micro:bit via WiFi, by using a cheap ESP-01 (ESP8266) module. The micro:bit would generate an HTML web page for the user with control buttons on it. The web page can be accessed from your computer or smartphone without using any apps.

The micro:bit talks to the ESP-01 via AT commands, to set up a web server in either station or AP mode. These commands are in the factory firmware of ESP-01s.

The code is written in TypeScript (JavaScript). You can paste the code into the Microsoft MakeCode editor. You can also modify the HTTP request handle process and HTML generate function for your needs.

You can view the code here or copy the attachment in this article.

A USB-to-TTL cable/module is not necessary but can be used to monitor AT responses from the ESP-01. (In the photos I used a CR2102 6-in-1 module and Tera Term. I’ll skip tutorials about their setup and use.) Since the micro:bit’s serial port is reassigned, this is the only way for the user to read serial port data.”


Related Content