good night Tomasz I'm in Sao Paulo, Brazil. Trying to learn a little automation, your video was the first one I was able to watch and I was able to understand and also verify by the presentation of the screens that I am at least with the correct abiente, I will continue to follow your videos, Thank you very much.
Thanks so much for another excellent video. I love the detail you go into. Just like in the beginning how you explain you click platform IO icon again to close and make more room on the screen. Anyone else would just click that and I would be left wondering how or why you did that. This is so helpful and most other YT tutorials skim over these details which are critical for someone new. I love your style Tomasz.
Thanks you for your videos, you teach very well, keep it up!!! I am from Mexico and my English is not good but your way of explaining and speaking are perfect, thanks to you I learn about ESP32 and English
I like VSC and i hate the Arduino IDE, but the Arduino platform is really good for non commercial projects at home. VSC and the PlatformIO was exactly what i was looking for! Your explanations are easy step by step. Additionally the source code you have shown is able to be used directly in projects! Thank you so much! If someone is interested in my home project: I replaced the relay-based swimming pool control with a Siemens Logo. It was clear that with the water temperature the running time of the filter pump is automatically adjusted. Then also an outdoor temperature sensor was installed and i knew, that i need a HMI. At first i wanted to take a Raspberry Pi and PyQt because i have experience and with the Qt Designer i'm really fast and the python-snap7 for communicating with the logo works fine! But then i wanted a compact HMI with a small display and the indoor temperature and humidity should be measured with a BME280. So the ESP32 with the Arduino platform and Settimino to communicate with the logo should be the better option for this project!
I am just about to try a ESP32 wifi board and this video was very helpful. I use VSC and PlatformIO, so it was directly relevant for me. Thanks for your work and I subscribed to your channel.
Thank you Tomasz for your amazing tutorial! It's long, but it is strait forward, its working and it is easy to follow. I learn from you to use VS and lot more! Thank you!! 👍👍
to minimise the connection time: 1- assign static IP 2- use static channel 3- change delay to 20ms I am getting in average 200ms to get connected (since boot) with these settings - crucial for battery operated devices that go to sleep
Great tutorial. I have an ESP32-WROOM-32E board, but I didn't find it in platformIO. I choosed the WROVER, but I haven' any LED too. The HelloWorld project worked, but here my ESP can not connect to my WIFI. It says "...run(): no matching wifi found", but the modem is 2 meters away.
Hi Zandan, Blocking means it won't execute any code that you placed past WiFi connection code in the setup function and the code in the loop function until it successfully connects to WiFi - we can call it synchronous way of connecting. Non-blocking is asynchronous which means it will execute all the code in the setup and then it'll keep calling the loop function continuously so you can run other operations while ESP32 is connecting to WiFi Order of execution for blocking approach: 1. Call the code before while (wifiMulti.run() != WL_CONNECTED) { ... }) 2. Connect to WiFi and do only this. If it doesn't manage to connect keep trying don't do anything else. 3. Call the rest of the code in the setup() 4. Call the code in the loop() continuously for non-blocking: 1. Call the code in the setup(), start connecting to WiFi in the background 2. Call the code in the loop() continuously regardless whether ESP32 manages to connect or not
Hi Katrina, in general I'd recommend non-blocking approach since you can run other operations simultaneously although if you run on battery you need to remember about adding some sort of timeout to your code after which ESP32 powers off if still not connected to WiFi main advantage of the blocking approach is simplicity - it's easier to keep track of synchronous code :)
Hey Tomasz, this is an excellent tutorial. I have been looking for something like this for months. Can you do a tutorial incorporating Javascript into this code. GREAT WORK EXPLAINING!
Hey João, the reason is the way ESP32 has been designed - it now requires a button pressed to enter the BOOT mode whereas on ESP8266 it enters that mode automatically. You can solder/connect a capacitor to ESP32 to not have to press the BOOT button - it's explained here: randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/
Mam pytanie. Czy warunke w void setup jest nadrzędne, względem void loop? Czy dobrze zrozumiałem, że void loop nie było wykonane, dopóki pętla while, w void setup nie została wykonana?
hey, tak dokładnie, żeby funkcja "loop" została wykonana wszystkie instrukcje w funkcji "setup" muszą być najpierw wykonane - w przypadku pierwszego sposobu jeżeli połączenie nie zostanie nawiązane to instrukcje w "loop" się nigdy nie odpalą
Very Nice. Thanks for posting. How scalable do you think this might be for a consumer product that might sell thousands or tens of thousands of units? It seems this implementation is really more for home hobbyists and Maker projects. No?
Thank you🙏 . Very good question. I would say it depends on the product that you're building - I can imagine applying the Arduino framework in a consumer product given the code is properly tested and there are good quality insurance procedures in place (especially in highly competitive industries when the speed of development and rapid prototyping are important). However, if you need good task prioritization where time plays a critical role I'd suggest going for real-time operating system like FreeRTOS.
@@tomasztarnowski4434 Thanks Tomasz! Can the Arduino framework be embedded in a custom design of thousands, real? Have you heard of anyone doing this at scale?
There's lots of discussion about it around the internet but yes I think it can be. Have a look at this post on reddit: www.reddit.com/r/arduino/comments/iqrszs/using_arduino_framework_to_create_an/
Trying to get setup in VS and I am struggling with libraries. I get an error for "#include " that the file does not exist. I don't get how you just had it? I have had this issue with another tutorial as well, is there a mega pack of libraries I need to install somewhere?
ChatGPT helped me out here. I have an ESP8266 and in order to get it working I needed to add the appropriate lib_deps into the platformio.ini configuration file. So I added " lib_deps = ESP8266WiFi " - that got then accepted with no errors. Back in the main code I changed the include to "#include " and also corrected the instance: " ESP8266WiFiMulti wifiMulti; ". Then the errors cleared out and compilation was a success. Upload worked and connecting worked as well. I tried to search the tutorial again a few times but I think this part is missing from it or maybe in some cases the general "WiFiMulti.h" just works but in special cases you need to know to adjust some things.
I also had the same problem with "WiFi.h" it doesn't just work for me only by including it in the beginning of main. Then I consulted GPT again - it seems ESP8266 works different from ESP32 and I can only use the "ESP8266WiFiMulti.h" library which includes the "WiFi.h" functionality. The more you know.
hello, what do you mean by serial monitor doesn't stop running? does it print out anything? which method of connecting you're trying to apply? blocking or non-blocking?
All my code is Ok. I tried both methods and is not connecting.. Any idea. It says error (6)... It seems to be an interference with the DHT11 temp sensor which is conected to the pin D4. I dont understand why
this might be related to the following issue: stackoverflow.com/questions/65125302/can-you-use-all-the-esp32s-gpio-pins-when-the-wifi-is-working can you try to connect DHT-11 to one of the ADC1 pins?
hey, I've done a quick search and it might be either power source issue (not enough power supplied to the microcontroller) or there's too many devices connected to your network. Have a look at this conversation here: gitter.im/espressif/arduino-esp32?at=5cf7ed58faac64393445739f You can also try to add "WiFi.disconnect();" right before "WiFi.begin(..);"
@@AhmadMehraGohar can you please create new issue here: github.com/ttarnowski/esp32-wifi-connect/issues/new and add detailed description of your problem (please explain all the steps you have done and attach screenshots/error messages) I need more information to help you :)
NEED HELP! I can't get this code running anymore. It worked a couple of times, but now the USB connection always crashes, even when I'm trying your simple examples. I figured out that it always crashes on the wifiMulti.addAP or WiFi.begin commands. When it crashes, the red LED on the ESP32 is flickering/dimming, and the USB symbol (I'm on Windows 10) in the taskbar is also flickering really fast. I tried reinstalling the USB driver a couple of times and tried different USB cables and USB ports. I also connected my ESP32 to a USB charger (because I read there may not be enough power through the USB port). Additionally, I tried changing the Wi-Fi mode via "WiFi.mode(WIFI_MODE_STA);" and changed the flash mode via "board_build.f_flash_mode = dio", but nothing worked. During several tries, I also had to factory reset a couple of times via "python -m esptool --chip esp32 erase_flash" because I couldn't upload any code anymore since the port couldn't be found by VSC. When I'm not calling the Wi-Fi commands mentioned above, the code runs just fine. Can someone please help me?
instead of have the "connected" message i have that message : [WIFI] no matching wifi found! what's the problem ? there is the code i'm compiling : #include #include #define WIFI_SSID "mywifi" #define WIFI_PASSWORD "1234567890" WiFiMulti wifiMulti; void setup() { Serial.begin(921600); pinMode(LED_BUILTIN,OUTPUT); wifiMulti.addAP(WIFI_SSID,WIFI_PASSWORD); while(wifiMulti.run() != WL_CONNECTED ) { delay(100); } Serial.println("connected"); } void loop() { digitalWrite(LED_BUILTIN, WiFi.status() == WL_CONNECTED); } is it normal ?
One of the most comprehensive ESP tuto available "IN THIS PLANET EARTH". Thanks!
Thank you, Ashok!
keep up with the great work. As i already said in a previous video, one of the most comprehensive ESP tuto available on YT. Thanks!
You're very welcome! 😊
good night Tomasz
I'm in Sao Paulo, Brazil. Trying to learn a little automation, your video was the first one I was able to watch and I was able to understand and also verify by the presentation of the screens that I am at least with the correct abiente, I will continue to follow your videos, Thank you very much.
Oí Marcelo👋
I'm glad my video was helpful 🙂
Great video! I like how you explain what you’re doing in the code in plain english
Thanks so much for another excellent video. I love the detail you go into. Just like in the beginning how you explain you click platform IO icon again to close and make more room on the screen. Anyone else would just click that and I would be left wondering how or why you did that. This is so helpful and most other YT tutorials skim over these details which are critical for someone new. I love your style Tomasz.
Thank you, David!
Thanks you for your videos, you teach very well, keep it up!!!
I am from Mexico and my English is not good but your way of explaining and speaking are perfect, thanks to you I learn about ESP32 and English
I'm happy to hear that Jose :)
I like VSC and i hate the Arduino IDE, but the Arduino platform is really good for non commercial projects at home. VSC and the PlatformIO was exactly what i was looking for! Your explanations are easy step by step. Additionally the source code you have shown is able to be used directly in projects! Thank you so much!
If someone is interested in my home project:
I replaced the relay-based swimming pool control with a Siemens Logo. It was clear that with the water temperature the running time of the filter pump is automatically adjusted. Then also an outdoor temperature sensor was installed and i knew, that i need a HMI.
At first i wanted to take a Raspberry Pi and PyQt because i have experience and with the Qt Designer i'm really fast and the python-snap7 for communicating with the logo works fine! But then i wanted a compact HMI with a small display and the indoor temperature and humidity should be measured with a BME280. So the ESP32 with the Arduino platform and Settimino to communicate with the logo should be the better option for this project!
I am just about to try a ESP32 wifi board and this video was very helpful. I use VSC and PlatformIO, so it was directly relevant for me. Thanks for your work and I subscribed to your channel.
Thank you, Bob. I'm glad it helped!
Well explained and delivered excellently, looking for learning C# for my nephew.. and you are far most a great teacher!
Thank you Tomasz for your amazing tutorial! It's long, but it is strait forward, its working and it is easy to follow. I learn from you to use VS and lot more! Thank you!! 👍👍
Thank you very much for this video, I now have a clear path for future wifi projects.
to minimise the connection time:
1- assign static IP
2- use static channel
3- change delay to 20ms
I am getting in average 200ms to get connected (since boot) with these settings - crucial for battery operated devices that go to sleep
this is very useful! Thank you Zygfryd!
Tq... I will follow all your tuts on esp32 and projects around esp32. 👍
Thank you :)
Great tutorial. I have an ESP32-WROOM-32E board, but I didn't find it in platformIO. I choosed the WROVER, but I haven' any LED too.
The HelloWorld project worked, but here my ESP can not connect to my WIFI. It says "...run(): no matching wifi found", but the modem is 2 meters away.
Super Thanks! just a stupid question, what do you mean by Blocking and Non-Blocking .. and which one is the best practice?
I came to the comments with the same question. Which one should I use and why. Which one would be more effective if I'm running off a battery?
Hi Zandan,
Blocking means it won't execute any code that you placed past WiFi connection code in the setup function and the code in the loop function until it successfully connects to WiFi - we can call it synchronous way of connecting.
Non-blocking is asynchronous which means it will execute all the code in the setup and then it'll keep calling the loop function continuously so you can run other operations while ESP32 is connecting to WiFi
Order of execution for blocking approach:
1. Call the code before while (wifiMulti.run() != WL_CONNECTED) { ... })
2. Connect to WiFi and do only this. If it doesn't manage to connect keep trying don't do anything else.
3. Call the rest of the code in the setup()
4. Call the code in the loop() continuously
for non-blocking:
1. Call the code in the setup(), start connecting to WiFi in the background
2. Call the code in the loop() continuously regardless whether ESP32 manages to connect or not
Hi Katrina, in general I'd recommend non-blocking approach since you can run other operations simultaneously although if you run on battery you need to remember about adding some sort of timeout to your code after which ESP32 powers off if still not connected to WiFi
main advantage of the blocking approach is simplicity - it's easier to keep track of synchronous code :)
Thank you so much for this video - it has helped me solve a very frustrating problem!!
Very nice video Tomas. Greetings from Argentina
Gracias!
Hey Tomasz, this is an excellent tutorial. I have been looking for something like this for months. Can you do a tutorial incorporating Javascript into this code. GREAT WORK EXPLAINING!
Thanks, Gary! I'm glad my video helped you. I've got a project on my todo list to use TypeScript/JavaScript to program the board remotely :)
Another great video! This is very useful. Thank you!
Glad it was helpful!
Hello, thanks for the video, helps me alot. Can I make a question? Can you explain why esp8266 we don't need press de boot button and the esp32 need?
Hey João, the reason is the way ESP32 has been designed - it now requires a button pressed to enter the BOOT mode whereas on ESP8266 it enters that mode automatically. You can solder/connect a capacitor to ESP32 to not have to press the BOOT button - it's explained here: randomnerdtutorials.com/solved-failed-to-connect-to-esp32-timed-out-waiting-for-packet-header/
greatings from Germany ... I like your tutorials ... can you make one about reading a ntp server clock and switch a output
hey Markus, thank you. NTP Server Clock Synchronisation is on my list of videos to make :)
Love From INDIA 💌🤟
You're a legend Mate, thanks
Is there any video of yours to connect esp32 with web page like react or html ??
By the way great video
Mam pytanie.
Czy warunke w void setup jest nadrzędne, względem void loop?
Czy dobrze zrozumiałem, że void loop nie było wykonane, dopóki pętla while, w void setup nie została wykonana?
hey,
tak dokładnie, żeby funkcja "loop" została wykonana wszystkie instrukcje w funkcji "setup" muszą być najpierw wykonane - w przypadku pierwszego sposobu jeżeli połączenie nie zostanie nawiązane to instrukcje w "loop" się nigdy nie odpalą
I really enjoy how you explain things. Keep the good work and thanks a lot for sharing with us.
Thank you Mr. Ponzo!
Man, thank you soooooo much! 🎉
Very Nice. Thanks for posting.
How scalable do you think this might be for a consumer product that might sell thousands or tens of thousands of units? It seems this implementation is really more for home hobbyists and Maker projects. No?
Thank you🙏 . Very good question. I would say it depends on the product that you're building - I can imagine applying the Arduino framework in a consumer product given the code is properly tested and there are good quality insurance procedures in place (especially in highly competitive industries when the speed of development and rapid prototyping are important). However, if you need good task prioritization where time plays a critical role I'd suggest going for real-time operating system like FreeRTOS.
@@tomasztarnowski4434 Thanks Tomasz! Can the Arduino framework be embedded in a custom design of thousands, real? Have you heard of anyone doing this at scale?
There's lots of discussion about it around the internet but yes I think it can be. Have a look at this post on reddit: www.reddit.com/r/arduino/comments/iqrszs/using_arduino_framework_to_create_an/
Nice man, tnx
You're welcome, Vedo!
Trying to get setup in VS and I am struggling with libraries. I get an error for "#include " that the file does not exist. I don't get how you just had it? I have had this issue with another tutorial as well, is there a mega pack of libraries I need to install somewhere?
ChatGPT helped me out here. I have an ESP8266 and in order to get it working I needed to add the appropriate lib_deps into the platformio.ini configuration file. So I added " lib_deps = ESP8266WiFi " - that got then accepted with no errors. Back in the main code I changed the include to "#include " and also corrected the instance: " ESP8266WiFiMulti wifiMulti; ". Then the errors cleared out and compilation was a success. Upload worked and connecting worked as well.
I tried to search the tutorial again a few times but I think this part is missing from it or maybe in some cases the general "WiFiMulti.h" just works but in special cases you need to know to adjust some things.
I also had the same problem with "WiFi.h" it doesn't just work for me only by including it in the beginning of main. Then I consulted GPT again - it seems ESP8266 works different from ESP32 and I can only use the "ESP8266WiFiMulti.h" library which includes the "WiFi.h" functionality. The more you know.
Thank you for helpful video!
You're welcome, Robert :)
OK, I don't see my ESP32 WROOM...what can I select that will/Could work in it's place? and where do I get this main.cpp file? Thanks
Dlaczego w metodzie non-blocked nie korzystasz z funkcji AP?
Pleeeeeeease Upload More Tutorials❤❤❤
Working on it!
Hi how can I receive data via the serial port in the form of bytes and display them on the screen
help me please
Nothing has worked for a week now
hello, the serial monitor doesn't stop running and it doesn't show if wifi connected or it failed, can you give me your advice?
hello, what do you mean by serial monitor doesn't stop running? does it print out anything? which method of connecting you're trying to apply? blocking or non-blocking?
Is it the same for Bluetooth setup
Awesome, thanks!
Well made explanation!
Cześć. Dlaczego nie ma polskich napisów natywnie? :D Pozdro.
very useful thanks💙
Напишу по русски. Спасибо, очень хорошее видео! Очень подробно.
Thanks for the good content!
All my code is Ok. I tried both methods and is not connecting.. Any idea. It says error (6)... It seems to be an interference with the DHT11 temp sensor which is conected to the pin D4. I dont understand why
Does ESP32 connect to WiFi when DHT-11 is disconnected?
@@tomasztarnowski4434 yes
this might be related to the following issue:
stackoverflow.com/questions/65125302/can-you-use-all-the-esp32s-gpio-pins-when-the-wifi-is-working
can you try to connect DHT-11 to one of the ADC1 pins?
Thank You dear
Amazing Thanks you 👏👏
the flag Code mas very useful for me
I use the non-blocking method but it only shows "E (180970) wifi:Set status to INIT"
hey, I've done a quick search and it might be either power source issue (not enough power supplied to the microcontroller) or there's too many devices connected to your network.
Have a look at this conversation here:
gitter.im/espressif/arduino-esp32?at=5cf7ed58faac64393445739f
You can also try to add "WiFi.disconnect();" right before "WiFi.begin(..);"
Creative video, thanks :)
ja tak tylko chce powiedzieć ze Tomek... kurwa... uratowałeś mnie, dzięki za tutorial i na pewno jeszcze wrócę :D
Dzięki, super że mogłem pomóc :)
how do i install this library whats its name
Thanks, nice one
Help plis sir tutorial eyes teeny 4.0 Tft display 1.28inch
my esp32 no cornect internet . because module fail or code ?
Is there a bluetooth step by step tutorial?
Not yet, but I'm going to make one.
@@tomasztarnowski4434 if you make one, I'll name my first son after you!
Will connect ESP32 to WiFi work with Arduino?
Thanks
Dobry program ale stary bardzo przydatna przydała by się poprawka nowej wersji
hi
hello 👋
my visual code arduino runing problem
can you describe the problem?
sweet brother.
visual code arduino not compile and
error
arduino extension..
this extension has repeated (1 uncaught error)
@@AhmadMehraGohar can you please create new issue here: github.com/ttarnowski/esp32-wifi-connect/issues/new
and add detailed description of your problem (please explain all the steps you have done and attach screenshots/error messages) I need more information to help you :)
Странный акцент) Немного на индийский похож, но я так понимаю какой-то славянский язык твой родной?
arduino 🤮🤮🤮🤮🤮🤮🤮🤮🤮🤮🤮🤮
NEED HELP!
I can't get this code running anymore. It worked a couple of times, but now the USB connection always crashes, even when I'm trying your simple examples. I figured out that it always crashes on the wifiMulti.addAP or WiFi.begin commands. When it crashes, the red LED on the ESP32 is flickering/dimming, and the USB symbol (I'm on Windows 10) in the taskbar is also flickering really fast.
I tried reinstalling the USB driver a couple of times and tried different USB cables and USB ports. I also connected my ESP32 to a USB charger (because I read there may not be enough power through the USB port). Additionally, I tried changing the Wi-Fi mode via "WiFi.mode(WIFI_MODE_STA);" and changed the flash mode via "board_build.f_flash_mode = dio", but nothing worked.
During several tries, I also had to factory reset a couple of times via "python -m esptool --chip esp32 erase_flash" because I couldn't upload any code anymore since the port couldn't be found by VSC. When I'm not calling the Wi-Fi commands mentioned above, the code runs just fine.
Can someone please help me?
instead of have the "connected" message i have that message : [WIFI] no matching wifi found!
what's the problem ?
there is the code i'm compiling :
#include
#include
#define WIFI_SSID "mywifi"
#define WIFI_PASSWORD "1234567890"
WiFiMulti wifiMulti;
void setup() {
Serial.begin(921600);
pinMode(LED_BUILTIN,OUTPUT);
wifiMulti.addAP(WIFI_SSID,WIFI_PASSWORD);
while(wifiMulti.run() != WL_CONNECTED )
{
delay(100);
}
Serial.println("connected");
}
void loop() {
digitalWrite(LED_BUILTIN, WiFi.status() == WL_CONNECTED);
}
is it normal ?