Page 1 of 1

ESP32, Arduino IDE, Parallel Tasks

Posted: Thu Jan 27, 2022 11:05 am
by MakerMan
I have a sketch that
- connects to WiFi
- connects to MQTT
- reads data from a BME688 sensor
- sends that data to a server

This works, but I am having issues maintaining sensor quality, which degrades on timeouts, say when MQTT needs to re-connect.

I am wondering about assigning the sensor read operating to core 0 and run everything else on core 1, so that the sensor read infinite loop runs continuously and reads every 3s writing the readings to variables.

WiFi, MQTT, watchdogs etc would run on core 1 and send the data to the server. In the even of disconnection, re-connection would be handled in core 1 while 3s reads would carry on uninterrupted.

Has anyone tried this? I think it should work in principle, but are there any issues?

thanks

Re: ESP32, Arduino IDE, Parallel Tasks

Posted: Thu Dec 01, 2022 10:58 am
by anton_feun
hallo MakerMan I am curious as to your results of the 2 core functionality. In addition, are you perhaps using the Bosch bme68x library? I am presently battling along to connect a BME688 from Pimoroni to an ESP32 Wroom DA via I2C using the Bosch library. Best