switching task consumes tons of cpu time. Instead use 2 task pinned to core 0 and one. Then use core 0 fore ble and wifi operations and the socond core for real world problems. Never use delay function to wait some response. Just check all io at certain faster intervals than use value how fast you need to use. Use state machine waiting for special case. So your code seamlessy works.
great point man. what bugs me about the esp32 is the garbage fp performance if you want to do any type of semi-cool 3d raster stuff. it's been out almost a decade and i find the updates to the silicon to be very lacking considering the price to build them. i'd pay an extra few bucks a board to cover the licensing costs espressif would have to pay to use the more advanced 'open source' riscv features. i figured the second generation pico would solve some this and add more cores but instead they employ 2 different semiconductor architectures on the same board to give the illusion of being better. the raspberry pi company only cares about their corporate customers now though going against their whole mission statement. the 4gb pi4 still costs almost 100 after tax in my province, which is odd considering the pi5 8gb is only 40 dollars more. it always seems to make more sense to buy a sff refurb business pc to me whenever i measure the cost to performance ratio. they all come with ssd's now whichs makes the pi cost double if you factor in the price for the extra stuff you have to buy to add the same thing. the pi still has it's uses though given the size. i love teensy boards but in canada they are quite pricey so I only order them straight from pjrc, amazon sellers try to charge almost 100 beans for the 4.1. i get why though, one person is responsible for it's development basically. apparently a teensy 5 was in the works before the chip shortage years ago but i havent heard anything else about it. Paul Stoffogren has written every second library in the arduino ide it seems as well for even non arm ics too. If i were as talented as Paul, i'd go work for spacex or someshit haha
Merci beaucoup! C'est un excellent vidéo pour un néophyte comme moi! (malgré que c'est plutôt au delà de mes compétences courantes). Je suis suis heureux de voir un créateur Canadien Français sur RUclips! Excellentes explications! Cheers!
salut, merci du super video! Donc a place de prendre input parameters entre task tu passe par une fonction "extern volatile bool gifChangeRequested;" pour dire que bouton est appuyer? Pourquoi pas passer direct par les paramètre de tâches? I also thought writing c inside .h file was not considered good practice.
Thank you for creating such a thoughtful and informative video to share with everyone! This video provides a wealth of valuable information for ESP32 users. In your future video projects, if you have any ideas about Waveshare's other new products, I’ll be more than happy to provide you with the fullest support! 🌟
Thanks ... good explanation. I've been working on a project for several weeks with an ESP32-S3 wemos mini using RTOS tasks and the Arduino framework on vscode. One thing you might mention, because it can be a bit intimidating, is the propensity for the ESP to crash really brutally if you get something wrong. For example, not allocating sufficient RAM to a task, or trying to resume a task that is already running etc. Not much warning or info, kind of like a blue screen. I'm getting used to it, but it took a while.
rtos tasks are not good only for organizing the code better, but, I think their main function is to control the microprocessor's execution threads to avoid overloading the processor with execution data, which will make your code crash if you don't know how to delete and restart the task when the processor queue creates a bottleneck effect. This is required when you get some type of microcontrollers that are not supported and optimized well, but they have got a microprocessor which is strong, fast and dumb in the same time. :))
This is excellent! I never knew about tasks. When I see the structure for the displays, buttons and such, I can see how this will really help me in a project I will be doing soon. I'm still not sure how the code in those tabs are called, but I'll figure it out. LOL Thanks for posting this.
Must get me some circular displays for running that alien eye! Two would look awesome if I can get them to focus onto the same object in my drive next Halloween! Do you have a recommendation?
@hariseldon2577 If you buy the bare displays - very cheap indeed - they are pretty easy to solder to your own custom pcbs and the additional support components are simple and few. Could be a good option for an inexpensive bespoke assembly as well as being a great learning experience.
Amazing Tutorial many thanks, a question how can i define the wifi connection and http rest command in that way, i need read rfid reader too, need be available to read all the time, TY
Think about how you would do it in the standard way (traditional setup and loop functions) and do the same thing inside a task by using the setup part of the task and the loop part of the task.
Is there any difference between placing the `pinMode` command in the default `setup` function and placing it in the `setup` function of the tasks we create, apart from it looking more organized?
the result will be the same, use pinMode in the standard setup function for hardware shared across tasks or critical to the entire system. Use pinMode in the setup part of a task when the pin is exclusive to that task, keeping task logic self-contained and easier to debug.
Can you address the latency? The video makes it look like there is a mandatory latency in the tens of ms when using this. Most visible in the multi-screen example where it looks like they change sequentially with th delay between each.
@@thelastoutpostworkshopthat tracks. So I think I hear you saying that there is no extra latency when using tasks. Is that right? Even on the section with the yellow button it looks like there's latency but it's hard to tell with the high travel distance of those particular buttons. Decided it was best to ask and get the real answers.
@@thelastoutpostworkshop sorry i meant to ask those two separately - ISR is an interrupt service routine, basically a small function that tells the cpu to stop everything else and run it.
I'm back into electronics after 20 years. Please assist me when chosing my first basic ESP32S setup. Amazon UK offer different modules. Any guidance would be most welcome.
Si « Les pistes audio pour certaines langues ont été générées automatiquement » pourquoi l'ai-je entendu en anglais? Comment puis-je écouter en français ? Merci pour ces explications et démonstrations. Très intéressants et ce me sera certainement utile.
Am familiar with rtos, but you don't seem to have included that. Am unclear where the equivalent comes from. Is that your own work? Good explanation of tasks.
Excellent. What about pass variable into tasks from the main loop. For example, read a sensor task 1 elaborate the values in the main loop and display the new value on task 2. I think you get my point. Ps: i installed your ide, is super.
No, it's different, the Arduino Maker Workshop Extension is more for beginners who wants to try Visual Studio Code for the Arduino Framework programming
Yes, in the project I use a volatile global variable that is shared between two tasks. A volatile global variable can be used between two tasks because it ensures that the compiler does not optimize away accesses to the variable.
And the real nightmare starts when you try to consume variables attached to core 0 by accessing it from core 1. You will need a semaphore and a lot of hacks to make that work.
switching task consumes tons of cpu time. Instead use 2 task pinned to core 0 and one. Then use core 0 fore ble and wifi operations and the socond core for real world problems. Never use delay function to wait some response. Just check all io at certain faster intervals than use value how fast you need to use. Use state machine waiting for special case. So your code seamlessy works.
great point man. what bugs me about the esp32 is the garbage fp performance if you want to do any type of semi-cool 3d raster stuff. it's been out almost a decade and i find the updates to the silicon to be very lacking considering the price to build them. i'd pay an extra few bucks a board to cover the licensing costs espressif would have to pay to use the more advanced 'open source' riscv features.
i figured the second generation pico would solve some this and add more cores but instead they employ 2 different semiconductor architectures on the same board to give the illusion of being better. the raspberry pi company only cares about their corporate customers now though going against their whole mission statement. the 4gb pi4 still costs almost 100 after tax in my province, which is odd considering the pi5 8gb is only 40 dollars more. it always seems to make more sense to buy a sff refurb business pc to me whenever i measure the cost to performance ratio. they all come with ssd's now whichs makes the pi cost double if you factor in the price for the extra stuff you have to buy to add the same thing. the pi still has it's uses though given the size.
i love teensy boards but in canada they are quite pricey so I only order them straight from pjrc, amazon sellers try to charge almost 100 beans for the 4.1. i get why though, one person is responsible for it's development basically. apparently a teensy 5 was in the works before the chip shortage years ago but i havent heard anything else about it. Paul Stoffogren has written every second library in the arduino ide it seems as well for even non arm ics too. If i were as talented as Paul, i'd go work for spacex or someshit haha
is this better options: vTaskDelay()? or millis()?
@@dasig3010vTaskDelay is the same as delay as delay calls vTaskDelay. Only it does some calculation so its actually that many miliseconds long
So far the best explanation of esp32 cores!!! Thanks so much to provide this kind of information for free!!!
this changed my week in a meaningful way ~chuckles~ heck it is January. understanding this information has brightened my whole year
Thank you for this video ... it makes me realize that RTOS is an incredible gamechanger!
Wow! This will be helpful in some of my projects with multiple tasks being run together. Thank you for your explanation and the code example.
Loved the concept! That's pretty useful. Impecable video as usual.
Merci beaucoup! C'est un excellent vidéo pour un néophyte comme moi! (malgré que c'est plutôt au delà de mes compétences courantes). Je suis suis heureux de voir un créateur Canadien Français sur RUclips! Excellentes explications! Cheers!
🤔 this is really good thanks for sharing 👏👏
I love your work attitude. Passion and hobby. Well done.😊
Brilliant! Thanks for sharing! 👍
Already subscribed 😊
I finally understood the tasks in an easy way. Thank you very much for the video.
salut, merci du super video! Donc a place de prendre input parameters entre task tu passe par une fonction "extern volatile bool gifChangeRequested;" pour dire que bouton est appuyer? Pourquoi pas passer direct par les paramètre de tâches? I also thought writing c inside .h file was not considered good practice.
Oui c'est ça
Thank you for creating such a thoughtful and informative video to share with everyone! This video provides a wealth of valuable information for ESP32 users.
In your future video projects, if you have any ideas about Waveshare's other new products, I’ll be more than happy to provide you with the fullest support! 🌟
Awesome! Great video and the explanation is also great.
just flawless!!!
Thanks for introducing this function of Esp32 C3.
Could you pass the led pin and delay to the task via the parameter pointer and the create 3 instances of the task instead of having 3 different tasks?
Thank you very much for the knowledge
Thanks for your video. Pity you didn't explain how the push button task interact with the display task. I'll check that in your code :). Thanks
This is fantastic!! Thanks and great video!
Thanks ... good explanation. I've been working on a project for several weeks with an ESP32-S3 wemos mini using RTOS tasks and the Arduino framework on vscode.
One thing you might mention, because it can be a bit intimidating, is the propensity for the ESP to crash really brutally if you get something wrong. For example, not allocating sufficient RAM to a task, or trying to resume a task that is already running etc. Not much warning or info, kind of like a blue screen. I'm getting used to it, but it took a while.
Well, when your task rans out of stack you do get a helpful message: Debug exception reason: Stack canary watchpoint triggered (task_name_here)
Very much clearly explained. Thanks you so much for this video...
rtos tasks are not good only for organizing the code better, but, I think their main function is to control the microprocessor's execution threads to avoid overloading the processor with execution data, which will make your code crash if you don't know how to delete and restart the task when the processor queue creates a bottleneck effect.
This is required when you get some type of microcontrollers that are not supported and optimized well, but they have got a microprocessor which is strong, fast and dumb in the same time. :))
Cool! Thank you very much. This is very helpful!
This is excellent! I never knew about tasks.
When I see the structure for the displays, buttons and such, I can see how this will really help me in a project I will be doing soon.
I'm still not sure how the code in those tabs are called, but I'll figure it out. LOL
Thanks for posting this.
Must get me some circular displays for running that alien eye! Two would look awesome if I can get them to focus onto the same object in my drive next Halloween! Do you have a recommendation?
Waveshare 0.71inch Double Eye Round LCD Display Module.
@@nikthefix8918 Thanks. I ordered 2 similar ones that were demonstrated in his earlier videos, from amazon for almost half the price!
@hariseldon2577 If you buy the bare displays - very cheap indeed - they are pretty easy to solder to your own custom pcbs and the additional support components are simple and few. Could be a good option for an inexpensive bespoke assembly as well as being a great learning experience.
Amazing Tutorial many thanks, a question how can i define the wifi connection and http rest command in that way, i need read rfid reader too, need be available to read all the time, TY
Think about how you would do it in the standard way (traditional setup and loop functions) and do the same thing inside a task by using the setup part of the task and the loop part of the task.
Thanks i try it and feedback u !
Is there any difference between placing the `pinMode` command in the default `setup` function and placing it in the `setup` function of the tasks we create, apart from it looking more organized?
the result will be the same, use pinMode in the standard setup function for hardware shared across tasks or critical to the entire system.
Use pinMode in the setup part of a task when the pin is exclusive to that task, keeping task logic self-contained and easier to debug.
Great, Thanks!
Can you address the latency?
The video makes it look like there is a mandatory latency in the tens of ms when using this. Most visible in the multi-screen example where it looks like they change sequentially with th delay between each.
In the multiscreen you see in the video where I turn a rotary encoder, the image is being read from an SD Card, that's the latency of SD Card reader
@@thelastoutpostworkshopthat tracks.
So I think I hear you saying that there is no extra latency when using tasks. Is that right?
Even on the section with the yellow button it looks like there's latency but it's hard to tell with the high travel distance of those particular buttons. Decided it was best to ask and get the real answers.
Are these similar to ISR's?
also what do you use to edit your videos? it looks very clean and professional
I do not know ISR to be honest. I use Adobe Premier for editing and After Effects for some animations
@@thelastoutpostworkshop sorry i meant to ask those two separately - ISR is an interrupt service routine, basically a small function that tells the cpu to stop everything else and run it.
Yes I know about it, I am using one in my current project
Very nice tutorial 👍
Amazing video. Thanks for that.
Grate to know
Thanks for sharing
I'm back into electronics after 20 years. Please assist me when chosing my first basic ESP32S setup. Amazon UK offer different modules. Any guidance would be most welcome.
I cannot help you with this model, never tried it
Si « Les pistes audio pour certaines langues ont été générées automatiquement » pourquoi l'ai-je entendu en anglais? Comment puis-je écouter en français ? Merci pour ces explications et démonstrations. Très intéressants et ce me sera certainement utile.
Thank you for this video
Am familiar with rtos, but you don't seem to have included that. Am unclear where the equivalent comes from. Is that your own work? Good explanation of tasks.
Great tharnks 👍
Excellent. What about pass variable into tasks from the main loop.
For example, read a sensor task 1 elaborate the values in the main loop and display the new value on task 2.
I think you get my point.
Ps: i installed your ide, is super.
Brilliant!
How did you convert the gifs?
See this tutorial : ruclips.net/video/mqSe_uMpxIs/видео.html
Awsome. İ have esp32-s3 too. Can you make a bluetooth controller or wifi video? 🙂🙂
Is this extension better than platformio?
No, it's different, the Arduino Maker Workshop Extension is more for beginners who wants to try Visual Studio Code for the Arduino Framework programming
@@thelastoutpostworkshop Thanks for the clarification. Great to have something for beginners. I use PIO but will check this one out!
main problem is to set right stack size for each task...
Thanks
Great tutorial! Can the tasks access and/or share the same variable?
Yes, in the project I use a volatile global variable that is shared between two tasks. A volatile global variable can be used between two tasks because it ensures that the compiler does not optimize away accesses to the variable.
@@thelastoutpostworkshop thanks a lot!
so its threads
Cool channel mate, wish we had some of your video in french aswell
Vive le Quebec
And the real nightmare starts when you try to consume variables attached to core 0 by accessing it from core 1. You will need a semaphore and a lot of hacks to make that work.
você fala português (pergunto pelo seu sotaque) ? se sim coloque legendas em português por favor para nos ajudar
esp + embassy; bro...