<div align="center">

# 📡 RF433 Gateway

### A pocket-sized ESP32 that decodes *hundreds* of 433 MHz weather sensors, meters, and remotes — straight out of the box.

No app to install. No cloud. No home Wi‑Fi required. It hosts its **own Wi‑Fi network** and a **polished mobile web UI**, streams over **Bluetooth LE**, shows live status on a **1.8″ TFT**, and lets you **capture & replay** any remote you own.

![platform](https://img.shields.io/badge/platform-ESP32--WROOM--32-000?logo=espressif&logoColor=white)
![framework](https://img.shields.io/badge/framework-Arduino-00979D?logo=arduino&logoColor=white)
![protocols](https://img.shields.io/badge/decoders-56%20protocol%20families-4d8dff)
![ui](https://img.shields.io/badge/UI-Web%20%2B%20BLE%20%2B%20TFT-22d3a6)
![license](https://img.shields.io/badge/license-MIT-blueviolet)

<br>

<img src="docs/images/device-front.jpg" alt="Assembled RF433 Gateway: ESP32 with ST7735 TFT and 433 MHz RX/TX modules" width="420">

<sub>The reference build — ESP32 + 1.8″ TFT + RX470C receiver + 433 MHz transmitter, quarter‑wave antennas on both.</sub>

</div>

---

## ✨ What it does

| | |
|---|---|
| 🌡️ **Decodes everything** | 56 [pilight](https://github.com/puuu/espilight) protocol families — Nexus/Auriol/TFA weather stations, thermo‑hygro meters, smoke/contact/motion sensors, and dozens of remote/switch/dimmer brands. That's **hundreds of real devices** with zero configuration. |
| 📱 **Beautiful mobile UI** | Connect to its Wi‑Fi, a setup page pops open automatically. Live sensor cards, capture/replay, transmit, and on‑device display control — all in a fast single‑page app. |
| 🔵 **Bluetooth too** | A BLE Nordic‑UART service streams decoded JSON and takes the same commands — works from iOS, Android, macOS, and Web Bluetooth. No router involved. |
| 🎛️ **Capture & replay** | Arm the receiver, press any remote, and replay it later — even signals it can't decode. Captures survive reboots. |
| 🖥️ **Live TFT display** | On‑board 1.8″ screen shows Wi‑Fi/BLE status, the latest reading, and counters — and you can push custom text to it from the UI. |
| 🔌 **Standalone** | Runs entirely on the board. No cloud, no account, no internet. |

---

## 🎬 See it in action

```mermaid
flowchart LR
    subgraph AIR["🌍 433.92 MHz air"]
      S1["🌡️ Weather sensor"]
      S2["🚪 Door contact"]
      S3["🎛️ Remote fob"]
    end
    RX["📻 RX470C\nreceiver"]
    subgraph ESP["ESP32 RF433 Gateway"]
      DEC["ESPiLight\ndecoder (56 protocols)"]
      CORE["Firmware core\ncapture · replay · store"]
      TFT["🖥️ 1.8″ TFT"]
    end
    TX["📡 433 MHz\ntransmitter"]

    S1 & S2 & S3 -->|OOK| RX --> DEC --> CORE
    CORE --> TFT
    CORE -->|replay| TX -->|OOK| AIR

    CORE <-->|"Wi‑Fi AP · http://192.168.4.1"| WEB["📱 Mobile Web UI"]
    CORE <-->|"BLE Nordic‑UART"| BLE["🔵 Phone / laptop"]
    CORE <-->|"USB 115200"| SER["💻 Serial console"]
```

---

## 🚀 Quick start (3 steps)

1. **Flash it** — see [docs/BUILD.md](docs/BUILD.md) (one command with `arduino-cli`).
2. **Power it** — over USB or any 5 V source.
3. **Connect:**
   - **Wi‑Fi:** join **`RF433-Gateway`** (password **`rf433tool`**) → a page opens automatically, or browse to **http://192.168.4.1**
   - **Bluetooth:** open any BLE UART app → connect to **`RF433-Gateway`** → type `h`
   - **USB serial:** 115200 baud → type `h`

Then trigger a 433 MHz device nearby and watch it appear. 🎉

> 📖 Full walkthrough: **[docs/USAGE.md](docs/USAGE.md)**

---

## 🧰 What you need

A short, cheap parts list — full details and wiring in **[docs/HARDWARE.md](docs/HARDWARE.md)**.

| Part | Notes | ~Cost |
|------|-------|------|
| ESP32‑WROOM‑32 dev board | The brain (Wi‑Fi + BLE) | $5 |
| RX470C‑V01 (or any superheterodyne 433 MHz RX) | The receiver — **superhet, not the blue SYN480 module** | $2 |
| FS1000A / SYN115 433 MHz transmitter | For replay/transmit | $1 |
| ST7735 1.8″ TFT (128×160, SPI) | Live status display *(optional)* | $4 |
| 17 cm solid‑core wire × 2 | Quarter‑wave antennas — **do not skip** | — |
| Breadboard + jumpers | | $3 |

> 💡 A **CC1101** transceiver is an optional upgrade for much better range — see the hardware notes.

---

## 📚 Documentation

| Doc | What's inside |
|-----|---------------|
| 🧰 **[Hardware](docs/HARDWARE.md)** | Bill of materials, wiring diagram, pinout table, antenna tips, upgrade paths |
| 🔨 **[Build & Flash](docs/BUILD.md)** | Toolchain setup, libraries, the exact `arduino-cli` flags, troubleshooting |
| 📱 **[Usage](docs/USAGE.md)** | Web UI, Bluetooth, serial commands, capture/replay walkthrough |
| 🏗️ **[Architecture](docs/ARCHITECTURE.md)** | System diagrams, data flow, module map, memory layout |
| 📶 **[Protocols](docs/PROTOCOLS.md)** | All 56 decoder families and the devices they cover |
| 🤝 **[Contributing](CONTRIBUTING.md)** | How to add protocols, report bugs, submit PRs |

---

## 🖼️ The interface

```
┌─────────────────────────────┐        Wi‑Fi · BLE · USB
│  ● RF433 Gateway            │      ┌──────────────────────┐
│  [AP 1 client][BLE ✓][RX 42]│      │  📡 Live sensors      │
├─────────────────────────────┤      │  ┌────────────────┐   │
│  📡 Live   🎤 Capture        │      │  │ nexus  id 42   │   │
│  📤 Send   🖥️ Display  ℹ️     │      │  │ 🌡 21.4°C 💧 55%│   │
│                             │      │  └────────────────┘   │
│  nexus  ▸ temp 21.4  hum 55 │      │  [ Arm capture ]      │
│  auriol ▸ temp 19.8         │      │  [ Replay #0 ] [ ✕ ]  │
└─────────────────────────────┘      └──────────────────────┘
        TFT status                        Mobile web UI
```

---

## ⚠️ Legal & responsible use

This project is for **learning, and for interacting with 433 MHz devices you own**. Capturing or replaying signals from devices you don't own may be illegal in your jurisdiction and can violate radio regulations. 433.92 MHz is a shared ISM band — transmit responsibly, keep power low, and don't jam. **You are responsible for how you use it.**

---

## 🙏 Built on

- [ESPiLight](https://github.com/puuu/espilight) — pilight 433 MHz protocol decoders for ESP
- [NimBLE‑Arduino](https://github.com/h2zero/NimBLE-Arduino) — lightweight BLE stack
- [Adafruit GFX / ST7735](https://github.com/adafruit/Adafruit-ST7735-Library) — display driver
- [ArduinoJson](https://arduinojson.org) — JSON for the API & BLE stream
- Inspired by [OpenMQTTGateway](https://github.com/1technophile/OpenMQTTGateway)

<div align="center">

**MIT Licensed** · Made with 📡 by [P1rate5ec](https://github.com/P1rate5ec)

⭐ Star it if it helped you decode something cool.

</div>
