Go Down

Topic: MKR GSM can't connect to internet (Read 4268 times) previous topic - next topic

jgartner

I get the following response from the console:

Code: [Select]
Starting Arduino web client.
AT

OK
AT+IPR=921600

OK
AT

OK
AT+UPSV=3

OK
AT+CPIN?

ERROR
AT+CPIN?

+CPIN: READY

OK
AT+CMGF=1

OK
AT+UDCONF=1,1

OK
AT+CTZU=1

OK
AT+UDTMFD=1,2

OK

+UMWI: 0,1

+UMWI: 0,2

+UMWI: 0,3

+UMWI: 0,4
AT+CREG?

+CREG: 0,0

OK

[creg response repeats 46 times]

OK
AT+CREG?

+CREG: 0,0


For this I've used the following sample code:


Code: [Select]
#include <MKRGSM.h>

#include "arduino_secrets.h"

const char PINNUMBER[]     = SECRET_PINNUMBER;
// APN data
const char GPRS_APN[]      = SECRET_GPRS_APN;
const char GPRS_LOGIN[]    = SECRET_GPRS_LOGIN;
const char GPRS_PASSWORD[] = SECRET_GPRS_PASSWORD;

// initialize the library instance
GSMClient client;
GPRS gprs;
GSM gsmAccess(true);

// URL, path and port (for example: example.org)
char server[] = "ifconfig.me";
char path[] = "/ip";
int port = 80; // port 80 is the default for HTTP

void setup() {
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  Serial.println("Starting Arduino web client.");
  // connection state
  bool connected = false;

  // After starting the modem with GSM.begin()
  // attach the shield to the GPRS network with the APN, login and password
  while (!connected) {
    if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
        (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
      connected = true;
    } else {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("connecting...");

  // if you get a connection, report back via serial:
  if (client.connect(server, port)) {
    Serial.println("connected");
    // Make a HTTP request:
    client.print("GET ");
    client.print(path);
    client.println(" HTTP/1.1");
    client.print("Host: ");
    client.println(server);
    client.println("Connection: close");
    client.println();
  } else {
    // if you didn't get a connection to the server:
    Serial.println("connection failed");
  }
}

void loop() {
  // if there are incoming bytes available
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.available() && !client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();

  }
}


It once worked pretty good but for some time now it doesn't what can I do? Maybe use a different antenna?

pert

Do you have your MKR GSM 1400 properly powered? The cellular radio intermittently draws high amounts of current and if your power supply can't handle this then the communication won't work reliably.

From the product page:
https://store.arduino.cc/mkr-gsm-1400
Quote
During cellular transmissions, the peak current required by the board will exceed 500mA. This is in excess of what can be sourced by a standard USB port, so it is MANDATORY to have a 1500 mAh or higher LiPo battery plugged all the time, the current provided by the USB port will be supplemented by the battery.  When powering the board using Vin, a 5V power supply that can supply at least 2A is required.

dariopennisi

You may also be in an area where 3g and 2g have been decommissioned. Please check if your operator still supports 2g and/or 3g.

david10m

I have the same issue, did you find a solution? thanks

FelixR5

I had the same problem.

I first used the "Arduino-SIM" with Arduino-IoT-cloud and it all worked fine.
After 2 days it stopped working, with the same result on the test code, as you have. (I think the network provider exluded the SIM-card from the Gsm-Network)

Next I bought a new SIM-card from a local Network provider (Norway) and it also gave the same result, at first try.

I took the new SIM-card and tested it in a phone. All worked fine.
Then I put the Sim-card back in the MKR GSM 1400, and after that, everything has worked fine.

PS: I`am not using the Arduino IoT-cloud.

Hope this info can help.
 :)

ShieldCE

I have the same issue.

And I just tried to use another power supply witch can supply larger currency.

It worked!!!

Thank you, pert.

elevraadforman

I had the same problem.

I first used the "Arduino-SIM" with Arduino-IoT-cloud and it all worked fine.
After 2 days it stopped working, with the same result on the test code, as you have. (I think the network provider exluded the SIM-card from the Gsm-Network)

Next I bought a new SIM-card from a local Network provider (Norway) and it also gave the same result, at first try.

I took the new SIM-card and tested it in a phone. All worked fine.
Then I put the Sim-card back in the MKR GSM 1400, and after that, everything has worked fine.

PS: I`am not using the Arduino IoT-cloud.

Hope this info can help.
 :)
What povider did work for you? I've Telenor M2M sim and get the  AT+CREG? +CREG: 0,0 code.

FelixR5

I use Telia now. Worked fine for a loooong time. But it stopped working 2 days ago.  >:(  Same problem.

I think the SIM-card or the MKR itself is expelled from the network. Telia this time... Telenor last time.

Is that a possible senario?

Trying to find a unik identifier for the MKR-card, and then call Telia and ask them to please lett me send small amount of data on there network…  :o  8)  :smiley-evil:

Any suggestions?

Go Up