Reference · Quick lookup
Connectivity Cheat-Sheet
Wi-Fi → HTTP → MQTT → Home Assistant, on one page. Print me.
The compressed essence of the
Connectivity track (Lessons 19–22): the
REPORT arrow of SENSE → DECIDE → ACT → REPORT.
Wi-Fi (Lesson 19)
- Station mode = join your network (use this). AP mode = be your own hotspot (for setup).
- Shape: set STA →
WiFi.begin(ssid, pass) → wait for WL_CONNECTED → read WiFi.localIP().
- The router gives the gadget an IP address — how other devices reach it.
Gotchas
2.4 GHz only (not 5 GHz) · keep credentials in an uncommitted secrets file · handle reconnects · mind signal/placement.
HTTP — web server (Lesson 20)
- Request/response: client (browser) asks, server (ESP32) answers.
- URLs as commands:
/on, /off, /status.
- ESP32 as server (host a page) or client (call out to a service). Reach by name with mDNS (
name.local).
- Limit: you must poll; one-to-one; awkward for a whole home → use MQTT.
MQTT (Lesson 21)
- Publish/subscribe via a broker. Publish to a topic (
home/livingroom/temp); subscribers to that topic receive it.
- Publisher & subscriber are decoupled; push-based; many-to-many; lightweight.
- ESP32: PubSubClient library —
publish() / subscribe(). Know retain & QoS.
- Run your own broker (Mosquitto) for privacy. Public brokers = learning only.
Home Assistant (Lesson 22)
| Path | How | When |
| ESPHome | Describe gadget in YAML; it builds firmware; native HA integration + OTA | Easiest — start here |
| MQTT | ESP32 publishes/subscribes; HA MQTT integration + MQTT Discovery auto-creates entities | Full control / portability |
- Device becomes an entity → use in automations (e.g. temp > 24°C → fan on).
- HA runs locally — private, no cloud needed.
HTTP vs MQTT
| HTTP | MQTT |
| Pattern | Request/response | Publish/subscribe |
| Initiative | You poll | Device pushes |
| Scale | One-to-one | Many-to-many |
| Use for | One gadget on demand | A whole smart home |
← Course home · Glossary · Rules of thumb