[image] mseddougui: specifically functions that connect to the wifi and to an mqtt server require the use of delay() while they're waiting for a connection and thus the program blocks in certain areas. [image] mseddougui: Another solution would be to monitor the connection status without … Answer from J-M-L on forum.arduino.cc
🌐
Random Nerd Tutorials
randomnerdtutorials.com › home › project › esp32 › how to use esp32 dual core with arduino ide
ESP32 Dual Core with Arduino IDE | Random Nerd Tutorials
November 26, 2025 - For my project I currently use Arduino (controls etc) and ESP8266 (Wifi) with RX/TX links but would like to investigate the 2 x core ESP32 option Reply · Hi Bob. We don’t go deep into that subject in our course. As Tony mentioned in a previous comment “both tasks can use the same variables declared in the sketch, so this is the easiest way to communicate between the cores.”. I hope this helps. Regards, Sara Reply · Sharing global variables between multiple threads ...
Discussions

std::thread implementation for ESP32 to Arduino API/IDE
wishful IMO for Arduino: a std::thread implementation for ESP32, like meanwhile already available for Teensy (TeensyThread): https://github.com/ftrias/TeensyThreads or perhaps native C++ More on github.com
🌐 github.com
99
May 23, 2019
Multithreading on Arduino/esp
Hi, I want to know if it's possible to run two or more different program loops concurrently on an arduino? I've implemented an event-based system that deals with several different tasks using specific durations for each event. The system works fine but one issue I have is that certain functions, ... More on forum.arduino.cc
🌐 forum.arduino.cc
12
0
April 5, 2023
Multi-threading with the ESP32 - Projects made with Blynk - Blynk Community
Saw this project Three LEDs with Dirty Delay (ESP32) - #21 by Gunner on multi-threading with the ESP32 and thought I have a crack at a non-blocking second thread reading analog and digital inputs The only trap I found is that ADC1 uses CORE1 and ADC2 uses CORE0. More on community.blynk.cc
🌐 community.blynk.cc
1
4
December 7, 2021
Multithreading avec un ESP32
Bonjour à toutes et à tous, Dans l'application que je souhaite réaliser : un routeur photovoltaïque, il y a plusieurs fonctions : acquisition de données, fonction de régulation, enregistrement/lecture de données. transfert de données par WiFi. Faire du multithreading me semble approprié. More on forum.arduino.cc
🌐 forum.arduino.cc
19
0
December 22, 2024
🌐
Espressif
docs.espressif.com › projects › arduino-esp32 › en › latest › openthread › openthread.html
OpenThread - - — Arduino ESP32 latest documentation
Arduino OpenThread sketches read ESP-IDF sdkconfig symbols (CONFIG_OPENTHREAD_*). The ESP-IDF OpenThread port maps many of them to OpenThread core macros (OPENTHREAD_CONFIG_*) in openthread-core-esp32x-ftd-config.h. Some library features also depend on macros that are not direct menu toggles and must be set in a custom OpenThread header when using Arduino as an ESP-IDF component. CoAPS builds: enable Thread Extensioned Features → Use a header file defined by customer, define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 1 in that header, and enable mbedtls PSK ciphers — see README.md.
🌐
GitHub
github.com › espressif › arduino-esp32 › issues › 2814
std::thread implementation for ESP32 to Arduino API/IDE · Issue #2814 · espressif/arduino-esp32
May 23, 2019 - wishful IMO for Arduino: a std::thread implementation for ESP32, like meanwhile already available for Teensy (TeensyThread): https://github.com/ftrias/TeensyThreads or perhaps native C++ <thread>
Author   espressif
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Multithreading on Arduino/esp - Programming - Arduino Forum
April 5, 2023 - Hi, I want to know if it's possible to run two or more different program loops concurrently on an arduino? I've implemented an event-based system that deals with several different tasks using specific durations for each event. The system works fine but one issue I have is that certain functions, specifically functions that connect to the wifi and to an mqtt server require the use of delay() while they're waiting for a connection and thus the program blocks in certain areas.
🌐
TechTutorialsX
techtutorialsx.com › 2017 › 12 › 30 › esp32-arduino-using-the-pthreads-library
ESP32 Arduino: Using the pthreads library
TechTutorialsX — directory of Android apps with desktop guides for Windows PC and Mac via the NoxPlayer emulator. Plus a deep archive of programming and microcontroller tutorials.
🌐
Blynk Community
community.blynk.cc › projects made with blynk
Multi-threading with the ESP32 - Projects made with Blynk - Blynk Community
December 7, 2021 - Saw this project Three LEDs with Dirty Delay (ESP32) - #21 by Gunner on multi-threading with the ESP32 and thought I have a crack at a non-blocking second thread reading analog and digital inputs The only trap I found is that ADC1 uses CORE1 and ADC2 uses CORE0.
Find elsewhere
🌐
Arduino Forum
forum.arduino.cc › international › français
Multithreading avec un ESP32 - Français - Arduino Forum
December 22, 2024 - Bonjour à toutes et à tous, Dans l'application que je souhaite réaliser : un routeur photovoltaïque, il y a plusieurs fonctions : acquisition de données, fonction de régulation, enregistrement/lecture de données. transfert de données par WiFi. Faire du multithreading me semble approprié.
🌐
TutorialsPoint
tutorialspoint.com › esp32_for_iot › esp32_for_iot_setting_up_rtos_for_dual_core_and_multi_threaded_operation.htm
Setting up RTOS for dual-core and multi-threaded operation
On a single core, often, one thread has to wait for the other to pause before it can begin execution. On two cores, parallel execution is literally parallel, because they are literally occupying different processors. Sounds exciting? Let's get started with a real example, that demonstrates how to create two tasks and assign them to specific cores within ESP32. ... To use FreeRTOS within the Arduino ...
🌐
Arduino Forum
forum.arduino.cc › other hardware › home automation
Creating threads in an C++ library for ESP32 - Home Automation - Arduino Forum
February 21, 2020 - Hi, In an university project I need to implement a package resending for the CoAP-simple library for arduino. Theoretically, I would consider this an easy task, since it only envolves a few lines of code. As I am more of a Java programmer and not very well versed in C++ and arduino stuff I ...
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Arduino ESP32 multi threading shared memory - Programming - Arduino Forum
February 8, 2021 - The ESP32 is ideal for a portable device because of its price and its low power consumption. The problem with a single-thread solution is that while the FFT is running, the audio signal cannot ...
🌐
GitHub
github.com › espressif › arduino-esp32 › discussions › 11777
Matter Over Thread on ESP 32 C6 Xiao by Seeed Studio in Arduino IDE · espressif/arduino-esp32 · Discussion #11777
ESP32-C6: OpenThread init fails in Arduino Core 3.3.0 (IDF 5.5) due to missing eventfd/select in core build ... -DCHIP_DEVICE_CONFIG_ENABLE_WIFI=0 -DCHIP_DEVICE_CONFIG_SOC_WIFI_SUPPORTED=0 -DCHIP_DEVICE_CONFIG_ENABLE_THREAD=1 -DCONFIG_ENABLE_CHIPOBLE=1 -DINET_CONFIG_ENABLE_IPV4=0 -DINET_CONFIG_ENABLE_IPV6=1
Author   espressif
🌐
YouTube
youtube.com › kind spirit technology
ESP32 & ESP8266 - Multithreading, simple example with ESP32 - YouTube
#esp32project #arduino #programming In this episode, we are going to talk about multi-threding with esp32 and arduino. The first episode will provide basic e...
Published   June 26, 2024
Views   84
🌐
Arduino
docs.arduino.cc › tutorials › nano-matter › open-thread-border-router
Open Thread Border Router with Nano Matter & ESP32 | Arduino Documentation
The Nano Matter is the RCP, connected to the Nano ESP32 (the Matter Controller) via serial port. ... This tutorial's main objective is to guide you through the build and configuration of an OpenThread Border Router. This router will allow you to deploy a Matter network over Thread and integrate Matter devices into your Smart Home system. Create an OTBR using Arduino products.
🌐
Reddit
reddit.com › r/esp32 › easy threading on the esp32
r/esp32 on Reddit: Easy threading on the ESP32
July 29, 2022 -

It's really difficult to chase down race conditions, even with a debugger.

Because of that, you may hesitate to use the secondary core on applicable ESP32s.

I've created a PlatformIO library to make it almost foolproof to write code that targets the secondary core or just a secondary thread on the primary core.

The library is easy to use and examples are included.

Add this to your platformio.ini

lib_ldf_mode = deep
lib_deps = codewitch-honey-crisis/htcw_freertos_thread_pack

Or visit this link to download the code manually (necessary if using Arduino IDE)

https://github.com/codewitch-honey-crisis/htcw_freertos_thread_pack

Included is a thread class, a thread pool class, a thread safe message queue class, and something called a "synchronization_context". The latter was a concept I "borrowed" from .NET that allows you to dispatch code on a waiting thread. Basically you feed it a lambda from the primary thread and it will run whatever code was inside of it on the thread that's waiting. It often makes it unnecessary to roll your own synchronization.

Examples are included under /examples

🌐
ESP32 Forum
esp32.com › viewtopic.php
ESP32 Threading - ESP32 Forum
To create a "thread", which is a "task" in FreeRTOS lingo, you use one of the API calls described here: https://docs.espressif.com/projects/esp ... ertos.html Either: ... Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.
🌐
DFRobot
dfrobot.com › home › blog
ESP32 Arduino Tutorial: Using the pthreads library - DFRobot
January 4, 2018 - TUTORIALS ESP32 · DFRobot Jan 04 2018 263036 · #include <pthread.h> Serial.begin(115200); pthread_t threads[4]; int returnValue; void setup() { Serial.begin(115200); pthread_t threads[4]; int returnValue; for( int i = 0; i< 4; i++ ) { returnValue = pthread_create(&threads[i], NULL, printThreadId, (void *)i); if (returnValue) { Serial.println("An error has occurred"); } } } void *printThreadId(void *threadid) { Serial.println((int)threadid); } #include <pthread.h> void *printThreadId(void *threadid) { Serial.println((int)threadid); } void setup() { Serial.begin(115200); pthread_t threads[4]; int returnValue; for( int i = 0; i< 4; i++ ) { returnValue = pthread_create(&threads[i], NULL, printThreadId, (void *)i); if (returnValue) { Serial.println("An error has occurred"); } } } void loop() {} ESP32 / ESP8266 ProjectsESP32 / ESP8266 Products ·
🌐
Espressif
components.espressif.com › components › espressif › arduino-esp32 › versions › 3.3.6 › examples › Arduino_ESP_Matter_over_OpenThread
espressif/arduino-esp32 - 3.3.6 - Example Arduino_ESP_Matter_over_OpenThread • ESP Component Registry
| Supported Targets | ESP32-C5 | ESP32-C6 | ESP32-H2 | | ----------------- | -------- | -------- | -------- | # Arduino ESP-Matter over Thread example using ESP32-C5, ESP32-C6 and ESP32-H2 (any SoC with Thread radio) This is an Arduino as IDF Project to build an ESP-Matter over Thread RGB Light using ESP32-C5/C6/H2 and ESP-Matter Arduino API \ This example shall work with Arduino 3.3.2+ and also IDF 5.5.1+\ It is necessary to make sure that the IDF version matches with the one used to release the Arduino Core version.\ This can be done looking into release information in https://github.com/esp