Overcome Mental Barriers with ESP32 Tasks

Поделиться
HTML-код
  • Опубликовано: 23 янв 2025

Комментарии • 74

  • @braveonder
    @braveonder 15 дней назад +24

    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.

    • @jstro-hobbytech
      @jstro-hobbytech 13 дней назад +1

      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

    • @dasig3010
      @dasig3010 3 дня назад

      is this better options: vTaskDelay()? or millis()?

    • @hexidev
      @hexidev 2 дня назад

      ​@@dasig3010vTaskDelay is the same as delay as delay calls vTaskDelay. Only it does some calculation so its actually that many miliseconds long

  • @danielcolnaghi2045
    @danielcolnaghi2045 14 дней назад +1

    So far the best explanation of esp32 cores!!! Thanks so much to provide this kind of information for free!!!

  • @apocalypseio
    @apocalypseio 15 дней назад +2

    this changed my week in a meaningful way ~chuckles~ heck it is January. understanding this information has brightened my whole year

  • @chrisderwicht
    @chrisderwicht 15 дней назад +3

    Thank you for this video ... it makes me realize that RTOS is an incredible gamechanger!

  • @jeffschroeder4805
    @jeffschroeder4805 16 дней назад +2

    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.

  • @keen2461
    @keen2461 16 дней назад

    Loved the concept! That's pretty useful. Impecable video as usual.

  • @mlongval
    @mlongval 14 дней назад

    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!

  • @codewithbenji
    @codewithbenji 14 дней назад +1

    🤔 this is really good thanks for sharing 👏👏

  • @JakePunay-f6l
    @JakePunay-f6l 16 дней назад +1

    I love your work attitude. Passion and hobby. Well done.😊

  • @altitude1039
    @altitude1039 16 дней назад +1

    Brilliant! Thanks for sharing! 👍
    Already subscribed 😊

  • @portillajoe
    @portillajoe 16 дней назад

    I finally understood the tasks in an easy way. Thank you very much for the video.

  • @JeromeDemers
    @JeromeDemers 16 дней назад +3

    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.

  • @Waveshare_Ruan
    @Waveshare_Ruan 14 дней назад +1

    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! 🌟

  • @temyraverdana6421
    @temyraverdana6421 16 дней назад

    Awesome! Great video and the explanation is also great.

  • @bigoper
    @bigoper 2 дня назад

    just flawless!!!

  • @diegob.p.9546
    @diegob.p.9546 13 дней назад

    Thanks for introducing this function of Esp32 C3.

  • @richardgardiner242
    @richardgardiner242 12 часов назад

    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?

  • @ynfynyty3236
    @ynfynyty3236 13 дней назад +1

    Thank you very much for the knowledge

  • @Limprevisiblle
    @Limprevisiblle 14 дней назад +1

    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

  • @jeroen-surf
    @jeroen-surf 14 дней назад

    This is fantastic!! Thanks and great video!

  • @YoutubeBorkedMyOldHandle_why
    @YoutubeBorkedMyOldHandle_why 16 дней назад +2

    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.

    • @alejandroperez5368
      @alejandroperez5368 15 дней назад

      Well, when your task rans out of stack you do get a helpful message: Debug exception reason: Stack canary watchpoint triggered (task_name_here)

  • @nammakadai9993
    @nammakadai9993 15 дней назад

    Very much clearly explained. Thanks you so much for this video...

  • @nevermind-wp3bf
    @nevermind-wp3bf 16 дней назад +1

    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. :))

  • @karlpelzer9485
    @karlpelzer9485 16 дней назад

    Cool! Thank you very much. This is very helpful!

  • @BlondieHappyGuy
    @BlondieHappyGuy 16 дней назад

    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.

  • @hariseldon2577
    @hariseldon2577 16 дней назад +4

    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?

    • @nikthefix8918
      @nikthefix8918 16 дней назад

      Waveshare 0.71inch Double Eye Round LCD Display Module.

    • @hariseldon2577
      @hariseldon2577 16 дней назад

      @@nikthefix8918 Thanks. I ordered 2 similar ones that were demonstrated in his earlier videos, from amazon for almost half the price!

    • @nikthefix8918
      @nikthefix8918 16 дней назад

      @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.

  • @Crakkovia
    @Crakkovia 16 дней назад

    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

    • @thelastoutpostworkshop
      @thelastoutpostworkshop  15 дней назад +1

      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.

    • @Crakkovia
      @Crakkovia 15 дней назад

      Thanks i try it and feedback u !

  • @aGGreSSiv
    @aGGreSSiv 15 дней назад

    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?

    • @thelastoutpostworkshop
      @thelastoutpostworkshop  15 дней назад +1

      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.

  • @nuovocampo-cinque3189
    @nuovocampo-cinque3189 16 дней назад +1

    Great, Thanks!

  • @JB-fh1bb
    @JB-fh1bb 4 дня назад

    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.

    • @thelastoutpostworkshop
      @thelastoutpostworkshop  4 дня назад

      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

    • @JB-fh1bb
      @JB-fh1bb 3 дня назад

      ​@@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.

  • @UNgineering
    @UNgineering 9 дней назад

    Are these similar to ISR's?
    also what do you use to edit your videos? it looks very clean and professional

    • @thelastoutpostworkshop
      @thelastoutpostworkshop  9 дней назад

      I do not know ISR to be honest. I use Adobe Premier for editing and After Effects for some animations

    • @UNgineering
      @UNgineering 9 дней назад

      @@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.

    • @thelastoutpostworkshop
      @thelastoutpostworkshop  9 дней назад

      Yes I know about it, I am using one in my current project

  • @autonoob
    @autonoob 16 дней назад

    Very nice tutorial 👍

  • @kraftman_sp
    @kraftman_sp 16 дней назад

    Amazing video. Thanks for that.

  • @danieldewindt3919
    @danieldewindt3919 8 дней назад

    Grate to know
    Thanks for sharing

  • @greenmoss
    @greenmoss 10 дней назад

    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.

  • @patrickallaire229
    @patrickallaire229 12 дней назад

    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.

  • @vaan331
    @vaan331 14 дней назад

    Thank you for this video

  • @markanderson8066
    @markanderson8066 16 дней назад +1

    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.

  • @frankdearr2772
    @frankdearr2772 11 дней назад

    Great tharnks 👍

  • @sistemamarco
    @sistemamarco 15 дней назад +1

    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.

  • @philware1546
    @philware1546 15 дней назад

    Brilliant!

  • @pointer2null
    @pointer2null 16 дней назад

    How did you convert the gifs?

  • @burstfireno1617
    @burstfireno1617 15 дней назад

    Awsome. İ have esp32-s3 too. Can you make a bluetooth controller or wifi video? 🙂🙂

  • @arp_catchall
    @arp_catchall 15 дней назад

    Is this extension better than platformio?

    • @thelastoutpostworkshop
      @thelastoutpostworkshop  15 дней назад +1

      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

    • @arp_catchall
      @arp_catchall 15 дней назад +1

      @@thelastoutpostworkshop Thanks for the clarification. Great to have something for beginners. I use PIO but will check this one out!

  • @silentage6310
    @silentage6310 14 дней назад +1

    main problem is to set right stack size for each task...

  • @morten61
    @morten61 15 дней назад

    Thanks

  • @davidkyjovsky5405
    @davidkyjovsky5405 15 дней назад

    Great tutorial! Can the tasks access and/or share the same variable?

    • @thelastoutpostworkshop
      @thelastoutpostworkshop  14 дней назад

      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.

    • @davidkyjovsky5405
      @davidkyjovsky5405 13 дней назад

      @@thelastoutpostworkshop thanks a lot!

  • @smb1397
    @smb1397 14 дней назад

    so its threads

  • @ericgather2435
    @ericgather2435 16 дней назад +1

    Cool channel mate, wish we had some of your video in french aswell
    Vive le Quebec

  • @zlackbiro
    @zlackbiro 14 дней назад

    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.

  • @eduardo9626
    @eduardo9626 13 дней назад

    você fala português (pergunto pelo seu sotaque) ? se sim coloque legendas em português por favor para nos ajudar

  • @samuelemmettbray
    @samuelemmettbray 16 дней назад +2

    esp + embassy; bro...