#168

  Переглядів 162,539

Andreas Spiess

Andreas Spiess

6 років тому

The new ESP32 has three cores. Two of them are very fast; the third is ultra-low power. The Arduino IDE typically only uses one of the fast cores. Today:
- We will take full advantage of the second core of the ESP32
- We will test if it really increases the capacity of our microprocessor
- We will also compare its dual-core speed with the speed of an Arduino UNO
- We will try to synchronize tasks, even if they run on two different cores
- We will also try to use the same data on both cores
- These two mechanisms are mandatory if you want to use the two cores in a productive fashion
- And we will not leave the Arduino IDE. Promised
Links:
Sketches: github.com/SensorsIot/ESP32-D...
Base for my video: techtutorialsx.com/2017/05/06...
About Semaphores: exploreembedded.com/wiki/RTOS...
Some ESP32 boards from my last mailbag video:
ESP32 TTGO/OLED/Battery: bit.ly/2yQJQCf
X-Shields set ESP32: s.click.aliexpress.com/e/QNrFQNR
HiGrow: bit.ly/2yR8cf2
Geekcreit ESP32 Doit V1: bit.ly/2sOMR3E
LOLIN32 LITE (Micropython): bit.ly/2yI03dc
Geekworm ESP32: bit.ly/2yQ6Np1
ESP32 Dev Board: bit.ly/2yPohSp
Supporting Material and Blog Page: www.sensorsiot.org
Github: www.github.com/sensorsiot
If you want to support the channel and buy from Banggood use this link to start your shopping: bit.ly/2jAQEf4 (no additional charges for you)
Official Wemos Store: s.click.aliexpress.com/e/jUzBiIq
profile.php?...
/ spiessa
www.instructables.com/member/...
Please do not try to Email me or invite me on LinkedIn. These communication channels are reserved for my main job
If you want to buy me a coffee: www.paypal.me/AndreasSpiess

КОМЕНТАРІ: 716
@3dmixer552
@3dmixer552 5 років тому
RIP arduino. We had a good run
@alanmcoll101
@alanmcoll101 6 років тому
Maestro, the quality of this video exceeds even your usual high standard. Superb job sir!
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you for your nice words!
@northshorepx
@northshorepx 6 років тому
HOLY CRAP!!!! Brilliant! This is going to to be one of your most classic videos Andreas!
@AndreasSpiess
@AndreasSpiess 6 років тому
I hope so ;-) Thanks for your compliment!
@AndreaPasqualiniMe
@AndreaPasqualiniMe 6 років тому
This is one of the coolest videos you have ever made in my opinion! Great job!
@AndreasSpiess
@AndreasSpiess 6 років тому
I was astonished about the reactions on this video. I thought, it is too hardcore for UKposts and expected only a few viewers...
@sufiyanadhikari8716
@sufiyanadhikari8716 6 років тому
As always.. to the point and amazing... Always learning new thing with your videos... You are a blessing Andreas.. 😀
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you!
@deangreenhough3479
@deangreenhough3479 6 років тому
I agree
@michelebernasconi375
@michelebernasconi375 6 років тому
Hi Andreas! Thanks for the great quality videos. I have a mechanical engineering background and I am moving my first steps towards mechatronics as an hobby and your material has high educational value to me! Thanks for sharing!
@AndreasSpiess
@AndreasSpiess 6 років тому
I tried the other way round when I bought my milling machine. It was hard for me ;-)
@reanimationxp
@reanimationxp 6 років тому
One of your best videos to date, Andreas. I expected you to achieve asynchronous tasks, but explaining semaphores and using them to achieve synchronous (procedural) execution, and the persistence of global variables across cores was an added bonus I wasn't expecting. Fantastic work, thank you and keep it up!
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you for your feedback. I think, without semaphores, two cores are not very useful ;-)
@reanimationxp
@reanimationxp 6 років тому
You are right.
@TrentSterling
@TrentSterling 6 років тому
Great video, as always! I'm still using the 8266 everywhere, but videos like this are really encouraging! I'll make the switch eventually!
@AndreasSpiess
@AndreasSpiess 6 років тому
I also use the ESP8266 for normal jobs, because I still have a few laying around...
@ranger81de
@ranger81de 6 років тому
Great video as always! :-) Thanks for keeping your videos still simple, straight forward and easy to understand (e.g. using Arduino IDE), instead of getting more and more theoretically. This really is an outstanding advantage of your videos, if I compare it to other electronic channels. Your channel is way more valuable for me than any other...
@AndreasSpiess
@AndreasSpiess 6 років тому
Sometimes I think, my content is too complicated (for example for this video). But then, the feedback seems to be ok...
@ranger81de
@ranger81de 6 років тому
At least for me it's perfect :-)
@reanimationxp
@reanimationxp 6 років тому
Wasn't too complicated at all Andreas, fantastic job explaining it quickly and concisely. I wrote Hackster's article on "Multithreading" an Arduino. I might have to write one for ESP32 now and reference your video!
@opsahle2
@opsahle2 3 роки тому
@@AndreasSpiess No, this is great! Your balance is for me perfect, and with the great advantage (compared to many UKpostsrs) is your stringent editing where you do not waist words/time. Pausing and looping back in a video is so much better than fast forwarding to get past blablabla! I am a proud to be a Patreon supporter, and I just bought you a coffee as a special thank you for this video. (I am finally about to transit from ESP8266 to ESP32, and your videos is the obvious starting point.)
@ConstrianedVideo
@ConstrianedVideo 6 років тому
Hello Andreas! First I need to say that I enjoy all of your videos due to your skill in explaining the concepts involved and walking us through your engineering based approach. I am very interested in the ESP 32 however and really enjoyed this example on how to utilize the three cores and learn the basics of RTOS! I didn’t even realize Freertos was ported to the ESP 32. So useful to me, can’t wait to try it on my own devices. Time for me to become a patron!As always keep up the interesting work on all the things you are interested in.
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you for your nice comment. So far, I am not on Patreon. But this might change if I cross the 50'000 subscribers...
@muhammadhassanulhaq
@muhammadhassanulhaq 6 років тому
Bravo. I feel much indebted to your brilliant and most useful take on low-end microcontrollers. It is helping me with a lot of DSP applications.
@AndreasSpiess
@AndreasSpiess 6 років тому
Glad to be able to help.
@hukuzatuna
@hukuzatuna 6 років тому
This is fantastic! I've already forwarded this link on to friends (even though it's two in the morning here)! I'm also creating a dual-threaded process where one core monitors sensors and the other does display and uploading of data (which are passed via global scope variables). This is absolutely great, Andreas! I will henceforth use your framework for all my ESP32 projects!
@AndreasSpiess
@AndreasSpiess 6 років тому
+Philip Moyer Please come back with your learnings. This is still new technology.
@hukuzatuna
@hukuzatuna 6 років тому
It works! I created a typedef struct definition and instantiated a global scope variable - this is used to transfer data between cores. Core 0 polls an attached SI7021 temperature and humidity sensor, loads the data into the global scope variable, and then delay()s to control the timing. Core 1 reads the data buffer struct, displays the data on an OLED, and then uploads the data to adafruit.io (which is Adafruit's IoT/cloud offering.) Works like a charm! I couldn't have done it without your guidance, though! [Oh, and this is running on the Adafruit ESP32 Feather.]
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks for the update. Cool!
@hukuzatuna
@hukuzatuna 6 років тому
Oops. I take that partially back. It works for a while, and then produces nonsense data, and then stops working altogether. Debug time!
@AndreasSpiess
@AndreasSpiess 6 років тому
+Philip Moyer As I mentioned: I also had some issues to solve....
@erygion
@erygion 4 роки тому
Another great video Mr. Spiess. I'll be rewatching and following along with my esp32 😊
@AndreasSpiess
@AndreasSpiess 4 роки тому
Thank you!
@asiw
@asiw 6 років тому
Absolutely brilliant. Thanks for opening some more doors into the world of the ESP32.
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you for your nice words! We will see what we can do with these new possibilities...
@russelldicken9930
@russelldicken9930 6 років тому
Brilliant work! You've excelled yourself in this video Andreas! Well done.
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you! I was not sure when I did the video. The stuff is quite complicated...
@VicenteFontanella
@VicenteFontanella 4 роки тому
Thanks a lot Andreas for this amazing introduction. Great tutorial, as usual.
@AndreasSpiess
@AndreasSpiess 4 роки тому
You are welcome!
@EduardoAvelar
@EduardoAvelar 6 років тому
Hi Andreas, what amazing explanations and examples you did! Congratulations from Brazil!
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you!
@lfmtube
@lfmtube 6 років тому
This is the first of your videos I saw. I am very well impressed about it. Congratulations and Thank you very much
@AndreasSpiess
@AndreasSpiess 6 років тому
Welcome to the channel!
@MartinBgelund
@MartinBgelund 6 років тому
Awesome episode on a very interesting and powerfull​ topic! Thank you very much, Andreas!
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@beetleboy135
@beetleboy135 6 років тому
GREAT tutorial Andreas !!!! Thanks ! This will move some people to the right direction (including myself) Hope to see more dual core tutorials from you Awesome !
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you! We will see where these possibilities lead us...
@davidargles
@davidargles 6 років тому
Wow - totally cool! Thanks, Andreas, I had no idea that it was possible to access the two cores as simply as this. Fun playtimes ahead! Regards, David (UK)
@AndreasSpiess
@AndreasSpiess 6 років тому
I also discovered this possibility quite late.
@BrianLough
@BrianLough 6 років тому
Thanks for the video Andreas, lots of great info. I got a MAX7219 Led Matrix display being scrolled on one core (using a task, core 0) while the other core fetched the data (just using the loop). It's great because you can now scroll without any interruption!
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks for the feedback! Interesting. So it works!
@BrianLough
@BrianLough 6 років тому
Yup! I had it running for maybe 30 mins or so and it was working fine (I know not a conclusive test, but promising for sure!)
@simonj9264
@simonj9264 4 роки тому
I'm stunned by the perfection of this content
@AndreasSpiess
@AndreasSpiess 4 роки тому
Thank you!
@pradyumnacster
@pradyumnacster 6 років тому
Awesome! Thank you for you very systematic videos. Much appreciated. Long time fan :)
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you for your feedback!
@MichaGounski
@MichaGounski 6 років тому
This is probably most useful and important video about programming ESP32 I've seen.
@AndreasSpiess
@AndreasSpiess 6 років тому
I also like this concept of tasks.
@dachoeks3
@dachoeks3 6 років тому
Well what can I say, great as always. Looking forward to some Christmas themed videos.
@AndreasSpiess
@AndreasSpiess 6 років тому
We will see if I find the time...
@rodrigo_dm
@rodrigo_dm 6 років тому
Fast, to the point, very didactic and very entertaining. You belong in the hall of fame of youtube of engineering Andreas. Cheers
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you for your nice words!
@trevorvanbremen4718
@trevorvanbremen4718 5 років тому
Andreas, you're a TRUE star (complete with your ubiquitous 'Swiss Accent'). I always enjoy your videos. I haven't yet done anything much with ESP32 boards as I've tended to concentrate more effort on ARM based SBCs (OLinuxuinos, Beagle, OrangePi, BananaPi, RaspPi etc), but my soldering iron is beginning to show 'twitching' signs of neglect. As soon as I can muster up some form of project to suit it, I'm sure I'll have the flux flowing... Thanx dude (from a guy with a Kiwi Accent... LOL)
@AndreasSpiess
@AndreasSpiess 5 років тому
Never visited your country so far... Maybe I can change that when I stop working. I strongly suggest you try this part of electronics. It enhances the useability of the part you are using now.
@PerchEagle
@PerchEagle 5 років тому
This is really really interesting! I'm now working in Arduino/AVR worlds and still there's a lot to learn in AVR programming. I also have ESP8266 modules that haven't work with until now, moving to this new ESP32 is a huge improvement for me.
@AndreasSpiess
@AndreasSpiess 5 років тому
And the Wi-Fi connection opens a whole new world of possibilities...
@PerchEagle
@PerchEagle 5 років тому
@@AndreasSpiess wow I'm just imagining that new world 😊 now I just to write my C library of the nrf24l01. But with the ESP modules, the WiFi is built-in so that's more juice. I know it won't be easy to work with the nrf24l01 modules. But the work you do in calibration and testing modules is so much interesting.
@RWB123
@RWB123 2 роки тому
Great break down of how the ESP32 Dual Cores actually work. Thanks for making me smarter quicker!
@AndreasSpiess
@AndreasSpiess 2 роки тому
Glad to help!
@epiicSpooky
@epiicSpooky 5 років тому
For the main loop(), "vTaskDelete(NULL); " I believe is a good solution - it will immediately stop execution of the "main" thread. You could even use it at the end of setup() to never enter loop()
@AndreasSpiess
@AndreasSpiess 5 років тому
Thank you for the tip!
@RakshithPrakash
@RakshithPrakash 4 роки тому
at 4:42 , isn't that delay(1000) supposed to increase time instead of decreasing it? since the void loop() also is getting exceuted..
@sasodoma
@sasodoma 4 роки тому
@@RakshithPrakash I think that RTOS handles this and does other stuff while the loop is in the delay
@conorstewart2214
@conorstewart2214 3 роки тому
@@sasodoma Thats what appears to happen, but it would be better as mentioned above to just stop the loop entirely
@magic.marmot
@magic.marmot 5 років тому
I've been a firmware engineer for a considerable time now, and I have some very good experience with FreeRTOS, semaphores, and IPC in general. This opens up a whole new world for me with the ESP32 boards, and since winter is coming, I very much want to play. Thank you kind sir.
@AndreasSpiess
@AndreasSpiess 5 років тому
Enjoy! I am sure this is a new dimension for Makers...
@Raptorman0909
@Raptorman0909 6 років тому
The guy with the Swiss accent is kicking some serious ass -- great job!
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@tejasarlimatti8420
@tejasarlimatti8420 6 років тому
I don't know how you and others like Great Scott, Kevin Darrah upload content which is just so relevant to my current studies. I swear, a couple of times, I've been scouring the web for something I've wanted to learn, and then POOF : A video by one of you to help me with exactly that. I've had to pinch myself, if I'm being honest. Oh and before I forget, YES, I AM studying RTOS right now! For the ARM7 processors, though. All hail UKposts and people like you!
@AndreasSpiess
@AndreasSpiess 6 років тому
Glad to be of help. I also learn a lot through UKposts!
@reanimationxp
@reanimationxp 6 років тому
I was thinking the same thing. I just got the itch to explore ESP32 bluetooth again and Andreas posted a video the day before!
@jnekos
@jnekos 4 роки тому
Outstanding!! Such a helpful illustration. Thank you.
@AndreasSpiess
@AndreasSpiess 3 роки тому
You are welcome!
@ddavid2
@ddavid2 Рік тому
This video is great!! and quite useful to get the most from the ESP32!
@AndreasSpiess
@AndreasSpiess Рік тому
Thank you!
@christerlarsson9632
@christerlarsson9632 6 років тому
Thank's for your videos Andreas! Really enjoy them, very good info. Now i really must buy an ESP32 board.
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@CarltonDodd
@CarltonDodd 6 років тому
SO much great info in this video! Thanks, as always, for sharing with us!
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@ElsuhdElectronics
@ElsuhdElectronics 4 роки тому
Andreas you are brilliant because you every time i have a question you answer it in your videos like you are sitting in my head :) so thank you very much.
@AndreasSpiess
@AndreasSpiess 4 роки тому
You are welcome! These are maybe common wishes?
@ElsuhdElectronics
@ElsuhdElectronics 4 роки тому
@@AndreasSpiess Yes i think so :)
@proffirmanable
@proffirmanable 2 роки тому
Why all of your video always come when i need it the most😍 Truly magical~ God Bless you Mr. Andreas
@AndreasSpiess
@AndreasSpiess 2 роки тому
Thank oyu! But this one is quite old ;-) So it came too early.
@deangreenhough3479
@deangreenhough3479 6 років тому
Happy Sunday Morning Andreas 😀😀😀😀😀 Another very welcome addition to the ESP32, dual cores, cooooool. Still very much enjoying your new format😀 Your the magician that shows us all the tricks ✅ Bravo ✌️
@AndreasSpiess
@AndreasSpiess 6 років тому
If I would be a real magician, I probably would not show you the tricks. Would be bad for business ;-)
@deangreenhough3479
@deangreenhough3479 6 років тому
Andreas Spiess your the best, you show all your apprentices how to wave a magic wand🤗
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@pdrg
@pdrg 6 років тому
I learnt something today :). It would be good one day to have some kind of beginners masterclass for code architecture in this wonderful new world to reduce blocking and waiting. I'm sure some design patterns will be tidier than others!
@AndreasSpiess
@AndreasSpiess 6 років тому
We will see where these new possibilities lead us...
@RobMingis
@RobMingis 6 років тому
Great clip, love your work!
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you!
@markledford4420
@markledford4420 Рік тому
Awesome video it truly is a different animal the pwm change still gets me I guess I'm use to the original approach but one does get use to the change
@AndreasSpiess
@AndreasSpiess Рік тому
Thank you!
@charlesdorval394
@charlesdorval394 6 років тому
Incredibly interesting video! Thanks again Andreas
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@douglassimms6218
@douglassimms6218 5 років тому
Hi Andreas, Great video as always. You are the master!
@AndreasSpiess
@AndreasSpiess 5 років тому
Thank you!
@aliaghil1
@aliaghil1 6 років тому
Great job. Now I more interested to buy an ESP32 board. Thank you for all good videos you making.
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@anonimuso
@anonimuso 4 роки тому
You make the best and most informative content on UKposts. A good diversion from all the cat videos... :)
@AndreasSpiess
@AndreasSpiess 4 роки тому
Even if on some of my videos our cat appears ;-) Thank you!
@Salfke
@Salfke 6 років тому
Hi, a very interesting video, I never thought that this was possible on the ESP32 Keep on making such video's!!
@AndreasSpiess
@AndreasSpiess 6 років тому
I knew it is possible, but not using the Arduino IDE...
@mau_lopez
@mau_lopez 5 років тому
Excellent video! Really good stuff here!
@AndreasSpiess
@AndreasSpiess 5 років тому
Thank you!
@claudiomoles
@claudiomoles 6 років тому
very good, ESP 32 is becoming the workhorse of IOT.
@roygilby4513
@roygilby4513 6 років тому
I can't wait to see what Expressif's next big thing is ------ ESP 64 maybe ?????? That'd be nice :-)
@AndreasSpiess
@AndreasSpiess 6 років тому
+Roy: I think, I have enough to do to learn how to work with what we have with the ESP32 ;-)
@fpvdarktim
@fpvdarktim 4 роки тому
Grüezi aus dem Aargau. Late to the party, but I just stumbled on this topic. Comes handyfor my next project!
@AndreasSpiess
@AndreasSpiess 4 роки тому
Good to know. Hope it helps!
@GarthClarkson
@GarthClarkson 6 років тому
Excellent video once again. I have been using ESP8266 modules commercially since the documentation was only in Chinese and personally experienced the frustration that the community was going through where the background WiFi functionality was causing delays and inconsistency in certain routines, especially ones that used PWM. In response to this Espressif came up with the idea to add a second core to do all this stuff while the first was left alone to do reliable networking. This was deliberate and hence the ESP32 solved many problems that we had to learn to work around on the ESP8266. I think that this needs to be kept in mind when assigning tasks to Core0 and only short, non-essential code should be used there. That being said. Thanks for expanding our knowledge with handy, practical tips. Cheers.
@AndreasSpiess
@AndreasSpiess 6 років тому
Another viewer did some testing and wrote, that Wi-Fi runs on core 1. Do you know more?
@GarthClarkson
@GarthClarkson 6 років тому
Thanks for your reply Andreas. No I don't know more. I think you are much more up to date with the ESP32 than I am. I am simply stating the historical basis for the second core and went by what Espressif were saying at the time. I was unaware that the new Arduino interface for the ESP32 was layered on top of RTOS. If the default for WiFi and user-defined are both core 1 then that would kind of defeat the purpose of the second core unless RTOS has already taken the balancing of tasks into account.
@raguaviva
@raguaviva 6 років тому
Andreas this is amazing! Keep it up!! :D
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you!
@MJRoBot_MarceloRovai
@MJRoBot_MarceloRovai 6 років тому
Dear Maestro, thanks for this great, great video! It is fantastic! Saludos from the south of the world! ;-)
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@RobinHagg
@RobinHagg 4 роки тому
No way I will digg Up My old Uno now. Love the videos
@AndreasSpiess
@AndreasSpiess 4 роки тому
Thank you!
@waltsteinchen
@waltsteinchen 6 років тому
Hi Andreas, Awesome video! .. as always.... You describe it correct, that you have to use semaphores to protect access to shared variables, but in your code I think you use it *outside* of the protected block. counter++ should be inside that block. Otherwise you can introduce very very hard to find errors, especially in more complex scenarios. The synchronization of the starting point of the tasks itself does not neccessary fulfil that!
@GaetanCollaud
@GaetanCollaud 6 років тому
Luckily the blink delay is different by 200ms, so the increment are never at the same time. But you're right: counter++ should be between the take and give...
@owlsight4499
@owlsight4499 6 років тому
I second this; nobody likes to search for those "heisenbugs" that this could lead to.
@AndreasSpiess
@AndreasSpiess 6 років тому
+Walter Steinchen I know the problem but not the solution in this scenario (how to define protected variables). However I think, using semaphores can be used to prevent a double update. But I am still looking for a definition like "volatile"
@neilcherry6452
@neilcherry6452 6 років тому
Andreas, excellent video, but access to the global variable isn't exactly being controlled by the semaphore. At least not the way the video explains it. In the code it seems more like a side effect rather than proper handling. As long as folks know that more work needs to be done on the subject they can resolve the 'heisenbugs' (I like that name).
@AndreasSpiess
@AndreasSpiess 6 років тому
+Neil Cherry Msxbe the solution is already there and I only do not know it...
@AndreAntivilo
@AndreAntivilo 5 років тому
Excellent video! I used it and it's working fine. Core_0 to manage wifi, RTC and automation and Core_1 to manage Telegram Bot messages (chat bot). Although I had to change the _Stack size of task_ from 1000 to 8192, to stop getting _stack canary watchpoint triggered_ error.
@AndreasSpiess
@AndreasSpiess 5 років тому
Thanks for your feedback. It is encouraging to see that it works...
@michip.1196
@michip.1196 5 років тому
Please give me a hint how you did this to solve the same issue... Thanks
@AndreAntivilo
@AndreAntivilo 5 років тому
Can you be more specific?
@victorcruz1533
@victorcruz1533 7 місяців тому
Thanks! You are the man!
@AndreasSpiess
@AndreasSpiess 7 місяців тому
:-)
@RaphaelBrandaoS
@RaphaelBrandaoS 6 років тому
Dude, your content is priceless!! Thank you
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@RETRODISTORT
@RETRODISTORT 6 років тому
Amazing video, as always :)
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks!
@davidargles
@davidargles 6 років тому
I've just remembered that I did some work on parallel programming for control some years ago. I found that in many simpler applications, there was no need for software synchronisation (e.g. via semaphores); the synchronisation came via sensor feedback in the real world. That means that there are many practical applications one can code up for twin cores without having to use semaphores at all. Hope that's helpful, regards, David
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks for the tip!
@DCFusor
@DCFusor 6 років тому
I'll second that - in spades. If you really have a good understanding of what you're doing - or can "be the computer(s)" in your head, oftentimes you don't need to block on semaphores or mutexes or even spin-busy on a shared boolean. My outfit wrote quite a bit of "very high 9's" software for some telecom manufs using this trick - and some of it hasn't crashed since started in the 1990s. But! You'd better darn well comment in unmistakable ways "the wires that aren't there because they don't need to be" - why you can do this without all those moving parts. Because someday, someone else is going to touch that code and since it looks easy - will not bother to undertake a full understanding, and that's when your phone rings at 3 am...Of course, that other person might be future you who has forgotten the plan. But it's still worth it - even though they take awhile to type - comments run VERY FAST! They also don't take up a lot of space in the runtime(!).
@carlosmaia83
@carlosmaia83 6 років тому
Great video. Please continue with the good work. :)
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you!
@emeggiolaro
@emeggiolaro 6 років тому
Great Andreas, as usual. Thanks
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@JerryEricsson
@JerryEricsson 2 роки тому
I really got into using the ESP32 for wifi radio. I have built several versions now, all based on the little powerhouse. My latest are now being built into old amps for apple phones and iPads.. I have been locating the 5 volts inside and building the units inside the case, hook them up so the aux will switch them on. They play wonderfully, I left off the ability to change stations locally and still use my cell phone for tuning in the channels should I ever wish to listen to something. I picked up a couple of different brands of these devices 2 of the 3 that I have had room inside to stuff the ESP and the decoder. To protect the ESP inside the case I soldered all the wires then used a heavy duty heat shrink tube to cover it and shrink it down . This way there is little chance o it shorting out
@AndreasSpiess
@AndreasSpiess 2 роки тому
Sounds like this project is getting better and better!
@Giblet535
@Giblet535 6 років тому
Thank you Andreas! So far, Espressif is very responsive to bug reports against the Arduino IDE core, but the esp-idf is Espressif's preferred development framework. Problems get solved on esp-idf first. For example, Bluetooth works very well from esp-idf. Bluetooth didn't work at all from Arduino last time I tried.
@AndreasSpiess
@AndreasSpiess 6 років тому
You are right. But for the moment, most of my viewers want to stay with the Arduino IDE. So, we have to take what we get (and create some push on Espressif by using their chips).
@reanimationxp
@reanimationxp 6 років тому
Agreed, thank you for sticking with Arduino for these types of things. It is much more accessible than ESP-IDF for now.
@Tony770jr
@Tony770jr 6 років тому
Excellent presentation!
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you!
@HariWiguna
@HariWiguna 6 років тому
HI Andreas! What a coincidence that you covered RTOS as I was just starting to play with RTOS on the Arduino Mega (because I ran out of memory on the Nano) for my ping pong led cube. Now that I learned from you that the ESP32 supports RTOS and I won't have to leave the comfort of the Arduino IDE, I certainly would use the ESP32 instead of the Mega. Thanks Andreas! Great content as usual!
@AndreasSpiess
@AndreasSpiess 6 років тому
I definitively would go for the ESP32 if it has enough pins for your application because it is much faster than a Mega and I think, also more memory. And maybe you can remotely control your cube?
@TrentSterling
@TrentSterling 6 років тому
IoT LED Cubes! Sounds awesome.
@Davedarko
@Davedarko 6 років тому
Hari Wiguna be careful if you want to use digitalWrite though - the ESP32 can be slower than the classic Arduino, or at least not as fast as one thinks. I might have learned that in one of Andreas's videos.
@lordhelmchen100
@lordhelmchen100 6 років тому
afaik our beloved ESP8266 also uses FreeRTOS for its sdk ;-)
@mikebiermans4273
@mikebiermans4273 6 років тому
The question that comes to mind here is. What am I going to do with all the Arduino boards I have, nano, Uno, Mega.....
@JensHeuschkel
@JensHeuschkel 6 років тому
Thanks for that great video, really helped me a lot in a project :) I would also be interested in some information how to switch the second core (and other sub modules I don't need) completely off to save more energy and how to set the clock frequency of a core. Cheers!
@AndreasSpiess
@AndreasSpiess 6 років тому
I had to reduce the speed in one of my videos. It is possible. I do not know if you can switch a core off. Video #161
@avi8r66
@avi8r66 5 років тому
Well, this solves a problem of mine. Excellent Andreas.
@AndreasSpiess
@AndreasSpiess 5 років тому
:-)
@daslolo
@daslolo 6 років тому
Tight video, clear and to the point. I like that you don't confuse us with race condition.
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks!
@yasoooooori
@yasoooooori 6 років тому
The most useful tutorial I've ever run into. Good work... But I was wondering about what we can do for the watchdog timer and how to solve its errors... Big thumbs up 👍👍
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you! We will see in the future...
@ashrafkamel1287
@ashrafkamel1287 4 роки тому
that is a simple and yet a great video thank you
@AndreasSpiess
@AndreasSpiess 4 роки тому
You are welcome!
@TheRealBobHickman
@TheRealBobHickman 6 років тому
Super useful info again, thanks Andreas!
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@hasantariq7314
@hasantariq7314 5 років тому
@Andreas Spiess... : You are Rocking man... This is Super Practical Video...
@AndreasSpiess
@AndreasSpiess 4 роки тому
Thank you!
@qzorn4440
@qzorn4440 2 роки тому
this is sooo exciting... i just got an esp32 now it is time for my little r&d hobby stuff...:/ thanks loads...:)
@AndreasSpiess
@AndreasSpiess 2 роки тому
Have fun!
@TechnoAutomation
@TechnoAutomation 5 років тому
This is really very useful . Thanks for sharing knowledge .
@AndreasSpiess
@AndreasSpiess 5 років тому
You are welcome!
@colt4547
@colt4547 6 років тому
Absolutely excellent Content presented at a comfortable rate. Thank you very very much.
@AndreasSpiess
@AndreasSpiess 6 років тому
Thank you for your feedback!
@chuxxsss
@chuxxsss 6 років тому
Andreas one of your best videos you have ever done. This is a fantastic video my hat is of to you sir.
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks. I was not convinced when I published this one because the topic is quite complicated...
@mairswartz
@mairswartz 6 років тому
Great video. I must say though that I’m getting more into programming the ESP32 in eclipse using FreeRtos and Its very nice. You get to use tasks like you did but with autocomplete
@AndreasSpiess
@AndreasSpiess 6 років тому
Good to know. So far I did not try this route...
@mairswartz
@mairswartz 6 років тому
I'm thinking about putting a course together that will go over this. I'll keep you posted on my progress
@Tolissere
@Tolissere 6 років тому
What an amazing video.! Thank you so much sir!
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@idolpx
@idolpx 6 років тому
Great job! Loved the video. Thanks Andreas. :)
@AndreasSpiess
@AndreasSpiess 6 років тому
you are welcome!
@bourasabdennour8369
@bourasabdennour8369 6 років тому
Really amazing sir, I hope more informative videos like that.
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks!
@silverjohnson3163
@silverjohnson3163 3 роки тому
great information as usual !
@AndreasSpiess
@AndreasSpiess 3 роки тому
Glad you think so!
@josecampino7476
@josecampino7476 6 років тому
Semaphores and MUTEX 101 primer in a few minutes... Another great video !
@AndreasSpiess
@AndreasSpiess 6 років тому
:-)
@edwinov
@edwinov 5 місяців тому
Fantastic video! Extremely clear examples.
@AndreasSpiess
@AndreasSpiess 5 місяців тому
Glad you think so!
@joaofgf
@joaofgf 6 років тому
hi Andreas! thank you for another great video! very good!
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome! I am surprised by the number of views. Thought, this is only interesting to a few...
@davschall
@davschall 6 років тому
Awesome thank you! This will help with my current project I will have one core listening for bluetooth instructions and the main core runs the main block of code. As an aside, anyone who listens to the amp hour podcast should remember a few episodes ago the talked to Jeroen Domburg who now works at espressif who told us that it runs freertos and is multi core...although looking it up I know realize that was actually not that long ago but anyway yea...
@AndreasSpiess
@AndreasSpiess 6 років тому
Good luck with your project. Seems to run not only at the "Leading edge" but probably at the "bleeding edge"...
@distancelab2010
@distancelab2010 6 років тому
Awesome video. Now I going to have to change my plans and play with this. 😁
@AndreasSpiess
@AndreasSpiess 6 років тому
The same happened to me when I discovered that it is possible ;-)
@jacobjimenez3571
@jacobjimenez3571 6 років тому
So far a really helpfull video, thanks andreas.
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@cad3175
@cad3175 6 років тому
..amazing well done and thanks for sharing :)
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@ERICRAC
@ERICRAC 6 років тому
Very good job as always. Thanks.
@AndreasSpiess
@AndreasSpiess 6 років тому
You are welcome!
@arpcatchall822
@arpcatchall822 11 місяців тому
If anyone gets bootloop with message: 'Debug exception reason: Stack canary watchpoint triggered esp32 core..." make sure you increase the stack (the 1000 in task init), 8192 worked for me. This 5 year old article was a great guide. Thanks Andreas.
@AndreasSpiess
@AndreasSpiess 11 місяців тому
Thanks for the additional information!
@henrikgilvad240
@henrikgilvad240 3 роки тому
This is my favourite of your videos
@AndreasSpiess
@AndreasSpiess 3 роки тому
Glad you like it!
@victormurcio8845
@victormurcio8845 4 роки тому
Andreas, eres un súper mega chingón!!!! Esta información es muy útil. Muchas gracias por compartir, eres un mega máster. Te mando un cordial saludo desde la ciudad de México!!!! Un abrazo!!!! Víctor Murcio Mansilla
@AndreasSpiess
@AndreasSpiess 4 роки тому
Gracias!
@grindel80
@grindel80 6 років тому
Andreas, great Video again!!
@AndreasSpiess
@AndreasSpiess 6 років тому
Thanks!
@3dmixer552
@3dmixer552 5 років тому
you are a genius, sir. Respect
@AndreasSpiess
@AndreasSpiess 5 років тому
:-)
@mohamedsalah3262
@mohamedsalah3262 4 роки тому
Thanks a lot for this Amazing video
@AndreasSpiess
@AndreasSpiess 4 роки тому
You are welcome!
@JopWerff
@JopWerff 5 років тому
An explanatory video like this in such a good tempo is fascinating. No wonder to see so many positive reactions. But certainly you spend time to produce. Thanks, Andreas, for that. I have a question that will make using both cores even more interesting. What about interrupts and ISR's? Which core is handling interrupts? Say we have a process that produces many interrupts, you could think of an Rotary Encoder. Pololu has motors equipped with an Encoder. So I was thinking of using the Encoder info for a feedback to control the speed of such motor - now Pololu is offering very expensive motor controller boards from RoboClaw to perform such task. Would be nice if we could do this with an ESP32 for less then 10 $. My idea is: - one Core is handling all interrupts from the encoder and shares the shaft position info with the task running on the other core - other Core uses this position info to calculate if motor runs to slow/fast and corrects the speed of the motor For a project with 22 motors that have to run at the same speed this will be a money saver. Thanks if you will think about this, Jop The Netherlands
@AndreasSpiess
@AndreasSpiess 4 роки тому
So far I never used interrupts with RTOS. So you have to dig into its documentation yourself. I am sure it will be possible.
@rklauco
@rklauco 3 роки тому
Love this. Using this on my LED clock - bought 0.8" LED display and the core0 just refreshes the display, core1 does the logic. All of it is done using 1 ESP32, 4 resistors (100ohm) and 1 LED display. Btw, I had a watchdog problem with core0 in Arduino. I had to add these 3 lines to the for(;;) loop: TIMERG0.wdt_wprotect=TIMG_WDT_WKEY_VALUE; TIMERG0.wdt_feed=1; TIMERG0.wdt_wprotect=0;
@AndreasSpiess
@AndreasSpiess 3 роки тому
Thank you for the information! Good to know.
#149 ESP32 Dual Core Programming + Speed 💨Test vs Arduino UNO (fast!)
31:18
ЧТО ДЕЛАТЬ, ЕСЛИ НЕ ХВАТАЕТ ДЕНЕГ НА ВОССТАНОВЛЕНИЕ ТАЧКИ?
47:52
Что будет с кроссовком?
00:35
Аришнев
Переглядів 2,2 млн
Rutgers University Confirmed: Meshtastic and LoRa are dangerous
13:27
Andreas Spiess
Переглядів 720 тис.
Use the very attractive new ATTINY chips for your projects
14:34
Andreas Spiess
Переглядів 190 тис.
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
Rachel De Barros
Переглядів 358 тис.
PlatformIO: All you need to know in 10 Minutes!
10:56
J's e-shack
Переглядів 278 тис.
2 Parallel Loops on ESP32 No Delay using Arduino IDE
6:51
Electronic Junkies
Переглядів 19 тис.
Radar Sensors from $3 to over $100: Which one is Best?
14:31
Andreas Spiess
Переглядів 147 тис.
463 Why most Arduino Soil Moisture Sensors suck (incl. solution)
10:59
Andreas Spiess
Переглядів 59 тис.
Try these 16 Brilliant ESP32 projects!!!
11:18
ToP Projects Compilation
Переглядів 509 тис.
[TMT] Using Both Cores Of The ESP32 Using Arduino
2:54
Brian Lough
Переглядів 23 тис.
Тестируем Gravis Ultrasound... ну почти.
48:18
Дмитрий Бачило
Переглядів 30 тис.
Тестируем Gravis Ultrasound... ну почти.
48:18
Дмитрий Бачило
Переглядів 30 тис.
All New Atlas | Boston Dynamics
0:40
Boston Dynamics
Переглядів 5 млн
План хакера 🤯 #shorts #фильмы
0:59
BruuHub
Переглядів 999 тис.