Move the localIP() to a separate print statement (because its not actually a string) Serial.print("WiFi connected "); Serial.println(WiFi.localIP()); The demo works in the video because it never uses this bit of the code, since its already connected.
Good demo. Always good to see examples of FreeRTOS. It helps convert the beginner to a more advanced level. In my case I can't see where breaking out the WiFi check into a thread would have any advantage and maybe has some disadvantages. At the top of my loop() I call an ensureNetworkConnection() and ensureMqttConnection(). That way I know the the connection should be good after those calls. void ensureNetworkConnection(void) { if ( WiFi.status() != WL_CONNECTED ) connectNetwork(); }
Where I did find a separate thread to be very useful was in controlling the color/blink rate of a NeoPixel that I use for status information. The NeoPixel color/blink is set based on an indoor air quality value which I set from the main loop and the NeoPixel control thread uses that to determine what to do. In this case the IAQ getter/setter uses a mutex.
It's a very good video ... but i have another point, i think the best way is to create registers for wifi connection.... when wifi connected we suspend the task (to free resources ...etc) and when the wifi is disconnected we resume our task.... i think it's better than keeping the task running for long time and event the wifi is connected.
One thing to note. There’s 2 ADC’s on the esp32. ADC1 and ADC2. ADC2 cannot be used at the same time as using WiFi as they share resources. I found this out the hard way. Continuous spurious results using that ADC2 and WiFi.
I uploaded and found Guru Meditation Error: Core 0 panic'ed (LoadProhibited)Exception was unhandled, i tried to fix it but not success. Please help me fix it. I am very appreciate that.
@Simply Explained You were using VS Code right? How are you uploading to the board without the Arduino ide? Is there some extension that does this? Thanks
Great video, many thanx. But i have one question. It seems that WiFi.begin() ends an active Wifi AP connection. In my case i want to have the AP of the ESP32 ALWAYS available and only if connection to Router gets lost, reconnect the STATION part. Is this possible or does Wifi.begin() automatically disconnect the active AP?
For some reason my ESP32 does not boot rather it continuously reboots and I do not know why? I have watched the video many times, started over and recreated the code from the video three times and tried multiple ESP32 boards. Oh, and I tried fixing the core to 0 then one with no change. I really want to use this but how do I fix this?
I am having an issue with the wifi: E (3446) wifi:Expected to init 4 rx buffer, actual is 1 What to do in this case? I used xTaskCreatePinnedToCore but it made the whole code slow and it didn't connect to wifi either?
why use 'continue' instead of just going for an if-else approach? you even explained it like this... I think it would be better for readability purposes, but I might be wrong...
Ouuhhh i see. When i try before i see this video, i trying code some blynk connection without xTaskPinnedToCore its will stacked error. So if i put thats syntaks won't it crash again?
Why to use the WiFi Library do i have to run it on the same core of the Arduino library? Is it true for every library that uses the Arduino framework? For instance, if i use, say, an LCD display with a library developed for Arduino, do i have to make sure it works on the same core? How do i know if a library requires me to do this? Will this not be a problem if i have to use a single core everytime i use libraries from the Arduino framework even though my ESP32 has more cores? Is there a way to bypass this limitation? Is the Arduino framework even necessary? Aren't there native libraries for ESP32 that let me use the cores i like?
Ok, late to the party; but copied this on a Seeed Studio and it simply crashes again and again complaining about a StackOverflow. I am not enjoying freeRTOS
Loved your ESP32 FreeRTOS playlist.
Move the localIP() to a separate print statement (because its not actually a string)
Serial.print("WiFi connected ");
Serial.println(WiFi.localIP());
The demo works in the video because it never uses this bit of the code, since its already connected.
Good demo. Always good to see examples of FreeRTOS. It helps convert the beginner to a more advanced level. In my case I can't see where breaking out the WiFi check into a thread would have any advantage and maybe has some disadvantages. At the top of my loop() I call an ensureNetworkConnection() and ensureMqttConnection(). That way I know the the connection should be good after those calls.
void ensureNetworkConnection(void)
{
if ( WiFi.status() != WL_CONNECTED )
connectNetwork();
}
Where I did find a separate thread to be very useful was in controlling the color/blink rate of a NeoPixel that I use for status information. The NeoPixel color/blink is set based on an indoor air quality value which I set from the main loop and the NeoPixel control thread uses that to determine what to do. In this case the IAQ getter/setter uses a mutex.
It's a very good video ... but i have another point, i think the best way is to create registers for wifi connection.... when wifi connected we suspend the task (to free resources ...etc) and when the wifi is disconnected we resume our task.... i think it's better than keeping the task running for long time and event the wifi is connected.
Appreciate it, fantastic. Also thank you for your excellent explanation in an easily understandable manner.
One thing to note. There’s 2 ADC’s on the esp32. ADC1 and ADC2. ADC2 cannot be used at the same time as using WiFi as they share resources. I found this out the hard way. Continuous spurious results using that ADC2 and WiFi.
Bro, You are the king!
Thank you! Super explained and useful!
I uploaded and found Guru Meditation Error: Core 0 panic'ed (LoadProhibited)Exception was unhandled, i tried to fix it but not success. Please help me fix it. I am very appreciate that.
Thanks, great explanation!
This video was great, I subscribe inmediately.
@Simply Explained You were using VS Code right? How are you uploading to the board without the Arduino ide? Is there some extension that does this? Thanks
Yes, PlatformIO. Check the earlier videos in this series on how to set it up ;)
@@simplyexplained Ok, thanks. You have my sub with notifications
Why does'nt it print out "Connected! and the IP address", you did not explain that. it just jumps straight to the "WiFi Still Connected".
Great video, many thanx. But i have one question. It seems that WiFi.begin() ends an active Wifi AP connection. In my case i want to have the AP of the ESP32 ALWAYS available and only if connection to Router gets lost, reconnect the STATION part. Is this possible or does Wifi.begin() automatically disconnect the active AP?
OK, got it: you must do a WiFi.reconnect() then the active AP is not disconnected. Only the STATION is reconnected.
For some reason my ESP32 does not boot rather it continuously reboots and I do not know why? I have watched the video many times, started over and recreated the code from the video three times and tried multiple ESP32 boards. Oh, and I tried fixing the core to 0 then one with no change. I really want to use this but how do I fix this?
I am having an issue with the wifi:
E (3446) wifi:Expected to init 4 rx buffer, actual is 1
What to do in this case? I used xTaskCreatePinnedToCore but it made the whole code slow and it didn't connect to wifi either?
why use 'continue' instead of just going for an if-else approach? you even explained it like this... I think it would be better for readability purposes, but I might be wrong...
Ouuhhh i see. When i try before i see this video, i trying code some blynk connection without xTaskPinnedToCore its will stacked error. So if i put thats syntaks won't it crash again?
Why to use the WiFi Library do i have to run it on the same core of the Arduino library? Is it true for every library that uses the Arduino framework? For instance, if i use, say, an LCD display with a library developed for Arduino, do i have to make sure it works on the same core? How do i know if a library requires me to do this? Will this not be a problem if i have to use a single core everytime i use libraries from the Arduino framework even though my ESP32 has more cores? Is there a way to bypass this limitation? Is the Arduino framework even necessary? Aren't there native libraries for ESP32 that let me use the cores i like?
Is there anywhere to DL the code?
Does anyone else also have problem to get this code running on an esp32-s3? I always get ESP Guru errors.
I also had this problem when connecting to WiFi blynk, do you find any solution on how to solve the guru errors?
The code worked perfectly in my esp32 NODEMCU
Esp idf already has a task that takes care of reconnection.
What if you have multi wifi - home network, mobile hotspot. will esp idf do it
Ok, late to the party; but copied this on a Seeed Studio and it simply crashes again and again complaining about a StackOverflow. I am not enjoying freeRTOS
The example working here is in VSCode with PlatformIO and ESP-IDF.
@@JanDahl PlatformIO and ESP-IDF do the same thing?
@@QAYWSXEDCCXYDSAEWQ You can use ESP-IDF without PlatformIO but not the other way 'round. They're different tools.