GSM doesn't work after upgrade of IDE

Hi, I have been using GSM Arduino Shield 2 and an Arduino R3 for the past while without any trouble.

But when I updated the IDE from 1.7.10 to 1.8.5 nothing works anymore.

For example, if I run the GsmScanNetworks program from the examples library it returns an IMEI of 0 and doesn't see any of the networks available.

If I revert to another PC running 1.7.10 everything works fine again.

None of the SMS receive/send examples work either with the later IDE yet they work fine with the older version.

I have tried looking at the settings on both IDEs but as far as I can see the setup is identical on both. So the only variable seems to be the IDE. Has anybody else come across this?

Thanks in advance for your help.

Seamus

The problem is not really related to the IDE version, rather it's related to the version of the library which comes with that IDE version.

Try this:

  • Sketch > Include Library > Manage Libraries...
  • Wait for download to finish.
  • In the "Filter your search..." box, type "gsm".
  • Click on the GSM library entry. It will show the version you have installed, which should be 1.0.6.
  • Select 1.0.5 from the drop down version menu.
  • Click "Install".
  • Click "Close".
  • Try the example sketch again.

Repeat that process until you have either found the newest version of the library that works or have gone all the way back to the oldest version without finding one that works. If the latter, then you know the problem is due to a difference elsewhere and you can go through a similar process with other variables. I believe that the arduino.org IDE (the 1.7.x versions) includes the unmodified 1.0.0 version of the library for AVR boards. If you do find a version of the GSM library that works for you then you can either just use that version or investigate what changed between the working version and the non-working version to see what needs to be fixed in order to allow you to use the latest GSM library version.

Hi Pert,

Thanks for the quick and detailed reply. I worked all the way back to 1.0.0 without any success but I did notice that there were a lot of error messages being generated during the compile. I did a re-install of the IDE to make sure everything was clean but they still persist. It looks to me like there is a problem originating in a library file or setting somewhere that is causing the cascade below.

Any ideas on where I should look next? Thanks Again, Seamus

In file included from C:\Users\User\Documents\Arduino\libraries\GSM\src/GSM.h:46:0,

                 from C:\Users\User\Documents\Arduino\libraries\GSM\examples\Tools\GsmScanNetworks\GsmScanNetworks.ino:25:

C:\Users\User\Documents\Arduino\libraries\GSM\src/GSM3ShieldV1BandManagement.h:49:125: warning: 'typedef' was ignored in this declaration

 typedef enum GSM3GSMBand {UNDEFINED, EGSM_MODE, DCS_MODE, PCS_MODE, EGSM_DCS_MODE, GSM850_PCS_MODE, GSM850_EGSM_DCS_PCS_MODE};

                                                                                                                             ^

C:\Users\User\Documents\Arduino\libraries\GSM\examples\Tools\GsmScanNetworks\GsmScanNetworks.ino: In function 'void setup()':

C:\Users\User\Documents\Arduino\libraries\GSM\examples\Tools\GsmScanNetworks\GsmScanNetworks.ino:57:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     if (gsmAccess.begin(PINNUMBER) == GSM_READY) {

                                  ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3MobileMockupProvider.cpp: In constructor 'GSM3MobileMockupProvider::GSM3MobileMockupProvider()':

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3MobileMockupProvider.cpp:44:12: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  msgExample="Hello#World";

            ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3MobileMockupProvider.cpp: In member function 'int GSM3MobileMockupProvider::connectTCPServer(int, char*, int*)':

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3MobileMockupProvider.cpp:183:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   strcpy("192.168.1.1", localIP);

                                ^

In file included from C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp:34:0:

C:\Users\User\Documents\Arduino\libraries\GSM\src/GSM3ShieldV1BandManagement.h:49:125: warning: 'typedef' was ignored in this declaration

 typedef enum GSM3GSMBand {UNDEFINED, EGSM_MODE, DCS_MODE, PCS_MODE, EGSM_DCS_MODE, GSM850_PCS_MODE, GSM850_EGSM_DCS_PCS_MODE};

                                                                                                                             ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp: In constructor 'GSM3ShieldV1BandManagement::GSM3ShieldV1BandManagement(bool)':

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp:38:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  quectelStrings[UNDEFINED]="";

                           ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp:39:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  quectelStrings[EGSM_MODE]="\"EGSM_MODE\"";

                           ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp:40:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  quectelStrings[DCS_MODE]="\"DCS_MODE\"";

                          ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp:41:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  quectelStrings[PCS_MODE]="\"PCS_MODE\"";

                          ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp:42:31: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  quectelStrings[EGSM_DCS_MODE]="\"EGSM_DCS_MODE\"";

                               ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp:43:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  quectelStrings[GSM850_PCS_MODE]="\"GSM850_PCS_MODE\"";

                                 ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1BandManagement.cpp:44:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  quectelStrings[GSM850_EGSM_DCS_PCS_MODE]="\"GSM850_EGSM_DCS_PCS_MODE\""; 

                                          ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1ModemCore.cpp:39:14: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

 char* __ok__="OK";

              ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1ModemVerification.cpp: In member function 'String GSM3ShieldV1ModemVerification::getIMEI()':

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1ModemVerification.cpp:64:20: warning: passing NULL to non-pointer argument 1 of 'String::String(int, unsigned char)' [-Wconversion-null]

  String number(NULL);

                    ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1SMSProvider.cpp: In member function 'void GSM3ShieldV1SMSProvider::beginSMSContinue()':

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1SMSProvider.cpp:68:57: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   if(theGSM3ShieldV1ModemCore.genericParse_rsp(resp, ">"))

                                                         ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1ScanNetworks.cpp: In member function 'String GSM3ShieldV1ScanNetworks::getCurrentCarrier()':

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1ScanNetworks.cpp:66:21: warning: passing NULL to non-pointer argument 1 of 'String::String(int, unsigned char)' [-Wconversion-null]

   return String(NULL);

                     ^

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1ScanNetworks.cpp: In member function 'String GSM3ShieldV1ScanNetworks::getSignalStrength()':

C:\Users\User\Documents\Arduino\libraries\GSM\src\GSM3ShieldV1ScanNetworks.cpp:85:21: warning: passing NULL to non-pointer argument 1 of 'String::String(int, unsigned char)' [-Wconversion-null]

   return String(NULL);

                     ^

Sketch uses 17692 bytes (54%) of program storage space. Maximum is 32256 bytes.
Global variables use 1110 bytes (54%) of dynamic memory, leaving 938 bytes for local variables. Maximum is 2048 bytes.

Those are warnings, not errors. Errors are a problem that causes compilation to fail. Warnings are about things that don't cause a compilation failure but may or may not indicate a problem. The Arduino libraries used to have lots of these warnings that didn't actually cause any problems but were super annoying. They have fixed some of these recently but the GSM library hasn't been very actively developed. Note that you will only see these warnings when you have them enabled at File > Preferences > Compiler warnings so it's possible that they were also present in the Arduino IDE 1.7.10 but you just didn't have them enabled. Also note that with Arduino IDE 1.8.5 the compiled library is cached after the first compilation so you will only see the warnings on that first compilation. If you change library versions or otherwise modify the library or change the board selection the library is recompiled.

I don't have any experience using this library or the GSM Shield 2. Hopefully someone with more knowledge will chime in. It's possible that the problem is caused by a change in one of the other libraries that the GSM library uses. These appear to be all part of the Arduino AVR Boards core. So you can investigate this by repeating the process I described above, only by rolling back through the previous versions of Arduino AVR Boards via Tools > Board > Boards Manager.

Thanks very much for your time. You have been more than helpful.

If that doesn't work out I might just go back to the earlier IDE and go with what works. I'll post on how I get on in case it is useful to someone else. :)

Seamus

Problem Solved !

I took the board version back to 1.6.10 and now it works fine.

Thanks for your clear and logical advice - I'll be working through the updating of WiFi and Ethernet shields in the same way in the coming weeks and I think you have provided me with the way to approach any issues I may find with them as well as solving the immediate problem.

Much appreciated,

Seamus

Glad to hear you found a working configuration without having to revert to an outdated and non-standard IDE version.

You also have narrowed down the source of the problem considerably if you wanted to investigate further. The problem was caused by something that changed between Arduino AVR Boards 1.6.10 and 1.6.11. Both those versions use the same compiler toolchain version so you can eliminate that. You can see a list of the changes made between Arduino IDE 1.6.8 (which includes Arduino AVR Boards 1.6.10) and Arduino IDE 1.6.9 (which includes Arduino AVR Boards 1.6.11) here: https://github.com/arduino/Arduino/compare/1.6.8...1.6.9 Unfortunately Arduino AVR Boards is part of the Arduino IDE repository so you find some irrelevant commits in there that are changes to the IDE code, not Arduino AVR Boards.

Thanks Pert.

I'll have a look and will post here if I find anything but it won't be right away - It would be nice to contribute something back in return for the help so I'll do my best.

Over and out for now.

Seamus