ESP32 Access Point and Router connection explained

  Переглядів 41,456

MoThunderz

MoThunderz

День тому

This video will explain how to setup an ESP32 as an Access Point or alternatively how to connect it to a router. The ESP32 used is the ESP32-WROOM-32D.
Code for the simple connection available at:
github.com/mo-thunderz/ESP32A...
Code for JSON example available at:
github.com/mo-thunderz/Esp32W...
Check out my other ESP32 videos as well:
• ESP32 stuff - using Wi...
Thanks for watching :-)

КОМЕНТАРІ: 44
@johnvine5731
@johnvine5731 Місяць тому
That was great. You explain things extremely well. Thanks very much.
@lenreinhart2020
@lenreinhart2020 2 роки тому
I have been working through your videos using an ESP32-C3 using an on-chip 4Meg flash. Even though the C3 is Risk-V, I suspected that company would use the same code, just a different compiler. So far all is working fine. Thank you for this, it has saved me much head scratching. Your explanations are very clear and your code is very well organized. When I tried the Bluetooth videos, no joy, the compiler threw a fit with the ESP32C3 selected, many functions not found. I had hoped they would do like the WiFi, looking in google I see a post saying it only supports BLE, but the API docs show Classic and others. I tried to compile the BLEclient and BLEserver examples and they compiled, so I guess my best bet is to convert over to BLE (I wonder if my phone supports that). Thanks for the WiFi though, it was great.
@mothunderz
@mothunderz 2 роки тому
Thank you very much for the feedback! As for Bluetooth: BLE is actually more energy efficient and by far the better choice if you do not need a large data throughput. The one problem is that it is a bit more difficult to setup. I tried BLE in MIT App inventor, but it did not operate very stable. Might I find a good solution I will post it.
@davidkempton2894
@davidkempton2894 2 роки тому
Thanks very much for these videos. I have always wondered what all the code did in these applications. It is quite complicated but you have explained it well and although I couldnt write it from scratch I think that I could probably hack your code now to make something that I want. Cheers!
@mothunderz
@mothunderz 2 роки тому
You are welcome! Great to hear it is useful for you :-)
@chirurdp3454
@chirurdp3454 5 місяців тому
Thanks. Helped me a lot. ❤
@mothunderz
@mothunderz 3 місяці тому
Thank you very much for your feedback!
@grahamheath3799
@grahamheath3799 3 місяці тому
thanks useful.
@engodhjertetdtu-studerende8007
@engodhjertetdtu-studerende8007 Місяць тому
Great video man! Where did you learn all of this stuff? Do you have a book?
@SPeeDKiLL45
@SPeeDKiLL45 11 місяців тому
Great Great Video man. Thanks!
@mothunderz
@mothunderz 11 місяців тому
You are welcome, thank you for your feedback!
@noweare1
@noweare1 Рік тому
Thanks for this. I had it in my head that to be a server it had to be an access point and as client had to be in sta mode. So it can be a server no matter what mode it is in. But to access the esp32 from outside your lan it would have to be in sta mode. Also, as an access point, the esp32 has to create it own radio signal (wifi) ? I would think that that signal does not go too far so other devices connecting to it would have to be close by ?
@mothunderz
@mothunderz Рік тому
Yes, I think your understanding is correct: If you want to connect the ESP32 to your local network then you need to go for the "router connection". If you want to get a 1-to-1 connection directly on the ESP32 then you need to use it as an access point. As for the strength of the WiFi signal: it is strong enough for communication in the same room, but definitely you wont be able to access the WiFi signal off the ESP32 throughout the whole house. For that connection to your router is the better option.
@mayoortechinnovations
@mayoortechinnovations Рік тому
Thank you so much for this excellent explanation.. it's very helpful.. I was able to use your explanation to convert the default ESP32 Cam Arduino example code onto Access point mode... And it works well on my PC, but once I try connecting with my android phone it keeps connection and disconnecting.. please have you experienced such behaviour.. and what could be the solution.. thanks
@mothunderz
@mothunderz Рік тому
I am not familiar with the ESP32 Cam, but actually I have experienced the same problem with Android Phones disconnecting when I configure the ESP32 as a webserver. The solution for that was to change the order the services were started. In particular I needed to first start the websockets before starting the server with server.begin(); So in other words: I dont think it directly has to do with how the WiFi is configured, but rather the services themselves. Hope this helps...
@paridcati3343
@paridcati3343 2 роки тому
I have a question. Will the fixed ip and ssid and password change after uploading some other code in the esp32?
@mothunderz
@mothunderz 2 роки тому
I am not sure what you mean. Do you mean the left configuration (at the start of the video) where the ESP32 is accessed through a router? Typically, the router will assign the same IP address to the ESP32 if you update the code, however, this will depend on the router. The better solution is to log in into the router, find under WiFi-connections the MAC address of the ESP32 and assign a fixed IP address for the ESP32. That way, the ESP32 will always get the same IP address. If your question is directed to the right side: setting up the ESP32 as an access point -> here you define what the IP, SSID and PW should be in the code itself. Therefore, as long as you dont make changes there, this wont change when uploading new code.
@patonaranjo9394
@patonaranjo9394 4 дні тому
hello Is it possible to connect a cell phone with an App Inventor application and send simultaneous data to two ESP32 modules to control different LEDs on each card? without occupying a router
@irshadirshu0722
@irshadirshu0722 2 роки тому
can you make a video for a solution of esp32 cam wifi connecting issue .please help me . in serial monitor the dought printing continues but not connecting .and some times triggered please make video
@mothunderz
@mothunderz 2 роки тому
My apologies, but I dont really understand the issue you have with your ESP32. If your ESP32 is suffering from a weak WiFi signal, please see the link below. Hope this solves your problem. randomnerdtutorials.com/esp32-cam-troubleshooting-guide/#:~:text=If%20your%20ESP32%2DCAM%20AI,position%20for%20the%20desired%20antenna.
@user-pu1ki7vk9v
@user-pu1ki7vk9v 11 місяців тому
I wanted to thank you for the video but I was wondering if it is possible to communicate with only 1 cliënt instead of a webSocket.broadcastTXT? I want to thank you in advance :)
@mothunderz
@mothunderz 11 місяців тому
Sorry for my late reply, I overlooked your comment. Yes, it is possible to send to a specific client. Instead of broadcastTXT just use: webSocket.sendTXT(clientId, jsonString); Here clientId is a uint8_t that refers to the id of the client you want to communicate with.
@user-pu1ki7vk9v
@user-pu1ki7vk9v 11 місяців тому
@@mothunderz Tanks for the Help🙏
@pepedecoatza
@pepedecoatza Рік тому
would be possible to do something like this with a LAN Cable? i mean internet coming from a wall socket, then via LAN adapter to usb and then to the board in order to make a WIFI Access point from an internet cable access. Thanks
@mothunderz
@mothunderz Рік тому
I am not aware of a driver for the ESP32 to accept LAN through USB. You would need drivers or code for that to make it work.
@pepedecoatza
@pepedecoatza Рік тому
@@mothunderz the esp32-s3 is usb host (otg) capable. So it should accept the lan connection
@mothunderz
@mothunderz Рік тому
I am not familiar with this version of the ESP32. Sounds interesting!
@pepedecoatza
@pepedecoatza Рік тому
@@mothunderz but i think you are right about the LAN adapter drivers. It would be tricky:)
@aleksandarzivkovic1792
@aleksandarzivkovic1792 Рік тому
Thaks for the video, very clear but for me it does not work! The esp loads and prints Ready etc. I have been using the router connection while writing my code. I followed the video and am getting ERR_ADDRESS_UNREACHABLE. I tried changing the IP and gateway still no change. Any ideas?
@mothunderz
@mothunderz Рік тому
Sorry to hear that you are having problems. Can you try to setup the ESP32 as an access point. Does that work? Do you have a second router to test with perhaps? What might also be a good debug method for you is to check with the code of this video if you can see the network: ukposts.info/have/v-deo/aHGddYqjhW9mumQ.html note that the ESP32 does not support 5G or 6G wireless. If the ESP detects the Wifi you can check with the code of this video if you can connect to it: ukposts.info/have/v-deo/aWWJZI2tfpeHyGw.html Hope that you find a solution.
@panxpatel
@panxpatel 4 місяці тому
Hi, I have followed the instructions and the code complied fine and uploaded but I am not able to see the wifi SID on the laptop or the phone. On ESP32, I am able to see red and a blue light constantly on. Am i missing something? thanks in advance.
@mothunderz
@mothunderz 3 місяці тому
What code are you referring to? the Router or the Access Point? What ESP did you upload it on (type number)?
@ahanapal9095
@ahanapal9095 11 місяців тому
I am working on a project where i want to capture an image in ESP32 cam and send it to the server I am providing my local desktop ip address and when I am running that it is showing that the connection failed Can you tell me what is the issue? I don't have any router in my home i use my mobile hotspot for ssid and password
@mothunderz
@mothunderz 11 місяців тому
I dont understand what you mean with that you use your mobile hotspot. The easiest way is to setup the ESP32 as access point and have your local desktop connect to the wifi of the ESP32.
@ThanhNguyen-ub5ee
@ThanhNguyen-ub5ee 6 місяців тому
This is a connection in an internal network created by esp32 and has nothing to do with the Internet or Wifi. So I wonder if you can make a video instructing how to use esp32 to create a DNS domain name so that people do not need to near the esp32 and connected to its internal network. Instead, anywhere as long as there is internet, can you access the Web interface created by the esp32? Thanks.
@mothunderz
@mothunderz 5 місяців тому
I dont recommend to put the ESP32 directly exposed on internet. Please use a Raspberry or something like that with decent security as firewall between the ESP32 and the internet. The ESP32 has only a very simple IP library and I dont think it is very well protected.
@shahbaztech7064
@shahbaztech7064 2 роки тому
I want to make a mobile app which connect to esp32. How I can connect my app to esp32.
@mothunderz
@mothunderz 2 роки тому
There are many ways to connect. For a mobile app, the simplest way to create a bi-directional communication channel is Bluetooth. The advantage of Bluetooth is that you dont need to mess around with IP addresses etc. Another relatively simple method is to use the Access Point connection as shown in this video. You will manually have to connect to the WiFi of the ESP32 and can than access the device at a fixed IP address. Finally, you can of course use the router connection solution of the video. In that case make sure you assign a fix IP address in your router so that you know where to find the ESP.
@PyubX
@PyubX 2 місяці тому
Cna you explain why someone would choose one option instead of the other?
@mothunderz
@mothunderz 23 дні тому
Sure! If you have a Wifi network at home and you want to add an ESP to that, then you take the router connection. The advantage here is that if your phone or computer is connected to that same Wifi network, then you can directly access the ESP. The disadvantage is that it only works when you have reception from the router. If you use the ESP in environments where for instance no router wifi is available or you want to setup a dedicated system outside of home wifi, then the access point implementation is to be used.
@PyubX
@PyubX 23 дні тому
@@mothunderz very nice and concise explanation
@mothunderz
@mothunderz 23 дні тому
You're welcome :-)
@rleogNano33
@rleogNano33 Місяць тому
When does a new season of Scooby Doo come out?
IoT - real time temperature chart in Webbrowser with ESP32 and WiFi
11:08
ESP32: Webserver, Websockets and JSON (WiFi Part 2) - Arduino
35:17
MoThunderz
Переглядів 72 тис.
ДИНАМО - ВЕРЕС. Пряма трансляція. УПЛ. 5 тур
3:25:01
ESP-NOW - Peer to Peer ESP32 Network
43:02
DroneBot Workshop
Переглядів 325 тис.
ESP32 WIFI CONNECTIVITY TUTORIAL: Menuconfig and Code Implementation Explained
24:13
HakByte: Build a Hackable Router with a $5 ESP32
13:16
Hak5
Переглядів 69 тис.
#291 External antennas and ESP32 Long-Range mode
13:57
Andreas Spiess
Переглядів 212 тис.
PlatformIO: All you need to know in 10 Minutes!
10:56
J's e-shack
Переглядів 277 тис.
How to Create a Web Server (with WebSockets) Using an ESP32 in Arduino
12:42
Mysterious AI Robot "Astribot S1" SHOCKS Everyone
16:18
AI Search
Переглядів 25 тис.
WebSockets Explained: Real-Time Communication with ESP8266
6:58