ESP32, Arduino IDE, Parallel Tasks

MakerMan
Posts: 9
Joined: Wed Dec 22, 2021 8:01 pm

ESP32, Arduino IDE, Parallel Tasks

Postby MakerMan » Thu Jan 27, 2022 11:05 am

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

Who is online

Users browsing this forum: No registered users and 24 guests