SIM7080 telecom hat vs SIM900 GSM/GPRS shield

Hello everyone,
As I'm using a SIM900 GSM/GPRS board build to use with Arduino UNO with a CH340 USB driver, so the boards are connected through quick install pins (male SIM board/female Arduino UNO).
I saw before people still has issues to get the GSM board working.
Be aware to use a 2G SIM card and not a new 4G/5G one, because it will not work as the SIM900 uses 2G.
This is the code I'm using:

#include <SoftwareSerial.h>

// Wiring
/*
GSM/GPRS shield only works on 2G, only with an old 2G sim card it will work and only as long 2G will be available.

12 Vdc comes from a transformator to power on RY1.
5V comes from a 12V battery and a 5 Vdc converter 3A. 
Battery + goes to the COM on RY1 and NC goes to the 12 Vdc + input on the DC converter.
Battery GND goes to the DC converter GND input.
5Vdc from the converter: GND goes to the Arduino UNO and GSM shield power supply GND.
5Vdc + goes to RY2 coil pin.
RY2 coil pin GND supply comes from Arduino pin 13.
Place jumpers on J1 and J2 (sometimes J11 and J12).
Only RY1 and the DC-DC converter will be powered with 12V!
The GSM shield will send a sms on power failure, battery will start up the Arduino and gsm shield.
* GSM shield                Arduino            RY2:5V             RY1		12Vdc 		Battery +	Conv		    
* 5V from DCconv            VINN               5V                   
* GND                       GND                COIL-                          
*                                                                 
* J1                        7
* J2                        8
*                           13                 COIL+                                    
* PWRKey                                       COM
* PWRKey                                       NC 
*								  12 Vdc	RY1 coil
*								  BAT              		RY1 COM
*								  Conv	     					RY1 NC
*
*/

int pinStartUp = 13;  // Used to start up the GSM shield
int i = 0;
//Create software serial object to communicate with SIM900
SoftwareSerial SIM900(7, 8); //SIM900 Tx & Rx is connected to Arduino #7 & #8

void setup()
{
  //Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(19200);
  //Begin serial communication with Arduino and SIM900
  SIM900.begin(19200);
  //Begin serial communication with Arduino and SIM900
  if (i == 0)
  {
  SIM900power();
    i++;
  }
  delay(500);
  Serial.println("Initializing..."); 
  SIM900.println("AT"); //Handshaking with SIM900
  updateSerial();
  SIM900.println("AT+CMGF=1"); // Configuring TEXT mode
  updateSerial();
  SIM900.println("AT+CMGS=\"+ZZxxxxxxxxx\"");//change ZZ with country code and xxxxxxxxxxx with phone number used to receive sms
  updateSerial();
  SIM900.print("Power failure\r"); //text content
  updateSerial();
  SIM900.write(26);
}

void loop()
{
  updateSerial();
}

void updateSerial()
{
  delay(500);
  while (Serial.available()) 
  {
    SIM900.write(Serial.read());//Forward what Serial received to Software Serial Port
  }
  while(SIM900.available()) 
  {
    Serial.write(SIM900.read());//Forward what Software Serial received to Serial Port
  }
}

void SIM900power()
{
  // Start up the SIM900 via the PWR key
  pinMode(pinStartUp, OUTPUT);
  digitalWrite(pinStartUp, HIGH);
  Serial.println("Start up SIM900");
  digitalWrite(pinStartUp, LOW);
  delay(2000);
  Serial.println("Done starting up SIM900");
  delay(15000);
}

Later as everyone knows 2G won't work in the future, so I bought a SIM7080 telecom hat, so I will have to code again.
When it works, I will share it too.

Hello everyone,

As the character says I'm new to the community, well actualy I'm not, but I'm unable to login to the old character Dingsken.
As I'm using a SIM900 GSM/GPRS shield at the moment to send out text on power-failure.
I use the shield since years and had some problems this week with a new 5G SIM card, so opened the boxed shields and thought something was wrong with one of the boards, but it was the SIM card which caused the problem, a SIM900 corresponds on 2G network and not on the new higher ones.
But as everyone knows soon 2G will disappear, so I bought a SIM7080G extension hat card for Raspberry but I will build it for Arduino UNO or for the ESP32 not sure at the moment.
I'm familiar with programming but is there already someone who made a successfull sketch which can be used as a start?

Cheers Dingsken.

This?

It communicates via serial port, so you shouldn't have any major problems using it.

Check out the link; it has a lot of useful information.

Hello @rudyvdp

I've merged your two topics on the same subject. Please do not cross-post as it wastes peoples time.

Yes it's that one.
So it’s actually more or less same code.
Thank you.

@MaximoEsfuerzo Do you have a sketch already written for the Waveshare hat?

No.
I don't have the hat either... :wink:

No problem, when I have written the sketch and get the board working, I'll share the project.