MKR GSM 1400 unreliable

Hi guys,

I am not able to get my MKR GSM 1400 running for a long period of time.

Context:

  • Board: MKR GSM 1400
  • 2400 mAh LiPo connected
  • Dipole antenna
  • Swisscom Multi Device SIM card
  • Sketch: GPC_IoT_Core_GSM from Arduino Cloud Provider Examples
  • arduino_secrets.h configured as it should, everything else is out of the box
  • all libraries bords used in this context are up to date
  • Configuration on Google Cloud IoT Core is done

The board connects to the network and successfully connects Cloud IoT Core.
Messages published by the board are received by IoT Core.
Messages published by IoT Core are received by the board.

And after some time everything stops. The board need to be reset, and then it will reconnect.
The cycle goes on and on.
I'm looking after setting up a critical remote system, and as you may imagine, this is far from being ideal currently.

I attach the debug output. The last breath before dying is:

10:27:16.864 -> +USORD: 0,0,""
10:27:16.864 -> 
10:27:16.864 -> OK
10:27:16.908 -> AT+USORD=0,512

10:27:17.044 -> +USORD: 0,0,""
10:27:17.044 -> 
10:27:17.044 -> OK
10:27:17.044 -> AT+USORD=0,512

10:27:17.138 -> +USORD: 0,2,"D000"
10:27:17.138 -> 
10:27:17.138 -> OK
10:27:17.138 -> AT+USORD=0,512
Attempting to connect to MQTT broker: mqtt.googleapis.com

And then, nothing, stuck forever until next reset.

There is anoter successful reconnectin prior to that one:

10:25:22.113 -> +USORD: 0,0,""
10:25:22.113 -> 
10:25:22.113 -> OK
10:25:22.113 -> AT+USOCL=0

10:25:22.113 -> OK
10:25:22.113 -> Attempting to connect to MQTT broker: mqtt.googleapis.com 
10:25:22.113 -> AT+CCLK?

10:25:22.113 -> +CCLK: "19/07/10,10:25:17+08"
10:25:22.113 -> 
10:25:22.113 -> OK
10:25:22.113 -> AT+USOCR=6

10:25:22.113 -> +USOCR: 0
10:25:22.113 -> 
10:25:22.113 -> OK
10:25:22.113 -> AT+USOSEC=0,1,0

10:25:22.113 -> OK
10:25:22.113 -> AT+USECPRF=0,0,1

10:25:22.113 -> OK
10:25:22.113 -> AT+USOCO=0,"mqtt.googleapis.com",8883

10:25:22.113 -> OK

I noticed that it is happening each time on the second attempt to reconnect.

I didn't go too deep in the code for the moment, but did anybody encountered the same issue, or have any existing reference relating this behaviour?

Could anybody try to reproduce this?

Versions as I'm writing and testing:
Arduino SAMD board: 1.8.3
Arduino_JSON library: 0.1.0
ArduinoMqttClient library: 0.1.3

Regards

GSM1400hangs.txt (140 KB)

Quick update:

Exact same behaviour with an Hologram.io SIM card connecting to Sunrise in Switzerland.

So, problem doesn't come from the SIM nor the Provider nor the coverage.

I also attach the debug output.

Regards

GSM1400hangsHologram.txt (65.7 KB)

Hi. I haven't closely studied your issue, but you should check out this information to see if it's relevant:

Hi pert,

I did see this GitHub issue prior to my post, however based on following comment I thought it was not applicable to my case:

Indeed I am not using VIN and have a 1s 3.7V 2400mAh LiPo constantly connected capable of delivering 20C continuous, 40C peaks.
In addition I'm connecting in 3G, not 2G

And using the USB port as charging source.

Is this setup problematic needing some changes or should it be ok?

Thing I believe is a bit weird is that I have been able to have this setup run for about 1 day at the beginning, then it went down to half a day, then 1 or 2 hours, and now it only works for less than 5 minutes before being stuck, needing a good reset.

Are you using MKRGSM Library? Which version?

Hi k4hvd,

Yes, MKRGSM library version is 1.4.2.

Quick update, I have been able to make my board work in the long run following Arduino IoT Cloud Google Sheets Integration project.

It uses the same libraries, MKRGSM, ArduinoMqttClient as the out of the box GCP_IoT_Core_GSM coming from Arduino Cloud Providers Example "lib".
Note that I'm encoutering similar bad behaviours with my MKRNB 1500.

So the problem certainly comes from the example code, where connections to GSM/NB networks and MQTT client are not handled properly.

What do you think?

Here is the code which is 6 months old now, I'm surprised that nobody encountered similar issues.

Have you tried to set the timeouts?

mqtt
.setKeepAliveInterval
.setConnectionTimeout

MKRGSM's

gsmaccess
.setTimeout
gprs
.setTimeout

Hello,

I got the board working with with the Arduino IoT Cloud, stable in the long run.
So I took inspiration on the code, especially GSMConnectionManager.cpp and I have been able to get a stable connection took.
I would recommend for anybody using this board and the MKRNB to take a look at this code, as it is very well done, in a non blocking way.

Regards