-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SMS forwarder example #28
base: master
Are you sure you want to change the base?
Conversation
Added a feature to allow the recipient of the forwarded SMSs to respond |
Running this locally, I've been encountering the below error:
It appears model.json might not always contain the requested data? information() might need to retry the request in the event that an error is raised. For now I've set up my loop to catch that error and retry from outside. |
Thank you. I don't have time to look into this right now but will keep this open until I do. |
Sorry for the delay, testing this now. I do not get the traceback, is it frequent for you? Does it happen when idle or only when forwarding a message? I am using Netgear LB2120, do you have the same modem? |
Never mind, I did get the error shortly after posting :-). I will look into that. |
My findings so far: running with a 5 second interval and keep-alive seems to break the session eventually and reauthentication fails. Setting the sleep time to 10 seconds seems to resolve this. It can also be avoided by creating the session like this:
The real fix would be to get the autologin to work properly but I am not yet sure how that is best done. |
Love the library, thank you. I added an example of how one might make an SMS forwarder loop to retrieve messages sent to the SIM in the gateway and forward them to another device. Users could adapt it to forward messages to another messaging system if they prefer. I couldn't find any example showing usage of _sms_events and self.listeners, hope this serves as documentation for that. This code is published under the MIT license.
I used f-strings, if you want to support versions of python before 3.6 I can swap the f-string for .format.