Very useful! Thank you! Multi-tasking gives me ideas to improve my projects. Excellents videos, I've watched many, many thanks for sharing your knowledge
@DefaultName-hn5fh
7 жыл бұрын
Thanks for the tutorial. A great intro into multi tasking! Perhaps for a later video you might cover how access to shared variables across threads and thread safe libraries / data structures might be useful. Thanks again and keep up the great work!
@pcbreflux
7 жыл бұрын
For the Giveaway all comments were extracted with this python script: github.com/pcbreflux/espressif/blob/master/esp32/misc/downloader.py and the winner where picked with www.random.org/. Congratulations to the two winners and for everyone else good luck next time and sorry for some small delay. vijayenthiran subramaniam Please send me a private youtube message with your shipping address to receive the giveaway from analoglamb.com From KZitem Help: Send private messages Go to the channel of the person you want to contact. Click the About tab. Click Send message. Type in your private message and click Send.
@CrazyCoupleDIY
5 жыл бұрын
Nice work, thanks for sharing the tutorial
@cygeus
7 жыл бұрын
Thanks, I'm always learning something new.
@suomynona4607
7 жыл бұрын
Thanks for these examples. It always looks so easy.
@farrukh4303
7 жыл бұрын
Thanks a lot for this amazing work. really helpful.
@VikingGod667
7 жыл бұрын
Nice tutorial! Thx for sharing with us. You mentioned that the tasks could be synchronized with FreeRTOS Task API. Do you have a small example, of how to do this? Are they any Semaphore and Mutex?
@pcbreflux
7 жыл бұрын
Just do a video about this topic #43 last week. Using two stepper motors to individually moved by a task (qeued) and synchronized with an eventgroup github.com/pcbreflux/espressif/tree/master/esp32/arduino/sketchbook/ESP32_DRV8825 . And this is an esp-idf example for semaphores github.com/pcbreflux/espressif/blob/master/esp32/app/ESP32_freertos_semaphore/main/semaphore_main.c.
@VikingGod667
7 жыл бұрын
thank you very much for the fast reply. This is exactly what I'm searching for. thx
@benediktwehner9485
4 жыл бұрын
cooles video, genau das was ich gesucht habe
@klassichd10
7 жыл бұрын
Great thaks to you! You encouraged me to install the git infrastructure and to Flash my WeMos Lolin ESP32 I received a few days ago. And it worked with your touch sensor example. So I can proceed from ESP8266 to ESP32 step by step. Now a lot of questions arise: - Does Multitasking work properly with Wifi? So that I can use wifi and a Input triggered counter in parallel. Here the ESP8266 "failed" and lost counts while maintaining wifi - how to Control the priorities of the Tasks - how are the priority distributed between the two processors - how is the interprocessor communication done - how can we establish an interprocess communication So, enough itens for many interesting episodes. Thanks again!
@pcbreflux
7 жыл бұрын
For the wifi - wifi is preferable working on core 0 while the tasks and all arduino stuff running on core 1. So unlike the esp8266 you don't have to care. For priority and "inter task communication" you can use the knowledge of my videos about freertos...
@klassichd10
7 жыл бұрын
Thanks again. Good to know, that WiFi and arduino stuff do not interfere. Thaks for the reference to freertos, so I will look for it. I just try to migrate one of my ESP8266 Sketches to ESP32. Not so easy. The EEPROM apparently is substituted by Preferences.
@TAVITO01
6 жыл бұрын
Thanks a lot for, very informative video!
@pcbreflux
6 жыл бұрын
Thanks, your are welcome to watch more ...
@DavidGlaude
7 жыл бұрын
There are quiet a few ESP32 board on analoglamb.com, witch one is yours, or the one you are using in your video? Is it "ESP32 Development Board - Developer Edition"? I already played a lot with ESP8266, mostly micropython, and I have 3 or 4 different board, but due to the short of supply and uncertainty from the beginning of ESP32, I did not try yet. What are the available board nowdays, those powering from USB, serial over USB with supported serial driver and where it is easy to "flash", preferably without too much hassle?
@pcbreflux
7 жыл бұрын
For the live demo I use my own board: github.com/pcbreflux/espressif/tree/master/esp32/kicad/ESP32-adapter but this have no USB to UART converter and 3.3V voltage regulator on board and no nice auto upload feature like the boards from analoglamb.com (or others) which is displayed in the setup slides. So I need and external CP2103 (USB to UART bridge) and in this setup you see also a ST-Link V2 as a 5V (from USB) to 3.3V voltage regulator. But I do this design 8 month ago while waiting for some boards and adapter but for my its still useful. Currently all my other boards are used in some other projects.
@gotyaa8527
7 жыл бұрын
Great Video and Interesting Subject...
@lmamakos
6 жыл бұрын
Is there some magic in the Arduino core for the ESP32 that ensures that libraries that are not thread-safe/reenterent have critical sections/locks protecting them? Or do you just have to "know" which peripheral libraries are safe to be called from multiple threads? Just anecdotally, I've noticed that some libraries have static data inside them which hold some sort of state, and having multiple execution threads in there concurrently (or even serially..) might break in weird, wonderful and difficult to debug ways.
@pcbreflux
6 жыл бұрын
Don't know any magic code. Think you still have to check every library, use it in a highlander way or add some lines to prevent a crash.
@zambumm
5 жыл бұрын
wouldnt it be better to delete the loop function with vTaskDelete(NULL), instead of running it with nothing in it?
@Daniel-kx8ci
7 жыл бұрын
Great video, thank you!
@advertiva
7 жыл бұрын
Nice tutorial
@GfastGao
7 жыл бұрын
Another nice & useful one. p.s.: Is that means if I leave this comment here, I 'm in for the "Give away"?
@pcbreflux
7 жыл бұрын
Yes, all comments are extracted and all authors can potentially win the giveaway.
@petermeiner3574
6 жыл бұрын
Nixe Library for the w2812!
@roycerichmond4587
7 жыл бұрын
it could be possible to add the blynk library along side the multitask ? I think it might be but I'm not quite sure
@pcbreflux
7 жыл бұрын
The loop() with esp32 arduino is just a task (see main.cpp in the library). So blynk.run() is inside a freertos task on the esp32. There should no reason why not start an other task, if it make sense.
@daskasspatzle2396
7 жыл бұрын
Mutlitasking in Arduino IDE, cool thing ;-)
@RuiRex
7 жыл бұрын
Nice topic today!
@HectorLee
7 жыл бұрын
Could you do a comparison of the different ESP32 boards that are available? I was looking on aliexpress and there seem to be a few different dev boards. Are some of the ESP32 boards better that the others? Any bad ones to look out for?
@pcbreflux
7 жыл бұрын
You can watch #15 of the esp32 series but every board have it pros and cons. If you need an easy to use board with build in usb to uart bridge and autoreset get an dev board. But if you have restrictions in size you may want an adapter and buy a module or boards with the bare chip and flash memory (like from sparkfun, adafruit, tindy, banggood, dfrobot or analoglamb). or you need a board with display, ethernet, sd-card and lipo? want to do your own boards? Need FCC approval? I use whatever fits to the project : cheap vs. functionality vs easy to use. And be aware of the shipping time you can spend money for express delivery or buy from your local seller or wait up to 8 weeks.
@HectorLee
7 жыл бұрын
I wasn't referring to the bare modules or the wroom32 module. There seems to be a number of dev boards from various manufacturers. Some have lipo connections, some have an oled. I'm wondering if there are any other differences between them besides the really obvious ones like an OLED display.
@pcbreflux
7 жыл бұрын
Hector Lee From the programming perspective all ESP32 boards should look the same. Only the external flash memory can vary in speed and size. And the connections on the board can vary in the number of gpio pins. But the same gpio pin on one board should work as on an other board. Same with wifi and bluetooth. But I've heard that some modules get hot, but none of mine does so, all at the 30°C level even after hours.
@HectorLee
7 жыл бұрын
Thats some really useful information. Totally forgot about comparing the external flash memory. Most of my projects have been small enough to not max out the flash memory but some of the project I'm going to work on might need more flash memory. I had some trouble comparing the STM32 boards so was a little unsure about which ESP32 board to get started with. I'll definitely take a closer look at the various dev boards. The one with a lipo connector looks interesting for portable projects.
@farrukh4303
7 жыл бұрын
Is it possible to know how many tasks we can start with xTaskCreatePinnedToCore() function ?
@pcbreflux
7 жыл бұрын
This depends on the available memory and the size of one task. Started up to 80 tasks with this example github.com/pcbreflux/espressif/tree/master/esp32/arduino/sketchbook/ESP32_tasks_num.
@gobletoffireable
7 жыл бұрын
can the loop be independently start/stop or triggered by another task?
@pcbreflux
7 жыл бұрын
Shure, even this examples using the esp-idf it should work on arduino as well. Watch my series about esp32 and freertos (queues and event-groups).
@Vijayenthirans
7 жыл бұрын
Nice. Is FreeRTOS supported in esp8266?
@pcbreflux
7 жыл бұрын
yes and no. Yes it's supported github.com/espressif/ESP8266_RTOS_SDK but not as far as I know in the arduino core github.com/esp8266/Arduino .
@xXSpeedyTacoXx
7 жыл бұрын
nice video famboli
@skrame01
6 жыл бұрын
Can variables be shared among the independent tasks?
@pcbreflux
6 жыл бұрын
yes, but it depends on your tasks, if booth tasks read and write the (global) variable then try to surround the writing with portENTER_critical and portEXIT_CRITICAL and may consider using use a delay (vTaskDelay) in every task to before reading and after writing. Or Better use intertask-communication with maybe queues example here github.com/pcbreflux/espressif/blob/master/esp32/arduino/sketchbook/ESP32_speed_gpio_dual/ESP32_speed_gpio_dual.ino
@Siorinex
6 жыл бұрын
Hmm: Only 16 pixel in channel? After 16 - error in init stream.
@pcbreflux
6 жыл бұрын
Sorry don't get the error. Do you use WS2812(gpioNum,pixelCount,channel) where pixelCount is > 16? Have you an output or error message?
@Siorinex
6 жыл бұрын
Correction: after 21 pixel - start problem from 22/ Error: E (124) rmt: rmt_set_tx_thr_intr_en(348): RMT EVT THRESH ERR RMT for 0 channel use only 512*4 byte - 2048 byte For ws2812b use 24*4 byte for 1 pixel 22 pixels - 22*24*4 =2112 byte+4 byte for "terminator"...
@cricardol
7 жыл бұрын
noce tutorial! I would live To win!!
@cricardol
7 жыл бұрын
nice**
@cricardol
7 жыл бұрын
like*
@akarshagarwal4516
7 жыл бұрын
the link ain't working please update
@pcbreflux
7 жыл бұрын
Yes, sorry for that. But forgot my usbstick with the codes and could upload this easy on monday without type in the code again.
@icinosehacker
7 жыл бұрын
the github link not work, please update your github
@pcbreflux
7 жыл бұрын
Yes, sorry for that. But forgot my usbstick with the codes and could upload this easy on monday without type in the code again.
@pcbreflux
7 жыл бұрын
Code is now available here github.com/pcbreflux/espressif/tree/master/esp32/arduino/sketchbook/ESP32_tasks_ws2812 and github.com/pcbreflux/espressif/tree/master/esp32/arduino/sketchbook/ESP32_tasks .
@icinosehacker
7 жыл бұрын
why you use xTaskCreatePinnedToCore()? i try use xTaskCreate() without ARDUINO_RUNNING_CORE, it become error (CPU halted)
@pcbreflux
7 жыл бұрын
Core 0 is used for all internal stuff like wifi, Bluetooth etc. so with xTaskCreate you have only a 50:50 chance to run a stable arduino code.
@rahimkhan6926
7 жыл бұрын
node red tutorial please..
@pcbreflux
7 жыл бұрын
Any special topic? because node red is not ESP32, not arduino, not eclipse ... but can do something with ESP32+MQTT+node red+twitter ?
@rahimkhan6926
7 жыл бұрын
pcbreflux yes probably a video comprising of introduction and setup of node red and then using it with the esp32 would be good
Пікірлер: 62