This project demonstrates wireless communication between two NodeMCU ESP8266 modules. One NodeMCU (referred to as the Pushbutton NodeMCU) is connected to a pushbutton, and the other (the LED NodeMCU) is connected to an LED. The objective is to wirelessly toggle the LED on or off by pressing the pushbutton. Additionally, each NodeMCU features a Wi-Fi status LED that indicates successful connection to the network.
The system consists of two main components:
Pushbutton NodeMCU (Sender):
Monitors a pushbutton connected to its GPIO pin.
When the button is pressed, it sends an HTTP GET request to the LED NodeMCU over the Wi-Fi network to toggle the state of the LED.
Includes a status LED to indicate successful Wi-Fi connection.
LED NodeMCU (Receiver):
Hosts a simple web server that listens for HTTP GET requests from the Pushbutton NodeMCU.
Toggles the state of an LED connected to its GPIO pin upon receiving a request.
Also features a status LED to indicate successful Wi-Fi connection.
The project uses the ESP8266’s built-in Wi-Fi capabilities to establish communication between the two devices. This setup is ideal for understanding basic IoT concepts like client-server communication, GPIO control, and network connectivity.
Applications
IoT-based home automation (e.g., remote light control).
Wireless communication for simple devices.
Educational projects to learn ESP8266 programming and Wi-Fi integration.
EXPANDED TECHNICAL DETAILS
Wireless Networking Foundations
This project serves as a masterclass in the various ways an ESP8266 can communicate with other devices and the internet.
- Station (STA) vs. Access Point (AP) Modes: Demonstrates how the ESP8266 can connect to a home router as a client or create its own standalone WiFi network for direct peer-to-peer control.
- TCP/IP Socket Communication: The code implements a simple TCP server/client architecture, allowing for raw data exchange between two ESP8266 modules across a network.
Protocol Implementation
- HTTP and WebSockets: Includes examples of hosting a basic HTML control panel and using WebSockets for bi-directional, real-time data streaming (e.g., live sensor graphing) without the overhead of standard HTTP requests.