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

  • @fundemo
    @fundemo3 ай бұрын

    Thank you so much ❤, Ahmed bhai apka ye method mere liye bohat hi helpful rha hy.

  • @CarlosAndres7
    @CarlosAndres711 ай бұрын

    Thank you! Very useful and complete!!!

  • @hasanthakarunachandra3722
    @hasanthakarunachandra372210 ай бұрын

    Thank you for making this excellent video.

  • @michaelcuento
    @michaelcuento Жыл бұрын

    Thanks, Ahmad. I've gained valuable new insights once again from your tutorial..

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    Glad to hear that!

  • @hothikirit6629
    @hothikirit662910 ай бұрын

    Awesome explained !!!

  • @alfonso2ff
    @alfonso2ff Жыл бұрын

    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

    @AhmadLogs

    Жыл бұрын

    Thank you very much!

  • @CiroPeixoto
    @CiroPeixoto7 ай бұрын

    Caraca !!! 😳😳😳Super Video!!! 👏👏👏Parabéns pelo conhecimento e obrigado por compartilhar conosco 🙏

  • @alfonso2ff
    @alfonso2ff Жыл бұрын

    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

    @AhmadLogs

    Жыл бұрын

    Excellent!

  • @edinetgrunhed6000
    @edinetgrunhed60003 ай бұрын

    very good, i like a PHP so stable

  • @amysoftec8205
    @amysoftec8205Ай бұрын

    Thank you so much🥰🥰

  • @amrzakaria5290
    @amrzakaria5290 Жыл бұрын

    Thanks a lot, good job.

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    Glad it helped

  • @johannbabl5839
    @johannbabl5839 Жыл бұрын

    Excellemt video, excellent informations and excellent explained. Congrats

  • @AhmadLogs

    @AhmadLogs

    11 ай бұрын

    thanks

  • @funnycats9738
    @funnycats9738 Жыл бұрын

    Thanks again

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    Always welcome

  • @parvazno
    @parvazno Жыл бұрын

    perfect .thanks

  • @AhmadLogs

    @AhmadLogs

    Жыл бұрын

    You're welcome!

  • @arispras
    @arispras9 күн бұрын

    Nice tutotial, thanks. Which is better? websocket Server using PHP or Node js?

  • @valerienihsimsion1870
    @valerienihsimsion18704 ай бұрын

    I like the explanation, thank you. Can you make the communication to run on any network? Not only on same network

  • @davidoleas5084
    @davidoleas50848 ай бұрын

    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?

  • @TechnicalYarana
    @TechnicalYarana Жыл бұрын

    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

    @AhmadLogs

    Жыл бұрын

    just restart your computer wifi, restart your mobile wifi then try to connect again.

  • @TechnicalYarana

    @TechnicalYarana

    Жыл бұрын

    @@AhmadLogs okay sit I will try

  • @pradeep6792
    @pradeep67923 ай бұрын

    Can we use node mcu instead of esp32 ?

  • @George_NM
    @George_NM10 ай бұрын

    So,do we want to clear the clients from client array when clients disconnect

  • @thegamerzzz548
    @thegamerzzz5483 ай бұрын

    bro can we do this task by directly sending and receiving data from node mcu to sql server without any php in between ?

  • @sanketkharade5672
    @sanketkharade56724 ай бұрын

    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

  • @johanjeques
    @johanjeques11 ай бұрын

    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

    @AhmadLogs

    11 ай бұрын

    yes you can host websocket server online on a cloud or webhosting

  • @johanjeques

    @johanjeques

    11 ай бұрын

    Thank you sir

  • @prodyumnapal5430

    @prodyumnapal5430

    5 ай бұрын

    Did you do it? can we connect via Linkedin?

  • @johanjeques

    @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

  • @MrPool-yu6op
    @MrPool-yu6op6 ай бұрын

    @AhmadLogs Is any option to create communication between php server and android code? If yes please help out.

  • @prodyumnapal5430
    @prodyumnapal54305 ай бұрын

    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?

  • @govardhanmuddapati8834
    @govardhanmuddapati88348 ай бұрын

    Make a video an esp32 without entering wifi credentials on programming we can customize the wifi credentials without touching the program

  • @natya609
    @natya6097 ай бұрын

    hello friend, how to deploy this program to cloud? will you give the tutorial? thankyou

  • @raihanzaenalmutakin9144
    @raihanzaenalmutakin91449 ай бұрын

    why my vendor file doesnt has the autoload.php

  • @dilangunawardhana
    @dilangunawardhana Жыл бұрын

    Ahmad, Instead of doing this with web socket server can we do the same project (real time & two way communication) with MySQL server....?

  • @AhmadLogs

    @AhmadLogs

    11 ай бұрын

    I am not sure if it is possible directly. you need to refresh the database table to see the new values.

  • @rogeranthonybairoy8854
    @rogeranthonybairoy885411 ай бұрын

    may i ask what version of the Arduino Socket are you using?

  • @AhmadLogs

    @AhmadLogs

    11 ай бұрын

    0.5.3

  • @rogeranthonybairoy8854
    @rogeranthonybairoy885411 ай бұрын

    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

    @AhmadLogs

    11 ай бұрын

    install the esp32 2.0.9 core

  • @khanhdaoba
    @khanhdaoba Жыл бұрын

    Nice video, can i have your Facebook information ?

  • @mirkocapon
    @mirkocapon4 ай бұрын

    how i can contact you? do you have an email? thanks