I’m struggling to find any existing questions which answer this question. I’m an experienced developer, but a noob with Particle (just purchased an Electron).
I already have some variables and functions which are working. Separately, I have multiple threads working. However, if I have a few strange problems next:
- If I try to move Particle.process() from loop() into one of my threads, it never connects to cloud.
- If I call Particle.publish() from on of my threads, it loses connection with the cloud.
- I have also confirmed that os_thread_delay_until() is working as expected in my two threads.
- Additionally, I I tried wrapping process (from loop()) as well as publish (from the other task) with SINGLE_THREADED_BLOCK(), but that did not seem to help.
- I have also tried understanding the various settings for SYSTEM_THREAD and SYSTEM_MODE, but that did not seem to answer anything for me either.
I’m guessing there’s something I’m fundamentally not understanding about what happens when process() or publish() are called, so I’m hoping someone with more experience with Particle can point me in the right direction.