arduino-libraries / MKRGSM

GNU Lesser General Public License v2.1
54 stars 51 forks source link

GSM.begin() and GSM_SMS.available() without freezing the loop()? #109

Open srv-config opened 4 years ago

srv-config commented 4 years ago

Hi,

The main flaw I experience with MKRGSM lib is inability to do range of things without temporary freezing or slowing down the loop timers.

E.g. each time I attempt to connect to GSM via GSM.begin() the loop() holds on until it gets connected. I tried using async mode and check for GSM.ready() but it was giving same results, with the difference I could check for ready() whenever I liked to.

I tried to combine the connection process with timers but result is still same. Exactly same problem is with GSM_SMS.available(). Each time the function is executed the entire loop is being stopped for ~300-500ms in total what has huge impact on all other processes.

Question is: is it possible to make the two function not stopping the loop()'s normal operation? Can it be improved somehow?

srv-config commented 4 years ago

Any solution for this? with such delays the MKR1400 GSM is not usable for serious projects. Kindly asking someone to look into the issue.

CptHolzschnauz commented 4 years ago

Hi

gsm.begin() comes to the void setup() section and attaching the network needs some time. Use gsmAccess(true) to see the modem messages over the serial monitor. With the connection set up, SMS.available() in the loop needs some millies.

Cheers