pulkin / micropython

MicroPython implementation on Ai-Thinker GPRS module A9 (RDA8955)
https://micropython.org
MIT License
103 stars 30 forks source link

SMS Error object has no attribute 'SMS_RECEIVED' #96

Closed marcosasilvalepe closed 3 years ago

marcosasilvalepe commented 3 years ago

Hi! I've been trying to read SMS using example_41_sms.py but when the SMS is received I get the following error:

Traceback (most recent call last): File "/t/main.py", line 16, in sms_handler AttributeError: 'module' object has no attribute 'SMS_RECEIVED'

Has anyone had this problem ?

pulkin commented 3 years ago

That example might be outdated since e7bfbb23e4f86d6d9dd05776cda569ba0d7aa275.

marcosasilvalepe commented 3 years ago

OK, got it!

Doing else insead of elif on line 16 solved it. Thanks.

Dracoit commented 1 year ago

Thanks marcosasilvalepe,

After the fix, I still received a warning as follows: "Warning: Failed to poll all SMS: the list may be incomplete" when issued the command -> cellular.SMS.list(). as I can see from the output there was some SMS shown as None: Samp: [ "Msg 1", "Msg 2", ..., None, None..] but after every call of the function, the msg starts appearing and the None is no more visible. Now it shows no error.

just a fix for the warning that I was facing.