MKRGSM sms lenght / Serial read / Cut at 120 characters

I send a sms with a lenght of 128 characters to the MKR1400.
The max lenght of a sms is 156 characters.

When i use the example sketch for receiving sms:

while ((c = sms.read()) != -1) {
      Serial.print((char)c);
    }
    Serial.println("\nEND OF MESSAGE");
    // Delete message from modem memory
    sms.flush();
    Serial.println("MESSAGE DELETED");
  }

I get the following output:
Sms Text blablablbalbalbalbalbalbalbalbalablabalbalbalablabblbslbdslfbslfdblsdbflsdblbslblbalbalbablbalbalbalbalbalbalba
11:25:07.825 → END OF MESSAGE
11:25:07.863 → MESSAGE DELETED

And the in like a second sms

11:25:09.872 → Message received from:
11:25:09.872 → +41786025000
11:25:09.872 → Sms Rest Text
11:25:09.872 → END OF MESSAGE
11:25:09.910 → MESSAGE DELETED

So the sms is divided in like to sms after 120 characters. But i want it in one piece stored in a string. I do it like this (which worksperfectly to the first 120 characters…;=(

while ((c = sms.read()) != -1) {  
       Config_SMS += char(c);
      }

Any tgoughts? Thx

Any thoughts?

I found it out, excuse my disturbance, here the answer if someone with the same prob finds this topic:

Unlike my example i used special characters in my sms ( | ) . These characters uses more bytes so the lenght of the sms decreases. The function in the lib is correct.

ERGO : if you want to send a long sms don’t use special characters! I’m too lazy now to search for the specs…

The max lenght of a sms measured in characters are meant in “normal” characters, with umlaute, special characters etc the “lenght” is shorter.

The lib is correct:

int GSM_SMS::read()
{
int bufferLength = _incomingBuffer.length();

if (_smsDataIndex < bufferLength && _smsDataIndex <= _smsDataEndIndex) {
return _incomingBuffer[_smsDataIndex++];
}

return -1;
}

yes if you send text in UTF8 or UNICODE you will have multiple bytes per glyph (symbol/character) and you'll overflow the storage capacity of 1 SMS

if you stick to pure ASCII then you should not see the issue

Or, you can graduate to Grade 1, and start using multi-part text messages !