readme.md

Markdown · 68 lines

# ESP8266 OLED Captive Portal Text Display (mikrobot.pl)

This project turns an **ESP8266 dev board with a built-in 0.96" SSD1306 OLED** into a simple **Wi-Fi captive portal**.  
After flashing, the OLED shows **`mikrobot.pl`** (rotated 180°), and you can connect to the device’s Wi-Fi to change the text displayed on the screen.

---

## Features
- Displays a default text: **mikrobot.pl**
- **180° screen rotation** (for upside-down mounted OLED)
- Wi-Fi **captive portal** (DNS redirects any domain to the portal)
- Web UI to update OLED text instantly
- Uses **LED_BUILTIN** (doesn’t rely on incorrect board pin descriptions)

---

## Hardware
- ESP8266 board with built-in OLED (SSD1306 128×64, I2C)
- USB-C programming (CH340 on many variants)

---

## Wiring / Pins (most important)

### Built-in OLED (I2C)
The board uses the following I2C pins:
- **SCL = GPIO12 (D5)**
- **SDA = GPIO14 (D6)**

> No extra wiring is needed if your OLED is built in.  
> OLED I2C address is typically **0x3C**.

### Onboard LED
The sketch uses:
- **LED_BUILTIN** (usually **GPIO2** on ESP8266)
- Often **active-LOW** (LED turns on when pin is LOW)

---

## Software Requirements
### Arduino IDE
Install the **ESP8266 board package**, then select your board (e.g. NodeMCU 1.0 / ESP-12E).

### Libraries (Arduino Library Manager)
- **Adafruit SSD1306**
- **Adafruit GFX Library**

(ESP8266WiFi, DNSServer, ESP8266WebServer, Wire come with the ESP8266 core.)

---

## How to Use
1. Flash the sketch to your ESP8266.
2. On boot, the device creates a Wi-Fi access point:
   - **SSID:** `mikrobot-portal`
3. Connect to `mikrobot-portal` from your phone/laptop.
4. Open any website (it should redirect), or go directly to:
   - `http://192.168.4.1`
5. Enter a new text and press **Update OLED**.

The OLED updates immediately.

---

## Customization
- Change AP SSID in the sketch:
  ```cpp
  static const char* AP_SSID = "mikrobot-portal";