I found interesting article about Huawei mobile router: https://blog.hqcodeshop.fi/archives/259-Huawei-E5186-AJAX-API.html In second comment someone named rvl provided his script to auto reboot by API if needed.
I tried to fix the indentation by myself. Here is a result http://pastebin.com/KqF5RsS0 I am not sure if it is correct. Not even sure which version of Python should I use to run it.
sabbath@dell ~> /usr/bin/python2 router-reboot-script.py
Traceback (most recent call last):
File "router-reboot-script.py", line 6, in <module>
import requests
ImportError: No module named requests
or
[sabbath@dell ~]$ python -m router-reboot-script.py
/usr/bin/python: Error while finding spec for 'router-reboot-script.py' (AttributeError: module 'router-reboot-script' has no attribute '__path__')
I have no Python skills. Can somebody help me figure it out how to run it?
edit
[sabbath@dell ~]$ sudo pip install requests
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python3.5/site-packages
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[sabbath@dell ~]$ sudo pip install --upgrade pip
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 686kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Successfully uninstalled pip-8.1.2
Successfully installed pip-9.0.1
[sabbath@dell ~]$ sudo pip install requests
Requirement already satisfied: requests in /usr/lib/python3.5/site-packages
[sabbath@dell ~]$ python -m router-reboot-script.py
/usr/bin/python: Error while finding spec for 'router-reboot-script.py' (AttributeError: module 'router-reboot-script' has no attribute '__path__')
[sabbath@dell ~]$ python router-reboot-script.py
Which version of python should I use, and what kind of parameter (like -m) should I use?