GSM_Generic Library to support many more boards besides MKRGSM 1400

GSM_Generic Library

How To Install Using Arduino Library Manager

Why do we need this GSM_Generic Library

This library is based on, modified, bug-fixed and improved from:

  1. MKRGSM Library

to add support to many boards besides Arduino MKR GSM 1400.

This GSM_Generic Library will finally provide these following features (certainly ony if supported by the GSM/GPRS modules)

  1. TCP Client and Server (HTTP, HTTPS , MQTT, Blynk, WebSockets, ...)
  2. UDP data connections
  3. USSD (Sending USSD requests and decoding 7,8,16-bit responses)
  4. SMS (Sending and Receiving)
  5. Voice Call (Making and Receiving)
  6. Location

Currently Supported modems

  • u-blox 2G, 3G, 4G, and LTE Cat1 Cellular Modems (many modules including LEON-G100, LISA-U2xx, SARA-G3xx, SARA-U2xx, TOBY-L2xx, LARA-R2xx, MPCI-L2xx)
  • u-blox LTE-M/NB-IoT Modems (SARA-R4xx, SARA-N4xx, but NOT SARA-N2xx). Not fully tested yet.

To be Supported modems

  • SIMCom SIM800 series (SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868)
  • SIMCom SIM900 series (SIM900A, SIM900D, SIM908, SIM968)
  • SIMCom WCDMA/HSPA/HSPA+ Modules (SIM5360, SIM5320, SIM5300E, SIM5300E/A)
  • SIMCom LTE Modules (SIM7100E, SIM7500E, SIM7500A, SIM7600C, SIM7600E)
  • SIMCom SIM7000E/A/G CAT-M1/NB-IoT Module
  • AI-Thinker A6, A6C, A7, A20
  • ESP8266 (AT commands interface, similar to GSM modems)
  • Digi XBee WiFi and Cellular (using XBee command mode)
  • Neoway M590, M590E
  • Sequans Monarch LTE Cat M1/NB1 (VZM20Q)
  • Quectel BG96
  • Quectel M95
  • Quectel MC60
  • Quectel M10, UG95
  • SIMCom SIM7020, SIM7020E
  • Telit GL865
  • ZTE MG2639
  • Hi-Link HLK-RM04
  • WIS800C, compatible to SIM900A, SIM800L, SIM800C

Releases v1.2.4

  1. Initial public release to add support to many boards / modules besides MKRGSM 1400 / SARA U201

Currently Supported Boards

  1. nRF52 boards, such as AdaFruit Feather nRF52832, nRF52840 Express, BlueFruit Sense, Itsy-Bitsy nRF52840 Express, Metro nRF52840 Express, NINA_B302_ublox, NINA_B112_ublox, etc.. Currently SSL WebClient is not working.
  2. SAM DUE
  3. SAMD21
  • Arduino SAMD21: ZERO, MKRs, NANO_33_IOT, etc.
  • Adafruit SAMD21 (M0): ItsyBitsy M0, Feather M0, Feather M0 Express, Metro M0 Express, Circuit Playground Express, Trinket M0, PIRkey, Hallowing M0, Crickit M0, etc.
  • SeeedStudio: LoRaWAN, Zero, Femto M0, XIAO M0, Wio GPS Board, etc.
  1. SAMD51
  • Adafruit SAMD51 (M4): Metro M4, Grand Central M4, ItsyBitsy M4, Feather M4 Express, Trellis M4, Metro M4 AirLift Lite, MONSTER M4SK Express, Hallowing M4, etc.
  • Seeeduino: WIO Terminal, Grove UI Wireless
  1. Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC)
  2. ESP32 including ESP32-S2 (ESP32-S2 Saola, AI-Thinker ESP-12K, etc.)
  3. ESP8266.
  4. STM32F/L/H/G/WB/MP1 boards (with 32+K Flash)
  5. Arduino Mega, Leonardo, etc. UNO, Nano to use Hardware Serial port

Examples:

  1. GSM_MQTT
  2. GSM_MQTTClient_Auth
  3. GSM_MQTTClient_Basic
  4. GSM_MQTT_Medium
  5. GSM_MQTT_ThingStream
  6. GSM_Blynk

and many more in Examples

Also check these blog posts (in Portuguese, please use Google Translate to convert to your language)

The library co-author / blogger is using nRF52840-based Nina_B302 board and u-blox SARA-G350 GSM/GPRS modem.

  1. U-BLOX NINA B302 + GSM ACCESSING THINGSTREAM.IO

  2. NINA B302 ACCESSING BLYNK VIA GSM - SARA G350

Hi, has there been any checking into the SMS functionality? I did a direct swap out of my working code that uses MKRGSM.h with the new lib (I'm using a MKRGSM1400, so the defaults in defines.h work (UBLOX) and ran the code. (a small change was highlighted in compile required with gsmAccess.begin() to include baudRateSerialGSM, PINNUMBER. (using Hologram SIM, PINNUMBER is null). SENDS from the MKR are working. Receives not so.
Using 115200 or 9600 baud rate, no change. (nothing received on SMS). I am using Holograms messaging to send SMS characters (1 at a time) for testing.
At baudrate of 115200 SMS available wasnt receiving anything. At 9600, nothing either.
I swapped back to just using MKRGSM.h, with 9600 baudrate on Serial (but no setting for gsmAccess.begin(), and SMS is working both ways (all characters previously sent via hologram were received) so its not a hardware / antenna issue.
I didnt see any configuration requirements in the defines.h file for SMS. Maybe I missed something needed for SMS?
(I had to uncomment out the GSM_RESETN/GSM_DTR to get gprs to connect btw).

  • hologram sim.
  • GPRS connects - sends - but not receiving

code snippets.

(in defines.h, these lines uncommented)
// Optional usage of GSM_RESETN and GSM_DTR. Need to be here only when true. Default is false

#define UBLOX_USING_RESET_PIN             true
#define UBLOX_USING_LOW_POWER_MODE        true


in main code using 9600 or 115200, no change to sms receives
#include "defines.h"    //  new 03.26 GSM info.  Used new GSM library. Dont include MKRGSM
// also has different syntax for gsmAccess.begin (see connectGSM)
unsigned long baudRateSerialGSM  = 9600;

// Include the GSM library
// #include <MKRGSM.h>
..



..
connect works here. 
bool connectGSM() {
  // 02.17 copied from github and modified to fit.
  // https://github.com/arduino-libraries/MKRGSM/issues/66
  // re-call of this will cause arduino mqtt to disconnect.
  gprs.setTimeout(180000);
  gsmAccess.setTimeout(180000);

  boolean connected = false;
  while (!connected) {
    if ((gsmAccess.begin(baudRateSerialGSM, PINNUMBER) == GSM_READY) &&
    // if ((gsmAccess.begin() == GSM_READY) &&
        (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
      connected = true;
    }
    else {
      delay(1000);
    }
  }
  return connected;
}

Thanks for testing the new library and posting the bug.

I'd appreciate it if you can repost this on GSM_Generic library Issues so that it's easier to follow up and more suitable. If not possible, please inform so that I'll copy and create the issue myself.

Regards,

Hi, thanks much. I'll link it. Sorry for post in wrong spot. I'm having trouble with github. Is it possible to post it there?
j

Hi @avonree

Thanks for your contribution which has been noted in Contributions and Thanks

The new GSM_Generic v1.3.0 has been published to fix the issue also with many more features

Please test and inform if the bug has been totally fixed.

Major Release v1.3.0

  1. Fix SMS receive bug.
  2. Add option to load Root Certs only when necessary for SSL.
  3. Add ThingStream MQTT(S) support and example.
  4. Add UDP functions to permit specify host
  5. Add GSM_LOGATDEBUG macro to help debug AT-command related functions
  6. Add support to SoftwareSerial
  7. Fully tested on u-blox SARA-G350 modem and nRF52-based NINA_B302_ublox board

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.