ESP32 IoT Gateway
Enclosed gateway with Wi-Fi, BLE and wired Ethernet failover, sensor aggregation and three relay channels.
- ESP32
- Ethernet
- BLE
- MQTT
- AWS IoT
- FreeRTOS

Problem
Industrial and commercial deployments need a single gateway that can reach the network by whichever interface is available on site, and drive local loads.
System overview
A fully enclosed gateway on the ESP32-WROOM-32D supporting Wi-Fi, BLE and wired Ethernet via an HR911105A magnetics-integrated jack, with automatic fallback between Ethernet and Wi-Fi. BLE is used for local provisioning without a network. UART ultrasonic sensors plus 1-Wire and analog temperature inputs publish to AWS IoT Core and Firebase Realtime Database. Three SONGLE relay channels (10 A / 250 VAC) drive motor, light and auxiliary loads. 9–24 V DC input, IP-rated enclosure, external SMA antenna.
- 01UART ultrasonic / 1-Wire / analog temperature
- 02ESP32-WROOM-32D
- 03Ethernet ↔ Wi-Fi failover
- 04MQTT
- 05AWS IoT Core / Firebase RTDB
Responsibilities
- Hardware design and enclosure integration
- Ethernet, wireless and antenna provisioning
- Firmware for connectivity fallback, sensor acquisition and cloud publishing
Hardware architecture
- ESP32-WROOM-32D module
- HR911105A Ethernet jack with integrated magnetics
- 3× SONGLE relays, 10 A / 250 VAC
- 9–24 V DC input with onboard switching regulator
- External SMA antenna provisioning, IP-rated enclosure
Firmware architecture
- Automatic Ethernet ↔ Wi-Fi fallback
- BLE provisioning for local configuration
- UART ultrasonic, 1-Wire and analog temperature acquisition
- Publishing to AWS IoT Core and Firebase Realtime Database
- Cloud commands, local thresholds and RTOS-scheduled relay rules
Communication interfaces
- Ethernet
- Wi-Fi
- BLE
- UART
- 1-Wire
- MQTT
Engineering challenges
- Seamless failover between wired and wireless interfaces without dropping cloud sessions
- Wireless performance from inside an IP-rated metal-adjacent enclosure, addressed with external SMA antenna provisioning
- Isolating mains-rated relay switching from low-voltage sensing on one board


