Civlo85 / gsmHat

Using the Waveshare GSM/GPRS/GNSS Hat for Raspberry Pi with Python
MIT License
61 stars 26 forks source link

Program errors out if SIM can't support 20 messages. #18

Open xathon opened 1 year ago

xathon commented 1 year ago

https://github.com/Civlo85/gsmHat/blob/f8e4bf75f29f4c96926e3053e268f461ff3584cb/gsmHat/gsmHat.py#L540-L543

This codeblock assumes that a SIM can always store a total of 20 SMS. However, this isn't always the case. The output of AT+CPMS="SM" should be used to determine the maximum storage, since the HAT will raise an error if a slot that's too high is access ed.