
Cómo funciona
Seguridad Wi-Fi real, sin fingir: añade WPA2-PSK (SecureNet, canal 6, contraseña hunter2) al medio de la placa; w.connect('SecureNet', 'hunter2') hace la negociación real de 4 pasos. PBKDF2 deriva claves, EAPOL 1 a 4 cruzan el medio y cada trama posterior se cifra con CCMP real. La OLED dibuja un candado al conectar y el script imprime secured con la concesión DHCP.
Componentes del montaje
- ESP32-C3
- OLED 128×64
Cómo está conectado
- orificio a10→orificio B-5
- orificio a11→orificio B+5
- orificio a40→orificio B-9
- orificio a41→orificio f10
- orificio a42→orificio g11
- orificio a43→orificio b20
- ESP32-C3 · gnd→orificio e10
- ESP32-C3 · vin→orificio e11
- ESP32-C3 · g8→orificio e20
- ESP32-C3 · 3v3→orificio i10
- ESP32-C3 · g9→orificio i11
El código
Este script de MicroPython se ejecuta en la placa emulada en cada arranque; edítalo en Code.
from machine import I2C, Pin import framebuf, time i = I2C(0, scl=Pin(9), sda=Pin(8)) buf = bytearray(1024) fb = framebuf.FrameBuffer(buf, 128, 64, framebuf.MONO_VLSB) for c in b'\xae\xd5\x80\xa8\x3f\xd3\x00\x40\x8d\x14\x20\x00\xa1\xc8\xda\x12\x81\xcf\xd9\xf1\xdb\x40\xa4\xa6\xaf': i.writeto(0x3c, bytes([0, c])) def show(): i.writeto(0x3c, b'\x00\x21\x00\x7f\x22\x00\x07') i.writeto(0x3c, b'\x40' + buf) import network w = network.WLAN(network.STA_IF) w.active(True) fb.fill(0); fb.text('WPA2 joining...', 0, 28); show() w.connect('SecureNet', 'hunter2') while not w.isconnected(): time.sleep_ms(100) ip = w.ifconfig()[0] print('secured', ip) def padlock(x, y): fb.rect(x, y + 6, 14, 10, 1) # body fb.rect(x + 4, y, 6, 8, 1) # shackle fb.fill_rect(x + 6, y + 9, 2, 4, 1) # keyhole while True: fb.fill(0) fb.text('SECURE LINK', 0, 0) padlock(110, 0) fb.hline(0, 10, 128, 1) fb.text('SecureNet WPA2', 0, 16) fb.text('IP ' + ip, 0, 30) fb.text('CCMP encrypted', 0, 44) show() time.sleep_ms(500)
Prueba esto
- Abre Wi-Fi sniffer y encuentra EAPOL 1–4: esa es la negociación.
- Compara antes y después: los datos pasan de legibles a cifrados.
- Cambia la contraseña por una incorrecta y ejecuta: la negociación falla y nunca se conecta.
- Selecciona la placa y observa el progreso en el Inspector durante ⟲ Restart.



