You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 lines
303 B

import pygsm
modem = pygsm.GsmModem("/dev/ttyS0", baudrate=115200, timeout=1)
modem.boot()
for i in range(25):
try:
temp = modem.command('AT+CMGR=' + str(i+1)+',1')
if "REC READ" in temp[0]:
modem.query('AT+CMGD=' + str(i+1))
except:
pass