You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I add the debug output (I've obviously redacted the phone number - but that is all I have done):
>>> modem = Modem('/dev/ttyUSB3', baudrate="115200", debug=True)
Modem connected, debug mode enabled
>>> sms = modem.get_sms_list()
Sending: AT+CMGF=1
Sending: AT+CMGL="ALL"
Device responded: ['AT+CMGF=1', 'OK', 'AT+CMGL="ALL"', '+CMGL: 0,"REC READ","+************ ","","23/07/29,05:01:03+04"', '3rd Test Message Sent', '+CMGL: 1,"REC READ","+************ ","","23/07/29,05:04:04+04"', '4th test sms... this has to work', '+CMGL: 2,"REC READ","+************ ","","23/07/29,05:10:02+04"', "5th test. PLEASE python don't fail me now.", '+CMGL: 3,"REC READ","+************ ","","23/07/29,05:23:57+04"', "6th, this is a tad annoting why the code isn't working properly", '+CMGL: 4,"REC READ","+************ ","","23/07/29,05:30:17+04"', 'possibly final test for today', '', 'OK']
>>> sms = modem.get_sms(1)
Sending: AT+CMGF=1
Sending: AT+CMGR=1
Device responded: ['AT+CMGF=1', 'OK', 'AT+CMGR=1', '+CMGR: "REC READ","+************ ","","23/07/29,05:04:04+04"', '4th test sms... this has to work', '', 'OK']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/dist-packages/sim_modem.py", line 655, in get_sms
"slot": read[1].split(":")[1].split(",")[0].strip(),
IndexError: list index out of range
I can't decipher all the splits in the return section:
The kind of TL;DR is is does read the SMS from the module, but it seems, in python 3.9 at least, the convertion to a dict for the output no longer works as expected...
Firmware of module is: LE20B03SIM7600M22 (not that I can find much by way of reliable info on any newer versions - I'm not daft enough to download files from random website!)
The text was updated successfully, but these errors were encountered:
Getting really odd behaviour with the get_sms() function.
When I add the debug output (I've obviously redacted the phone number - but that is all I have done):
I can't decipher all the splits in the return section:
The kind of TL;DR is is does read the SMS from the module, but it seems, in python 3.9 at least, the convertion to a dict for the output no longer works as expected...
Firmware of module is: LE20B03SIM7600M22 (not that I can find much by way of reliable info on any newer versions - I'm not daft enough to download files from random website!)
The text was updated successfully, but these errors were encountered: