Control ESP32 from ANYWHERE in the World - Step-By-Step Tutorial

preview_player
Показать описание
Learn how to control ESP32 GPIO pins in real-time with AWS API Gateway WebSockets. I will show you step-by-step how to create and build:
- PlatformIO project with ESP32 WebSocket Client (C/C++)
- Serverless Framework project utilizing AWS API Gateway WebSockets, AWS Lambda, and AWS DynamoDB to handle the communication between clients (TypeScript)
- Web Application to control ESP32 from the browser (ReactJS)

Link to the code:

How to get started with Serverless Framework:

How to connect ESP32 to WiFi:

How to build Web Chat with Serverless Framework and AWS API Gateway Websockets:

NodeMCU 32S Development Board Specification:

Software used in the video:

Social Media:

Thank you for watching and see you soon!

00:00 Intro
00:11 What I'm going to build
00:53 Hardware presentation
01:10 ESP32 Project - Creating Project with PlatformIO
02:11 ESP32 Project - Using ESP32 WiFi Connect Template
03:49 ESP32 Project - Adding WebSocket Client to the Code
07:55 ESP32 Project - Listening to WebSocket Client Events
09:29 ESP32 Project - Handling WebSocket Events
13:49 ESP32 Project - How to Validate and Parse WebSocket Message Event
27:49 ESP32 Project - Handle Pin Mode Command
33:20 ESP32 Project - Handle Digital Read&Write Commands
36:14 ESP32 Project - Additional Error Handling
37:38 ESP32 Project - Acknowledgement Message
39:39 AWS WebSocket Server - Creating the Project
41:57 AWS WebSocket Server - Infrastructure Configuration
46:30 AWS WebSocket Server - Implementing WebSocket Handler with TypeScript
51:15 AWS WebSocket Server - Client Connect Implementation
53:36 AWS WebSocket Server - Client Disconnect Implementation
55:40 AWS WebSocket Server - Pass the Message Implementation
01:08:04 AWS WebSocket Server - Walk-through the code
01:11:13 AWS WebSocket Server - Deployment to AWS
01:11:37 ESP32 Project - Updating the Code with URL to WebSocket Server
01:12:28 ESP32 Project - Deploying the Code to ESP32
01:13:29 ReactJS Control Panel - Creating the Project
01:16:23 ReactJS Control Panel - Importing WebSocket Client Hook
01:18:09 ReactJS Control Panel - Building UI
01:23:16 ReactJS Control Panel - Behaviour Implementation
01:26:41 ReactJS Control Panel - Sending a Digital Write Message to the WebSocket Server
01:29:00 ReactJS Control Panel - Pin Mode and Digital Read Behaviour
01:41:11 Hardware - Wiring up the LED Diode
01:42:16 Testing the Project Locally
01:44:02 ReactJS Control Panel - Deployment to AWS S3
01:47:50 Testing Newly Deployed Website
01:48:35 The End
Рекомендации по теме
Комментарии
Автор

thank you so much I spend whole 24 hours to get it to work and it works you saved my life man good luck

БахтиярБрекешев
Автор

I'm very very glad that I managed to find your video. This will be of great help to my current project. Awesome work Tomasz, keep it up!

paulomarques
Автор

I just started to see this video
and can say PERFECT, PERFECT, PERFECT
wish best for you and good luck 🍀

hamidtb
Автор

Hello Tomasz! One question. When you started the project you selected "NodeMCU-32" board. The setup and the code Is the same if I use another ESP32 like ESP32 from espressif? I have a ESP32 devkit-v1
Thanks, great video!

ezequielbarrera
Автор

Very nice websocket tutorial, love your video quality!

ibzih
Автор

This is a great tutorial. Easy to follow and understand. Great explanations. This has helped me a lot with a project im working on. Thanks Tomasz!

stefanoalvares
Автор

Thank you so much. Very educated and professional coding. Could you also provide a documentation for controlling multiple ESP32s?

sametturhan
Автор

Stary, ratujesz mi życie, teraz jestem biedny, ale po wypłacie aż wynagrodzę Ci to jakimś szeklem, tylko prosze dalej rób to co robisz :D

hplownik
Автор

Nice video. Just want to know if there is any limit on the max number of esp32 (at various locations) that we can connect using your explained method?

SarmadSohaib
Автор

As of today 16th January 2024, this code is no longer working. I have spent all day trying to make it work but no response. I went ahead to copy your code base, but still won't work. I think something has broken with the aws serverless

AjirogheneSunny
Автор

Dziękuje ci, pomogłeś mi ogarnąć sterowanie robota przez telefon na olimpiadę z mechatroniki.

bartekbartoszewski
Автор

Hey, Why didnt you use AsyncWebServer or AsyncWebServerSocket? are there separate use cases for async one?

imjusttryingtobesafelol
Автор

when i run command 'yarn deploy' it's show errors massge "The provided route key is not formatted properly.... ....badrequest: 400 code" what did i do wrong?

bababa
Автор

Hello! Do you have the exact version of the .yml file for serverless on github? I am getting the error: "Cannot resolve variable at Value not found at "self" source" when I use yard deploy and I think my code is the same as yours

tatekolton
Автор

its maybe a dum question for you but, is everything free in this process especially hosting i heard that u have to pay or something, please answer thank you

ffinpoy
Автор

Nice walkthrough and explanation. Why don’t you have more subscribers and views? Is it too complex for most viewers? Is it too involved? Don’t you match what people are searching for?

EdwinMartin
Автор

Hi Tomasz,
hope you're well.
I am facing some issues when it comes to creating a path for the serverless AWS template. 00:41:00

tictecha
Автор

Hi Tomasz, I'm fairly new to this IOT stuff, i've one query, is all these web server using AWS, websocket free or we need to purchase some stuff? You didn't mention anything so it seems this all is free and we just need to purchase esp 32, led, resistor & breadboard.


In addition to above, if I wish to create cool IOT interfaces controlling stuff online, I need to learn JavaScript, aws & Esp 32 languages with their several libraries etc, is that right, or something else is required?

Adityasingh-sqgd
Автор

Real good video, thanks. I think you lost a lot of people on the json part. It can be confusing if people do not know json format. Maybe do a video on json format and sending back and forth between client and host

noweare
Автор

Panie Tomaszu, panski project "Control ESP32 from Anywhere in the world" zwrocil moja uwage w zwiazku z tym ze tej zimy padly moje lithium battery zasilane przez solar panels i calkowicie stracilem mozliwosc wgladu na moja polane kilkaset kilometrow od domu. Postanowilem wiec kupic generator ktory moze byc odpalany przez remote control a to daje mozliwosc zainstalowania w nim ESP32 bo start jest automatyczny i choke jest automatyczny ....calosc zasilana z bateri 12v. Nie jestem z zawodu programista, kiedys naprawialem telewizory a arduino traktuje jako hobby . Moze to bylby jakis pomysl na przyszly projekt...dziekuje

zdzislawtycner