How to Create a Web Server (with WebSockets) Using an ESP32 in Arduino

  Переглядів 136,875

Shawn Hymel

Shawn Hymel

4 роки тому

This is a continuation of the ESP32 WebSocket Server video: • How to Make an Arduino... . Let's take it to the next level! We begin by hosting a web server and WebSocket server on an ESP32 using Arduino. Next, we use SPIFFS to upload a simple index.html page that we write separately. This page will open a WebSocket connection back to the ESP32, where we can use the page's button to toggle an LED (relatively quickly).
Note that we use the ESP32 as an access point (AP) here to simplify the process. You can do away with the access point, if you wish to have the web server on your local network.
WebSockets provide a persistent connection between a client and server so that either party can send data at any time. They are very useful in things like networked video games, but they can also be applied to IoT devices, if we need fast control of hardware over a network.
Arduino and HTML code from the video can be found here: shawnhymel.com/1882/how-to-cre...

КОМЕНТАРІ: 171
@lenreinhart2020
@lenreinhart2020 2 роки тому
I just got an ESP32-C3-mini-1 and I had already set up the boards and device to ESP32-C3. Following your presentation, the code worked fine on it. On to the second part! :) Thank you - whoops, this is the second part. I"ll post this back on the first.
@katkothaza
@katkothaza 2 роки тому
So I searched google and UKposts for weeks looking for a detailed yet to the point tutorial about this very topic, and the ones I found are either too complicated or expecting me to be a web developer. Then only today, UKposts simply suggest this video to me like I never searched for such a thing!! It's exactly what I'm looking for as if it was made specifically for me!! why UKposts!! why!! 😩 This video should be the top result whenever someone search for "ESP32 webserver" Thank you so much for this video as I find it perfect!
@PatrickKnobel
@PatrickKnobel 4 роки тому
Wow nice timing! Exactly what I need for my next project. ❤️
@barrybuelow9651
@barrybuelow9651 3 роки тому
Shawn - Great video! It really helps me out with a project. Hope you are doing well and staying safe.
@peervincent7845
@peervincent7845 4 роки тому
Good work Shawn! Done as you had explained and it works perfectly!
@ShawnHymel
@ShawnHymel 4 роки тому
Thanks! Glad to hear it worked for you :)
@techtv1065
@techtv1065 3 роки тому
This channel is so underrated.
@makifbuz
@makifbuz 3 роки тому
Best explanation I have ever seen. Thank you.
@BlueyMcPhluey
@BlueyMcPhluey 2 роки тому
Incredible, I had no idea this was possible
@Andre_Beth
@Andre_Beth 3 роки тому
Well done, and thanks for not dragging it out.
@jontech_Lab
@jontech_Lab 2 роки тому
well explained as usual mr Shawn
@MikePoirier
@MikePoirier 4 роки тому
Great video on WebSockets. Loved it !
@ShawnHymel
@ShawnHymel 4 роки тому
Thanks! Glad you liked it :)
@MrCamdere
@MrCamdere 4 роки тому
wow it looks like easy i will try it thanks for your time ! :)
@evilmode100
@evilmode100 2 роки тому
Very nice guide and at the speed it must be :D
@KC5UNL
@KC5UNL Рік тому
Clear (if a bit fast) description of how to do everything. Do you have an updated version for Arduino 2.0 IDE? The installation of tools doesn't seem to work the same.
@colanuss4985
@colanuss4985 4 роки тому
„A few months ago“ - man, feels more like ages. But as always, great work, clean code. Minor improvement could be made trough the use of a captive portal, which opens directly after connecting to the access point. thumbs up
@ShawnHymel
@ShawnHymel 4 роки тому
LOL, ok, so like, 10 months is perhaps a bit longer than a "few" :P Agreed on captive portal, but I was keeping it simple for the sake of the video. It would make it much nicer to use. And then you could add an initial page in there that lets you attach the ESP32 to your local network :)
@Pr0xy_xx
@Pr0xy_xx 26 днів тому
holy mother of god this video is gold
@cani77
@cani77 Рік тому
Thanks, great video and you code is amazing clear, reusable.
@fvgoya
@fvgoya 4 роки тому
You have great content!!! May I ask Why you take so long time to upload?? Keep this channel live. This is a really good channel!!
@ShawnHymel
@ShawnHymel 4 роки тому
Thanks :) I've been busy with other work, so I haven't had time to make videos. I'll try to post more.
@FPChris
@FPChris 3 роки тому
Thanks for this. I got it working in 2021 with no issues btw. My next question what is the data transfer rate? I've read 10-20 mbps and 4 client max but then saw where it may now be 10 client max.... I guess I need to stress test it next to know for sure.
@vectorsigma9903
@vectorsigma9903 Рік тому
Very useful. Thank you!
@leslymontufar9003
@leslymontufar9003 3 роки тому
Hi, I'm still a beginner and I would like to ask.. To control ESP32 from anywhere, I need to use Firebase or anything like this? Another question is: Is it possible to ask the ssid and password of the user before the connection? Like making it a product and without having to upload the code again.. Is it possible? Thank you in advance! And thank you for doing this great tutorial !
@taylorwhitt3974
@taylorwhitt3974 4 роки тому
Well done.
@johannesremotigue9377
@johannesremotigue9377 7 місяців тому
Nice, very powerful. Thank you/
@rick_er2481
@rick_er2481 2 роки тому
Awesome!!! Thanks Shawn!
@jimswift4718
@jimswift4718 2 місяці тому
Thanks for such a great video. It really helps me understand how this works. I followed your video and used your sketches but I get to the point where my phone renders the web page but the Button for Led is not highlighted so I can not press. Am I missing something? I am using a esp32 cam ai thinker
@theimagequestphotography
@theimagequestphotography 4 роки тому
very nice video, how do you handle multiple led's or buttons? the data returned can't tell what device element is send info?
@MindSlapp
@MindSlapp 3 роки тому
Excellent video
@dansv9778
@dansv9778 3 роки тому
Jesus, so much work for a led
@ShawnHymel
@ShawnHymel 3 роки тому
I'm guessing you haven't seen my "speech recognition" LED demo yet :P
@FlurpBE
@FlurpBE 4 роки тому
Great video, thanks! Apart from not requiring a message broker, what are the advantages of using websockets instead of mqtt messages?
@ShawnHymel
@ShawnHymel 4 роки тому
WebSockets is useful if you want an open connection between two devices, and MQTT offers a publish/subscribe mechanism. For things like sensor data, you would probably want REST or MQTT. If you're looking for fast control (like driving an internet connected robot), something like WebSockets would be better. This is a useful discussion on the differences: iot.stackexchange.com/questions/1492/what-is-the-difference-between-mqtt-and-web-sockets-and-when-should-i-use-them
@gujarisantamanyugmai
@gujarisantamanyugmai 4 роки тому
Thank you. good understanding.
@ShawnHymel
@ShawnHymel 4 роки тому
You're welcome!
@aefeq2
@aefeq2 Рік тому
Nice tuto! Tks!
@BharatMohanty
@BharatMohanty 4 роки тому
After a looooooong time :)
@ShawnHymel
@ShawnHymel 4 роки тому
LOL...I know.... I'm really hoping to do more :P
@Drowe71
@Drowe71 2 роки тому
As someone just starting out and wanting it all, this looks enticing and step by step tutorial how can things go wrong. Well I have a SPIFFS mounting error despite it appearing to work as shown. So as a noob I have no idea how to fix this.
@corvoagc_yt
@corvoagc_yt 3 роки тому
have anyone use the Ionic framework with an IoT project, I am trying to connect an application with the ESP8266 WiFi module and Arduino to be able to manipulate a solenoid to open/close a door with the smarthphone. I am trying to see if this can be feasible, do you have some advices for this beginner ? What modules can I use for this kind of project? It would be so helful
@OneDirectiontoSA
@OneDirectiontoSA 3 роки тому
Great tutorial thank you! I was wondering what to do if I would want to have this be accessible from an external IP? So that it can be accessible for anyone? (its for an artwork) I've got some cameras working and would like to control some servos through a separate esp32 to change the camera perspective
@ShawnHymel
@ShawnHymel 3 роки тому
It is possible. You will need to do "port forwarding" in your router.
@OneDirectiontoSA
@OneDirectiontoSA 3 роки тому
@@ShawnHymel Hi Shawn thanks for the quick reply! Well what I have now is using websockets to direct the camera images to go to a remote IP - but I'm struggling with how to add something like buttons to control other elements. Somehow I need to differentiate from the wroom and the camera.. Any suggestions?
@ShawnHymel
@ShawnHymel 3 роки тому
@@OneDirectiontoSA what do you mean differentiate between the wroom and camera? Are they on separate IP addresses? As for adding more buttons and controls, it should be possible. You'll just need to replicate the code and add specific variables and WebSocket messages for the different buttons, LEDs, etc.
@jacobavilacamacho7644
@jacobavilacamacho7644 4 роки тому
Thank you very much for your video and I would like to ask you if is it possible to implement this kind of access point with Arduino UNO and its Wifi Shield?
@ShawnHymel
@ShawnHymel 4 роки тому
Maybe...I think the UNO would run out of memory, though.
@4122inc
@4122inc 3 роки тому
Great tutorial! I'm getting a "Error mounting SPIFFS" in the Serial Monitor window. Any advice on what I may be doing wrong? (sketch compiles and uploads to the ESP32 just fine--all libraries installed)
@ShawnHymel
@ShawnHymel 3 роки тому
I haven't seen that one, so I'm not sure. Here are a few threads that are worth checking out that talk about that issue: github.com/espressif/arduino-esp32/issues/638 and github.com/me-no-dev/arduino-esp32fs-plugin/issues/8
@eduardomurphyperez717
@eduardomurphyperez717 11 місяців тому
from OP's reply, what it worked for me was changing this line (located in line 122) "if !SPIFFS.begin()){" to this: "if( !SPIFFS.begin(true)){" So, just add true between the parenthesis, and upload it again, and run it (reset button) at least twice (mine was giving me an error on the first try)
@samsulbahridapurwebsite
@samsulbahridapurwebsite 3 роки тому
great tutorial.. but this tutorial can run with esp 8266?
@woolfy02
@woolfy02 Рік тому
I want to run a nodemcu with a servo. Is it possible to to have it connected to my wifi, and connect to it using my cell network?
@scxry5597
@scxry5597 3 роки тому
I have a very important question could you run php on there? It doenst seem so...
@nrdesign1991
@nrdesign1991 4 роки тому
Thanks!
@kimacable
@kimacable 3 роки тому
great video but why such brakeneck speed?
@larsmller4439
@larsmller4439 3 роки тому
Hi Shawn, Super video, a big help thanks. I have a question about using static IP on the ESP32, I tried to implement it, but the ESP32 keeps giving me an exception, can you help? Regards Lars
@ShawnHymel
@ShawnHymel 3 роки тому
I've not tried it with the ESP32 as the access point / host, but you may want to start here: randomnerdtutorials.com/esp32-static-fixed-ip-address-arduino-ide/
@longngo2418
@longngo2418 4 роки тому
Thanks bro for exciting video, i am studying to control many lights by Webserver. But i want to control each light by one esp8266. can you help me, get to me some advice to resolve this problem? Big thanks Bro
@ikrammohamdi4439
@ikrammohamdi4439 2 місяці тому
How do I adjust the LED ignition times?
@devendrarathod7345
@devendrarathod7345 2 місяці тому
hey, my esp32 is connected to weight scale(weight scale like we see at market) okay and i want to said this weight data to a server . how to do this plzzzz help
@panagiotiskondilis5068
@panagiotiskondilis5068 Рік тому
how can i publish esp webserver, public? How can i access the server through internet , without port forward ??
@andreaceccarelli6897
@andreaceccarelli6897 4 роки тому
Hello A beautiful video, it took me a lot to understand the use of the webSocket, I modified your code, to use a local network without using SoftAP (). I wanted to know why, from the local network it works very well, but although I opened the doors in the router, it does not work remotely. I also tried to change the server port, but still it is not open from outside. It would seem a problem of the library, have you done some tests also from outside? I thank you in advance for your kindness.
@thomas5477
@thomas5477 4 роки тому
Have you forwarded the server port in your router to the ESP8266? And then, of course, you have to know your public IP (which changes very often), this you can find using www.whatismyip.com So you either need a static IP (which you won't get for little money), or you use a service like www.noip.com/remote-access
@andreaceccarelli6897
@andreaceccarelli6897 4 роки тому
@@thomas5477 the problem is Fastweb router. Thare are problem with forwardet port. I have reset router and now its ok.
@ideafija
@ideafija 3 роки тому
@@andreaceccarelli6897 Hi Andrea, I'm trying to do the same, but I still can't get it to work locally (on the same network), can you tell me what changes you made?
@rameshnag20
@rameshnag20 4 роки тому
Thanks! Although I tried to use the program without the esp32 connected to a laptop (5v battery source) but then I can't find the Wifi AP listing on any devices now. The program only works when the esp32 is connected to the laptop. Is there any way to fix this?
@ShawnHymel
@ShawnHymel 4 роки тому
What kind of 5V battery? If it's one of those "phone charger" batteries, many of those have built-in circuitry to automatically turn off of not enough current is being drawn (and often, the ESP32 does not pull enough current compared to a smartphone). Try with other batteries or a regular LiPo if you have one.
@jenishthumar1904
@jenishthumar1904 3 роки тому
Awesome video, can you please suggest logic to read multiple led status when button pressed. I'm making project to operate 10 device so when any switch pressed or when I refresh browser I wan to read status of all leds. Please suggest any logic you have that would be very helpful.
@ShawnHymel
@ShawnHymel 3 роки тому
You'll need to make the strings that you send back and forth between the browser and ESP32 more complex to include an identifier for the LED or button.
@jenishthumar1904
@jenishthumar1904 3 роки тому
@@ShawnHymel thanks for the reply, I'm converting state of every led in decimal value and in java script side decoding that value and checking every bit if it is 0 or 1 and changing colour accordingly. If you find any efficient way please reply.
@ShawnHymel
@ShawnHymel 3 роки тому
@@jenishthumar1904 Not that I can think of right now. If you're encoding them as individual bits, that's about as efficient as you can get :)
@jenishthumar1904
@jenishthumar1904 3 роки тому
Can you make video on how to set internal RTC of esp using Arduino ide. And accuracy of that RTC in normal condition.
@ShawnHymel
@ShawnHymel 3 роки тому
@@jenishthumar1904 I don't have plans to work with the RTC at this time, but good to know there's interest!
@kebabsharif9627
@kebabsharif9627 Рік тому
How to make esp32 accessable from anywhere ,can you make a tutorial on that please.
@cristianchuquitarco3794
@cristianchuquitarco3794 Рік тому
Good video, error in "const char", why?
@kevinpallado9638
@kevinpallado9638 4 роки тому
Hi, I would like to ask the way around. How about create a node websocket server and client, and esp32 as an endpoint just to send data to server. Is that possible?
@ShawnHymel
@ShawnHymel 4 роки тому
Yes, it is possible. You would want to use the HTTP client library with the a websocket client. Something like this would be a good start: www.google.com/amp/s/techtutorialsx.com/2017/11/01/esp32-arduino-websocket-client/amp/
@TOMTOM-nh3nl
@TOMTOM-nh3nl 4 роки тому
Thank You
@ShawnHymel
@ShawnHymel 4 роки тому
You're welcome...glad it helped!
@SparQz
@SparQz 2 роки тому
Could I use this to send pwm signals to a dimmable led driver and make a slider on the page? Sorry I'm new to esp 32 and not sure how much it's capable of.
@ShawnHymel
@ShawnHymel 2 роки тому
Good question! You should be able to do that. You can send a number (say, 0 to 100) as the percentage of brightness to the ESP32 from the webpage and then update the PWM signal accordingly. I don't know a simple slider in HTML/JS, but this might be a good start: www.w3schools.com/howto/howto_js_rangeslider.asp.
@turkuas23626
@turkuas23626 2 роки тому
why not using a standart web server and ajax?
@mikejones-vd3fg
@mikejones-vd3fg 9 місяців тому
"call back function called init, in it we ... " lol
@ideafija
@ideafija 3 роки тому
Thank you very much, it works perfectly for me, as it appears in the video, however I am trying to modify it so that it works for me on the same network and does not create a new one, I have tried different ways but the communication between me is cut off the page and arduino, why is this happening?
@ShawnHymel
@ShawnHymel 3 роки тому
Not sure what's causing the connection to drop. Can you get this example to work (it doesn't use a soft AP)? ukposts.info/have/v-deo/kpKJYaJoe6Jlr2g.html
@diegomestrecam7674
@diegomestrecam7674 3 роки тому
Hi. I havent modify your code, but when I open the web page, nothing shows up. I already uploaded the SPIFFS page to the ESP32. What can be the problem?
@ShawnHymel
@ShawnHymel 3 роки тому
Are you getting any info from the serial monitor? Did you make sure that your phone/computer is attached to the ESP32's WiFi network (and not connected to other networks)?
@capitanschetttino8745
@capitanschetttino8745 11 місяців тому
Hey! nice to meet you! Liked and susbribed!!
@erico7222
@erico7222 4 роки тому
I want to learn more JS applied on esp32. Is there any documentation regarding this? Thanks to this very informative video.
@ShawnHymel
@ShawnHymel 4 роки тому
Please note that JS is not running on the ESP32. The ESP32 is just serving up a web page that contains JS elements, so in practice (almost) anything you can do in JS for websites, you can do here.
@erico7222
@erico7222 4 роки тому
@@ShawnHymel can I also apply SASS on the web server?
@ShawnHymel
@ShawnHymel 4 роки тому
@@erico7222 I'm not familiar with SASS....so, maybe?
@erico7222
@erico7222 4 роки тому
sir do have documentation regarding esp32 on how to code on it?
@ShawnHymel
@ShawnHymel 4 роки тому
@@erico7222 Here is getting started with the ESP32 using Arduino: randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/ and here is the official ESP32 documentation: docs.espressif.com/projects/esp-idf/en/latest/esp32/
@nanditibroniassopi9521
@nanditibroniassopi9521 4 роки тому
I want to ask, I think this is a stupid question. can this be accessed from anywhere? or only the local server
@ShawnHymel
@ShawnHymel 4 роки тому
It's not a stupid question :) Right now, it's configured to be accessed locally: only things within range of the ESP32's WiFI can access it. However, if you add a router and configure the ESP32 to access the router as a client instead, you could easily broadcast the page to the wider Internet.
@nanditibroniassopi9521
@nanditibroniassopi9521 4 роки тому
@@ShawnHymel thanks brother
@psd4942
@psd4942 3 роки тому
Respected *Shawn Hymel* sir, I am a student, and literally the way you have teached electricity and electromagnetism is infinite wonderful!❤️ You have given us knowledge in the best way which nobody has ever given to us! In india , teachers don't teach us correctly, they just make. Us gulp the text written in the book. I request you teacher Shawn hymel that please try to teach us more physics like that you did in past(electricity, electromagnetism) I know making more such videos will take a lot of effort! But please try to help, Hope you will reply sir🙏🙏🙏👍❤️😁
@drakkorvladimir4012
@drakkorvladimir4012 4 роки тому
I have done everything correct with the ESP32FS and tool folders but I do not see the uploader in my Arduino IDE???
@ShawnHymel
@ShawnHymel 4 роки тому
Try restarting the IDE and making sure you have some ESP32 version selected as your board. What version of the IDE are you using?
@drakkorvladimir4012
@drakkorvladimir4012 4 роки тому
@@ShawnHymel Did that several times. 1.8.5. Now the libraries have newer names so I am getting compile errors like: WebSocketsServer.h: No such file or directory I think the one I got from your link is named AsynWebSocket.h I used the arduino code from your website so I guess I'll have to change the include names. That is one thing I hate about Arduino and librarie updates
@rx6910
@rx6910 3 роки тому
If I have a 4G module paired with ESP32, how can I share the 4G internet using ESP32 hotspot? So it's not only a web server without internet connection.
@ShawnHymel
@ShawnHymel 3 роки тому
If it's 4G router, you'll likely need to use the ESP32 in client mode (instead of AP mode, which I believe I show in the video). Then, connect the ESP32 to the 4G router, and it should be connected to the Internet.
@MuhammadBilal-eb6fh
@MuhammadBilal-eb6fh 4 роки тому
Can we run videos on Arduino by using ESP32 module without or with Wifi?
@ShawnHymel
@ShawnHymel 4 роки тому
The ESP32 is still probably too slow to run decent video. If you did a very small resolution (640x480?) and a low framerate (less than 10 fps?), you might be able to get something.
@MuhammadBilal-eb6fh
@MuhammadBilal-eb6fh 4 роки тому
@@ShawnHymel Thanks.. Can you please guide me how i can run video on Arduino with resolution of (640x480)..
@ShawnHymel
@ShawnHymel 4 роки тому
@@MuhammadBilal-eb6fh I won't be able to show you, but I can point you to another tutorial that might. What kind of screen do you have? For most of these microcontrollers, you're limited to SPI based LCD displays, so you'll want to start with a library like this: github.com/adafruit/TFTLCD-Library
@kike_cubero
@kike_cubero 4 роки тому
It would be great if the server and the client could connect to a local Wi-Fi network with internet access, and the Arduino will continue to act as a server in that local network.
@ShawnHymel
@ShawnHymel 4 роки тому
You can do this, but instead of running WiFi.softAPIP() (WiFi access point), you would want to have the WiFi library connect to a local access point as a client (as shown in this example: github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiClient/WiFiClient.ino). From there, you could still run the WebServer and WebSocketServer code to respond to requests on your local network.
@kike_cubero
@kike_cubero 4 роки тому
@@ShawnHymel That's cool, thx!
@drakkorvladimir4012
@drakkorvladimir4012 4 роки тому
OK, Newer zip has a .java file which does not work. Older zip has the .jar file and it works.
@hopi9927
@hopi9927 2 роки тому
Dear , Can you remake the project with micropython ?
@tomtom0904
@tomtom0904 2 роки тому
August!
@rockleejj123
@rockleejj123 3 роки тому
Beginner, when I tried arduino uno : that is simple, let's go next. When I tried ESP32: what the fuck I am doing ....
@martinmacko7297
@martinmacko7297 3 роки тому
Hi, could you help me please? I have ESP32 with web server but it always disconnects from wifi in cca 2-3 days. I do not know what to check. All work fine but after 2-3 days disconnected. Thx!
@ShawnHymel
@ShawnHymel 3 роки тому
That may be your router requiring a reconnect after a while for all devices. Your best bet would be to put some code inside the loop of the ESP32 to check for a connection, and if it doesn't see one, try to reconnect.
@martinmacko7297
@martinmacko7297 3 роки тому
@@ShawnHymel hi thanks a lot for reply! I am desperate... I had implemented pings from the server which pings or access http of esp32 periodically but did not help.... you think I need communucTion other way around? From esp out?
@ShawnHymel
@ShawnHymel 3 роки тому
@@martinmacko7297 Yes, I would test to see if the ESP is still connected to WiFi from within the ESP. If it's not connected, re-run the WiFi connection sequence.
@martinmacko7297
@martinmacko7297 3 роки тому
@@ShawnHymel can I ask you for som example or hint how to do it? I am not that good in coding. Many thanks!
@ShawnHymel
@ShawnHymel 3 роки тому
@@martinmacko7297 I forgot this was using softAP, so there's no router involved. I haven't done anything with handling disconnects with softAP, so I don't have any examples for you. Some tutorials like this one might be useful: techtutorialsx.com/2019/09/22/esp32-soft-ap-station-disconnected-event/
@drakkorvladimir4012
@drakkorvladimir4012 4 роки тому
EVerything working now except that ip address that populates all by itself..192.68.4.1 Not even my network? Why does this address keep coming up? Any help?
@ShawnHymel
@ShawnHymel 4 роки тому
192.168.4.1 is the default IP set by the ESP32 when running in SoftAP mode. To change it, you'll need to use the softAPConfig method. See this example on how to do that: github.com/espressif/arduino-esp32/issues/985#issuecomment-360293942
@fouzaialaa7962
@fouzaialaa7962 3 роки тому
can i put esp to sleep and still use the websocket ?? my project need to be asleep when not receiving data !!!
@ShawnHymel
@ShawnHymel 3 роки тому
I'm not an expert on the ESP32, but I don't think you can put the processor to sleep, as it will shut off the WiFi. If you want to sleep in between received packets, you might want to loop at using basic TCP instead of WebSockets. Otherwise, you'll have to re-establish a WebSocket connection each time you wake up.
@fouzaialaa7962
@fouzaialaa7962 3 роки тому
@@ShawnHymel my problem is the node is controlling a relay and the web server is the one that need to send the signal to open or close the relay ....i dont know the exact time i need to wake up .....the other solution is :since im already controlling a mains voltage device i can just tap into the mains and just keep the ESP always plugged in using a phone charger or something..... being on battery is cool but it cant be helped
@ShawnHymel
@ShawnHymel 3 роки тому
@@fouzaialaa7962 you could have the ESP32 wake up at various intervals to check if the server has a variable set that tells it to flip the relay. I don't think you can wake up from a WiFi packet. Here is a good article on sleeping with the ESP32: www.google.com/amp/s/lastminuteengineers.com/esp32-deep-sleep-wakeup-sources/amp/
@rahmanisa899
@rahmanisa899 3 роки тому
Great Video. Strange! in my phone, neither the ssid nor the password are shown. The phone only show "ESP_FDFAA5". It can connect without password and works well
@ShawnHymel
@ShawnHymel 3 роки тому
Hmm...that is odd. I haven't encountered that before.
@diegomestrecam7674
@diegomestrecam7674 3 роки тому
That happened to me. the password needs to be at least 9 characters long, mybe that hellps
@rahmanisa899
@rahmanisa899 3 роки тому
@@diegomestrecam7674 thank you
@adaminsanoff
@adaminsanoff Рік тому
Why not just use binary communication?
@nektarioskourakis8331
@nektarioskourakis8331 4 роки тому
control lights or led from anywhere in the world ???
@ShawnHymel
@ShawnHymel 4 роки тому
Pretty much :)
@user-rg1jp2us4o
@user-rg1jp2us4o 4 роки тому
@@ShawnHymel Um no, Well it needs a static ip to do that. It only works when connected to the local network.
@ShawnHymel
@ShawnHymel 4 роки тому
@@user-rg1jp2us4o if you port forward on your router, you should be able to control it from outside your local network
@WndSks
@WndSks Рік тому
You can probably set a scale value of 1 in a meta viewport tag to fix the zoom issue on phones. Blame Apple for this.
@pinyinxingming1821
@pinyinxingming1821 4 роки тому
please can you do a tutorial that can teach us this from beginingn to end
@ShawnHymel
@ShawnHymel 4 роки тому
This should be a beginning to end tutorial (although I do move a little quickly through the code). I recommend checking out my previous video to get familiar with using WebSockets on the ESP32: ukposts.info/have/v-deo/kpKJYaJoe6Jlr2g.html
@ferijalll
@ferijalll 4 роки тому
why my project is "error mounting SPIFFS"???
@ShawnHymel
@ShawnHymel 4 роки тому
I'm not sure. It could be a different ESP32 version. Check the versions of Arduino IDE, ESP32 libraries, and SPIFFS libraries. Certain versions of those may cause problems. You also may want to try erasing the flash: github.com/probonopd/WirelessPrinting/issues/106
@drumlightable
@drumlightable 4 роки тому
I was getting this error but running the SPIFFS_Test example sketch fixed things (I think by formatting the spiffs) and is essentially what the final comment in Shawn's link recommends.
@peterkortvel
@peterkortvel 4 роки тому
I had the same issue... it started working after a few reuploads
@md.fakweruddinmazumder9063
@md.fakweruddinmazumder9063 2 роки тому
Thank You sir
@drakkorvladimir4012
@drakkorvladimir4012 4 роки тому
I guess that nobody can help me assign a STATIC ip address to this?
@jonathandias3403
@jonathandias3403 3 роки тому
is this the guy at sparkfun?
@ShawnHymel
@ShawnHymel 3 роки тому
I was the guy at SparkFun ;)
@JadeclonOfficial
@JadeclonOfficial 2 роки тому
Great video, but too fast
@daemdotosowolo952
@daemdotosowolo952 3 дні тому
Response is slow... 😮
@14brandon14111
@14brandon14111 2 роки тому
Tbh the way you explain things makes it too complicated.. would prefer simplified explanations as the drawn out explanation can be very confusing when trying to learn new things..
@chant2012
@chant2012 5 місяців тому
arduino sucks
ESP32 Web page creating and updating
32:11
Kris Kasprzak
Переглядів 131 тис.
ESP32: Webserver, Websockets and JSON (WiFi Part 2) - Arduino
35:17
MoThunderz
Переглядів 72 тис.
Парковка Пошла Не По Плану 😨
00:12
Глеб Рандалайнен
Переглядів 12 млн
[Arabic] Implement Functions With C++ #09 - Parse Integer
8:29
Elzero Web School
Переглядів 1 тис.
How to Make an Arduino WebSocket Server with an ESP32
5:58
Shawn Hymel
Переглядів 61 тис.
The Cheapest Microcontroller? Getting started with the 10 cent Puya PY32.
21:36
Zach of All Trades
Переглядів 27 тис.
Build an ESP32 Web Server with Arduino IDE
8:13
Rui Santos
Переглядів 243 тис.
ESP32/ESP8266 Plot Sensor Readings in Real Time Charts - Web Server
3:55
WEBSOCKETS WITH ESP32 - REAL TIME CONTROL
13:19
Jadsa Tech
Переглядів 19 тис.
12 Useful & Interesting ESP32 Projects for Beginners!
9:41
ToP Projects Compilation
Переглядів 563 тис.
How to add WiFi Control to any project || ESP32 Beginner's Guide
10:44
The Worst Product I've Ever Reviewed... For Now
25:04
Marques Brownlee
Переглядів 7 млн
Broken Flex Repair #technology #mobilerepair
0:55
ideal institute aligarh
Переглядів 15 млн
Как должен стоять ПК?
1:00
CompShop Shorts
Переглядів 489 тис.
Как открыть дверь в Jaecoo J8? Удобно?🤔😊
0:27
Суворкин Сергей
Переглядів 799 тис.