This project provides comprehensive functionality for an IoT device using ESP32. It supports Wi-Fi and MQTT for communication, has an asynchronous web server with webpage for configuration, handles OTA updates, reads sensor data, and controls relays and IR devices. The use of preferences and SPIFFS ensures that configuration data is stored persistently across reboots. Additionally MQTT protocol makes this device accesible on all platforms such as Windows , Linux, IOS ,Android etc. using the publisher and subscriber model .
-
git clone https://github.com/Vistx/IOT-Box.git
-
go to project /IOT Box tasks
- First : Build Filesystem Image
- Then: Upload Filesystem Image
-
Upload the code to your esp32
Important! The first code uploaded to the board must be done via Serial connection , after you setup the parameters in the user setup page the code can be uploaded via OTA. You can find the devices IP address in your router, after the first upload via serial change the upload_port = ip_here in platform.ini file .
This project uses HiveMQ as a broker , create an account here . The next step is to got to Clusters, in the top right corner Create New Cluster
and Create a Serverless Cluster.
After creating a Cluster enter Manage Cluster page
then go to Access Management and create Credentials to connect to that cluster.
Important: Give publish subscribe permissions to the created user.
User Setup: Connect to the "Setup IOT Box" access point Open your browser and follow the url: http://192.168.4.1/
Provide Your Wifi and HiveMq Broker credentials
Windows :
Android / IOS:
I use this app
Setup IoT MQTT Panel app
Drill a small hole to access the reset button on your PCB like so:
This button resets your saved credentials and sends the device in setup mode.
Parts used:
1x ESP-Wroom-32u
1x MQ-4 sensor
1x DHT 11
4x Relay module
1x IR transmitter and receiver module
1x Antenna with mount
1x Pair Male + Female 12v DC jack
1x Push button
2x Switches
1x Prototype PCB 6x8 breadboard
3x Leds (Red,Yellow,Blue)
3x Resistors 48 Ohm
You can find Fusion 360 Files here