sim800L mit der Library

Der Code den ich gepostet habe ist der angepasste Beispielcode aus der Library. Der Author hat selber die URL falsch geschrieben in der Example Code file.

Mein Code der geht mit dem Sim800L ist komplett auf AT gestützt und eigenkonstruktion.
Wolle jetzt aber eben mit dem o.g. code das schäner gestalten.

Das hier ist mein eigener funktionierender code:

#include <SoftwareSerial.h>

String Grsp;

SoftwareSerial SIM800(2, 3); // SIM800 TX to D2 / RX to D3

void setup() {
//  Begin Serial Connection
Serial.begin(9600);

// Connect SIM800 to Serial
SIM800.begin(9600);
delay(1000);
Serial.println("Initialisiere Modem ...");
delay(1000);

// Handshake SIM800
SIM800.println("AT");
updateSerial();

// Check netquality
SIM800.println("AT+CSQ");
updateSerial();

// Check if Network is connected
SIM800.println("AT+CREG?");
updateSerial();

// Set Textformat of Messages to plain text
SIM800.println("AT+CMGF=1");
updateSerial();

// Send new SMS directly to Arduino and delete on SIM800
SIM800.println("AT+CNMI=1,2,0,0,0");
updateSerial();
}

void loop() {
  // put your main code here, to run repeatedly:
updateSerial();
}


void updateSerial()
{
  delay(500);
  while (Serial.available()) // Check if Serial is enabled
  {
  SIM800.write(Serial.read()); // Send data from SIM800 to softwareserial port
  }
    while (SIM800.available())
  {
    String sms = SIM800.readString();
    Serial.println(sms);
  }
}

Nur mit der Library wollte ich für mein komplettprojekt das etwas aufwendiger wird als nur eine SMS zu lesen es etwas besser gestelten und darum die library verwenden (hatte erst ohne versucht um die funktionsweise erstmal zu verstehen)

EDIT:
Habe jetzt nochmal die Library complett neu installiert und das simpelste Example genommen (readSms). Es passiert nix. Serial Monitor bleibt entgegen meiner AT-Commands lösung einfach nuer leer. nix.

/* 
 *  This library was written by Vittorio Esposito
 *    https://github.com/VittorioEsposito
 *
 *  Designed to work with the GSM Sim800L.
 *
 *  ENG
 *    This library uses SoftwareSerial, you can define RX and TX pins
 *    in the header "Sim800L.h", by default pins are RX=10 and TX=11.
 *    Be sure that GND is connected to arduino too. 
 *    You can also change the RESET_PIN as you prefer.
 *  
 *  ESP
 *    Esta libreria usa SoftwareSerial, se pueden cambiar los pines de RX y TX
 *    en el archivo header, "Sim800L.h", por defecto los pines vienen configurado en
 *    RX=10 TX=11.  
 *    Tambien se puede cambiar el RESET_PIN por otro que prefiera
 * 
 *  ITA
 *    Questa libreria utilizza la SoftwareSerial, si possono cambiare i pin di RX e TX
 *    dall' intestazione "Sim800L.h", di default essi sono impostati come RX=10 RX=11
 *    Assicurarsi di aver collegato il dispositivo al pin GND di Arduino.
 *    E' anche possibile cambiare il RESET_PIN.
 *
 *
 *   DEFAULT PINOUT: 
 *        _____________________________
 *       |  ARDUINO UNO >>>   Sim800L  |
 *        -----------------------------
 *            GND      >>>   GND
 *        RX  10       >>>   TX    
 *        TX  11       >>>   RX
 *       RESET 2       >>>   RST 
 *                 
 *   POWER SOURCE 4.2V >>> VCC
 *
 *
 *  SOFTWARE SERIAL NOTES:
 *
 *    PINOUT
 *    The library has the following known limitations:
 *    1. If using multiple software serial ports, only one can receive data at a time.
 *    2. Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).
 *    3. Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
 *    4. On Arduino or Genuino 101 the current maximum RX speed is 57600bps
 *    5. On Arduino or Genuino 101 RX doesn't work on Pin 13
 *  
 *    BAUD RATE
 *    Supported baud rates are 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 31250, 38400, 57600, and 115200.
 *
 *
 *  Edited on:  December 24, 2016
 *    Editor:   Vittorio Esposito
 *    
 *  Original version by:   Cristian Steib
 *        
 *
*/

#include <Sim800L.h>
#include <SoftwareSerial.h>               

#define RX  2
#define TX  3
#define RESET 4

Sim800L GSM(RX, TX, RESET);

/*
 * In alternative:
 * Sim800L GSM;                       // Use default pinout
 * Sim800L GSM(RX, TX, RESET);        
 * Sim800L GSM(RX, TX, RESET, LED);
 */
 
/*
 * NOTICE:
 * FOR THIS TO WORK YOU HAVE TO INCREASE RX BUFFER SIZE
 * Open SoftwareSerial.h and change _SS_MAX_RX_BUFF to 256
 *
 */

void setup() {
  Serial.begin(9600);
  GSM.begin(4800);
  GSM.delAllSms(); // this is optional
  while(!GSM.prepareForSmsReceive())
  {
    delay(1000);
  }
}

void loop() {
  byte index = GSM.checkForSMS();
  if(index != 0)
  {
  	Serial.println(GSM.readSms(index));
  }
}

Spoiler: Das mit der Buffegröße habe ich schon gemacht gehabt :wink: