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

anton_feun
Posts: 1
Joined: Sat Nov 12, 2022 8:29 am

Re: ESP32, Arduino IDE, Parallel Tasks

Postby anton_feun » Thu Dec 01, 2022 10:58 am

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

Who is online

Users browsing this forum: No registered users and 34 guests