we are using the E-Series module in an industrial controller and have some problems with blocked user code in an environment with bad mobile connection. A display is and a frequency converter (via Modbus) are connected to the controller .
Both require regular communication within 100 ms.
As soon as the mobile connection breaks off, loop() is not executed for up to 30 seconds, while the E-Series tries to reconnect.
I have already implemented the following:
Particle.connect() is called in setup().
Before each Particle.publish(), Particle.connected() is used to check whether the cloud connection exists.
With an existing connection and also with a completely deactivated connection everything works. But as soon as the E-Series module reconnects, loop() will not be executed for some time.
I have also tried to disable the GSM module after a disconnect with Cellular.off() and Particle.disconnect(). But this doesn’t really help. The user code is then still blocked for some time.
Is there a way that the execution of the user code/ loop() always has the highest priority and the cloud connection is only secondary?
Thanks for your help