ESP32 Localhost Two-Way Communication - Tutorial for Absolute Beginners Step by Step
In this video, we explore the exciting world of ESP32 and localhost two-way communication. Starting with an introduction to websockets, we dive into the working principles behind websockets and the PHP Ratchet library. We guide you through the setup process, from installing Composer to creating the project folder and installing the necessary Ratchet library.
Next, we demonstrate how to create a websocket server and define its address, followed by starting the server and testing it using a websocket client extension. We also write additional code for the server and conduct tests from a mobile phone to ensure seamless communication.
With the foundation in place, we switch gears and build a custom websocket client using JavaScript. Additionally, we design a home page for our project, complete with a toggle button and temperature data handling. You'll learn how to display button states and temperature information on the home page.
The video then delves into creating a websocket client on the ESP32, showcasing how to test its functionality and send fake data from the ESP32 to localhost. We demonstrate sending real-time DHT11 sensor data to the localhost server and explore controlling an ESP32 LED from the localhost server. Finally, we demonstrate how to control the ESP32 LED using a push button.
--------------------------------------------------------------------------------------------------------------------
Useful Video Links
--------------------------------------------------------------------------------------------------------------------
ESP32 Send Temperature and Humidity Data to localhost XAMPP
• ESP32 Send Temperature...
--------------------------------------------------------------------------------------------------------------------
Download Code
--------------------------------------------------------------------------------------------------------------------
github.com/ahmadlogs/esp-loca...
For Paid Projects Hire Me On Upwork:
www.upwork.com/freelancers/~0...
--------------------------------------------------------------------------------------------------------------------
Disclaimer
--------------------------------------------------------------------------------------------------------------------
Disclaimer: All videos are for educational purposes and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.
#ESP32 #Localhost #esp32project
00:00 - Introduction
00:17 - Previous Knowledge
00:37 - Contents Overview
01:51 - WebSocket Introduction
02:40 - How WebSocket Works
03:17 - PHP Ratchet Library
03:53 - Installing Composer
05:13 - Setting up the Project Folder
06:52 - Installing Ratchet Library
07:45 - Creating WebSocket Server
11:12 - Defining WebSocket Address
13:16 - Starting WebSocket Server
13:43 - Installing WebSocket Client Extension
14:18 - Testing WebSocket Server using Client
15:32 - Writing Additional Code for WebSocket Server
17:07 - Testing WebSocket Server From Phone
17:55 - Updating WebSocket Server IP Address
18:27 - Final WebSocket Test
19:08 - Implementing Message Sending on Server
21:58 - Building Custom WebSocket Client Using JavaScript
25:11 - Creating Home Page for the Project
26:52 - Implementing Toggle Button on Home Page
31:35 - Handling Temperature Data on Home Page
34:04 - Displaying Button and Temperature Info on Home Page
35:18 - Creating WebSocket Client on ESP32
40:13 - Testing ESP32 WebSocket Client
40:57 - Sending Fake Data from ESP32 to Localhost
42:20 - Sending DHT11 Data to Localhost
44:40 - Controlling ESP32 LED from Localhost
46:28 - Controlling ESP32 LED Using Push Button
47:25 - Final Demo
47:57 - End Screen
Пікірлер: 51
Thank you so much ❤, Ahmed bhai apka ye method mere liye bohat hi helpful rha hy.
Thank you! Very useful and complete!!!
Thank you for making this excellent video.
Thanks, Ahmad. I've gained valuable new insights once again from your tutorial..
@AhmadLogs
Жыл бұрын
Glad to hear that!
Awesome explained !!!
The best, most interesting and complex project presented by you with a didactic score of 10. Congratulations and thank you for sharing your knowledge.
@AhmadLogs
Жыл бұрын
Thank you very much!
Caraca !!! 😳😳😳Super Video!!! 👏👏👏Parabéns pelo conhecimento e obrigado por compartilhar conosco 🙏
I carried out the entire step by step of your tutorial and was able to fully reproduce the prototype by measuring temperature, humidity and controlling the LED on the board. The tutorial is very educational and multi code. I really liked! Thanks and Congratulations!
@AhmadLogs
Жыл бұрын
Excellent!
very good, i like a PHP so stable
Thank you so much🥰🥰
Thanks a lot, good job.
@AhmadLogs
Жыл бұрын
Glad it helped
Excellemt video, excellent informations and excellent explained. Congrats
@AhmadLogs
11 ай бұрын
thanks
Thanks again
@AhmadLogs
Жыл бұрын
Always welcome
perfect .thanks
@AhmadLogs
Жыл бұрын
You're welcome!
Nice tutotial, thanks. Which is better? websocket Server using PHP or Node js?
I like the explanation, thank you. Can you make the communication to run on any network? Not only on same network
Excellent video. I have a question. In order to connect another device to the WebSocket server, I had to disable the firewall. Do you know what firewall configurations I need to allow communication without having to disable the entire firewall?
bro i have some issue try to same to another device websocket run my websocket not connected actually same device almost working when i try to ip address using connect websocket android app not connected whats issue please sir tell me ??
@AhmadLogs
Жыл бұрын
just restart your computer wifi, restart your mobile wifi then try to connect again.
@TechnicalYarana
Жыл бұрын
@@AhmadLogs okay sit I will try
Can we use node mcu instead of esp32 ?
So,do we want to clear the clients from client array when clients disconnect
bro can we do this task by directly sending and receiving data from node mcu to sql server without any php in between ?
Hey i havd done exactly the same code for esp32 but my client is not connected to server although wifi gets connected successfully plz help
Excellent tutorial, your video really inspires me sir. Can we host the WebSocket server to online web hosting and still make two-way communication with esp32?
@AhmadLogs
11 ай бұрын
yes you can host websocket server online on a cloud or webhosting
@johanjeques
11 ай бұрын
Thank you sir
@prodyumnapal5430
5 ай бұрын
Did you do it? can we connect via Linkedin?
@johanjeques
5 ай бұрын
Yes, I already tried. Logically we can host websocket server online to webhosting with this tutorial, but the problem is not all webhosting can host websocket server
@AhmadLogs Is any option to create communication between php server and android code? If yes please help out.
Can the ESP work the same way if kept anywhere, not in physical contact with the serving host? Like, can this be controlled from anywhere in the world?
Make a video an esp32 without entering wifi credentials on programming we can customize the wifi credentials without touching the program
hello friend, how to deploy this program to cloud? will you give the tutorial? thankyou
why my vendor file doesnt has the autoload.php
Ahmad, Instead of doing this with web socket server can we do the same project (real time & two way communication) with MySQL server....?
@AhmadLogs
11 ай бұрын
I am not sure if it is possible directly. you need to refresh the database table to see the new values.
may i ask what version of the Arduino Socket are you using?
@AhmadLogs
11 ай бұрын
0.5.3
i followed the video but when i try to compile it into an esp32, it sat that variable or field 'handleMesage' declared void, how should i fix this?
@AhmadLogs
11 ай бұрын
install the esp32 2.0.9 core
Nice video, can i have your Facebook information ?
how i can contact you? do you have an email? thanks