Library for SIM5320

I need to use the SIM5320A gsm on my project instead of the SIM800L (since the SIM800 doesn’t support 3G ). Although the AT commands are similar, they don’t match up completely using:
#define TINY_GSM_MODEM_SIM800
#include <BlynkSimpleSIM800.h

this is what I get:
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.6.1 on Arduino Mega

[3128] Modem init…
[3399] Connecting to network…
[5678] Network: Koodo
[5679] Connecting to sp.koodo.com
[180737] Connect GPRS failed

Hardware details: MEga 2560, SIM 800, Push Data
with a simple button and LED created, just to see if I can get this to work with this modem.

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  Attention! Please check out TinyGSM guide:
    http://tiny.cc/tiny-gsm-readme

  WARNING: GSM modem support is for BETA testing.

  This example shows how value can be pushed from Arduino to
  the Blynk App.

  NOTE:
  BlynkTimer provides SimpleTimer functionality:
    http://playground.arduino.cc/Code/SimpleTimer

  App project setup:
    Value Display widget attached to Virtual Pin V5
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

#define TINY_GSM_MODEM_SIM800

// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
//#define BLYNK_HEARTBEAT 30

#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "########################";

// Your GPRS credentials
// Leave empty, if missing user or pass
char apn[]  = "sp.koodo.com";
char user[] = "";
char pass[] = "";

// Hardware Serial on Mega, Leonardo, Micro
#define SerialAT Serial1

// or Software Serial on Uno, Nano
//#include <SoftwareSerial.h>
//SoftwareSerial SerialAT(2, 3); // RX, TX

TinyGsm modem(SerialAT);

BlynkTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(9600);

  delay(10);

  // Set GSM module baud rate
  SerialAT.begin(115200);
  delay(3000);

  // Restart takes quite some time
  // To skip it, call init() instead of restart()
  Serial.println("Initializing modem...");
  modem.restart();

  // Unlock your SIM card with a PIN
  //modem.simUnlock("1234");

  Blynk.begin(auth, modem, apn, user, pass);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.run(); // Initiates BlynkTimer
}

The SIM5320 is listed as being supportted by TinyGSM

SIMCom WCDMA/HSPA/HSPA+ Modules (SIM5360, SIM5320, SIM5300E, SIM5300EA)

I would have thought that

#define TINY_GSM_MODEM_SIM5360

would have been the correct modem to choose.

Pete.

indeed! that would seem to be ideal and probably a solution to try, but unfortunately that wasn’t a selection option provided anywhere.
Even in the list of supported devices from the Blynk configuration options listed on the web site: Cellular (GSM/3G/LTE)

  • SIMCom SIM800 series (SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868)
  • SIMCom SIM900 series (SIM900A, SIM900D, SIM908, SIM968)
  • A6/A7
  • M590
  • BG96
  • GPRSbee
  • Microduino GSM
  • Adafruit FONA (Mini Cellular GSM Breakout)
  • Adafruit FONA 800/808 Shield

So where would I change modem selection ?

if I simply comment out the prev ( ) and replace :
//#define TINY_GSM_MODEM_SIM800
#define TINY_GSM_MODEM_SIM5360
I get a compiler error since I suspect I still need an actual <BlynkSimpleSIM5360.h> to replace #include <BlynkSimpleSIM800.h>
??

Maybe you have an old version of the library?

// Select your modem:
#define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM868
// #define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_SIM7000
// #define TINY_GSM_MODEM_SIM5360
// #define TINY_GSM_MODEM_SIM7600
// #define TINY_GSM_MODEM_UBLOX
// #define TINY_GSM_MODEM_SARAR4
// #define TINY_GSM_MODEM_M95
// #define TINY_GSM_MODEM_BG96
// #define TINY_GSM_MODEM_A6
// #define TINY_GSM_MODEM_A7
// #define TINY_GSM_MODEM_M590
// #define TINY_GSM_MODEM_MC60
// #define TINY_GSM_MODEM_MC60E
// #define TINY_GSM_MODEM_ESP8266
// #define TINY_GSM_MODEM_XBEE
// #define TINY_GSM_MODEM_SEQUANS_MONARCH

Pete.

i double checked that,
TinyGSM version 0.7.9
Blynk version 0.6.1
as per Arduino IDE

I suspect that you are using an old code example then.
If you take a peek inside BlynkSimpleSIM800.h you’ll see that it says:

#warning "BlynkSimpleSIM800.h is deprecated. Please use BlynkSimpleTinyGSM.h"

If you look at the code example I linked to above, it uses:

#include <TinyGsmClient.h>
#include <BlynkSimpleTinyGSM.h>

Pete.

well, I’ve tried all those suggestions and here is what I’ve found using the TinyGSM library
From my Examples listed in the Arduino IDE, I’ve loaded the “AT_Debug” program (which sends inquiries to the modem at declining baud rates to determine what rate is its default).
The hardware connected is Mega using Serial 1 for RX/TX to the modem.
I have both a SIM800L and SIM5320A for testing and verification.
If I select #define TINY_GSM_MODEM_SIM800 with the 800L connected, I get successful connection!
If I select #define TINY_GSM_MODEM_SIM5360 with 5320A connected ( with the exact same hardware connections) I do not get any connection.

If I connect directly to the 5320 and use Putty terminal, I can connect and verify the module.
If I load a simple serial monitor in my Mega, I can communicate to the 5320A…

Then I tried something simple, I changed the name from:
#define TINY_GSM_MODEM_SIM5360
to
#define TINY_GSM_MODEM_SIM5320

and it worked! So for anyone else out there that wants to use this modem, you just have to change the name!! who would have thought it was that easy and quick!!

A post was merged into an existing topic: Library for SIM7000