Breadboard
docs
Example project · ESP32

ESP32-S3 Wi-Fi HTTP client (OLED)

The dual-core ESP32-S3 boots the real Wi-Fi stack on both LX7 cores, joins BreadboardNet, and fetches a page from the in-core virtual server over a genuine TCP socket, rendering the status, response body, and a live request counter to a big 1.5″ 128×128 OLED, re-fetching every couple of seconds. Open the 📡 Sniffer to follow the whole conversation: SYN/ACK, the GET, the streamed response, and the FIN teardown.

The ESP32-S3 Wi-Fi HTTP client (OLED) circuit as rendered by the simulator

What's on the bench

  • Battery
  • ESP32-S3
  • OLED 1.5″ 128×128

The code

This MicroPython script runs on the emulated board every boot; edit it in the Code tab.

from machine import I2C, Pin
import framebuf, time
i = I2C(0, scl=Pin(9), sda=Pin(8))
buf = bytearray(2048)
fb = framebuf.FrameBuffer(buf, 128, 128, framebuf.MONO_VLSB)
for c in b'\xae\x20\xa8\x7f\xd3\x00\xdc\x00\x81\x4f\xad\x8a\xa4\xa6\xaf':
    i.writeto(0x3d, bytes([0, c]))
def show():
    for p in range(16):
        i.writeto(0x3d, bytes([0x00, 0xb0 + p, 0x00, 0x10]))
        i.writeto(0x3d, b'\x40' + buf[p*128:(p+1)*128])

import network, socket
w = network.WLAN(network.STA_IF)
w.active(True)
fb.fill(0); fb.text('S3 connecting...', 0, 60); show()
w.connect('BreadboardNet')
while not w.isconnected():
    time.sleep_ms(100)
ip = w.ifconfig()[0]
n = 0
while True:
    s = socket.socket()
    s.connect(('192.168.4.1', 80))
    s.send(b'GET / HTTP/1.0\r\nHost: breadboard\r\n\r\n')
    resp = s.recv(512).decode()
    s.close()
    n += 1
    status = resp.split('\r\n')[0]
    body = resp.split('\r\n\r\n')[-1].strip()
    if n == 1:
        print(status)
        print(body)
    fb.fill(0)
    fb.text('ESP32-S3 HTTP', 0, 0)
    fb.hline(0, 10, 128, 1)
    fb.text('IP ' + ip, 0, 16)
    fb.text('GET 192.168.4.1', 0, 28)
    fb.text(status[:16], 0, 40)
    fb.hline(0, 52, 128, 1)
    for k in range(4):
        fb.text(body[k*16:(k+1)*16], 0, 58 + k*12)
    fb.text('requests: %d' % n, 0, 112)
    show()
    time.sleep_ms(2000)