Great question — answering as the UphillTech team:
The fourth parameter in AT+CSMP sets the coding scheme, i don't remember in which document i've found the coding of this byte but bit 7 sets whether the message should be discarded after showing it class 0 or stored You should set this bit to 1 to make it storable, so changing rval = sp.SendCommand("AT+CSMP=17,167,0,16"); to rval = sp.SendCommand("AT+CSMP=17,167,0,144"); should do the work
Full answer by colmo: https://stackoverflow.stackexchange.com/a/53391592 (CC BY-SA 4.0).
Need it done for your business? UphillTech.