Giter Club home page Giter Club logo

huawei-lte-api's Introduction

huawei-lte-api

API For huawei LAN/WAN LTE Modems, you can use this to simply send SMS, get information about your internet usage, signal, and tons of other stuff

Tox tests

Please consider sponsoring if you're using this package commercially, my time is not free :) You can sponsor me by clicking on "Sponsor" button in top button row. Thank You.

Tested on:

3G/LTE Routers:

  • Huawei B310s-22
  • Huawei B315s-22
  • Huawei B525s-23a
  • Huawei B525s-65a
  • Huawei B715s-23c
  • Huawei B528s
  • Huawei B535-232
  • Huawei B628-265
  • Huawei B612-233
  • Huawei B818-263
  • Huawei E5186s-22a
  • Huawei E5576-320
  • Huawei E5577Cs-321
  • Huawei E8231
  • SoyeaLink B535-333

3G/LTE USB sticks:

(Device must support NETWork mode aka. "HiLink" version, it wont work with serial mode)

  • Huawei E3131
  • Huawei E3372
  • Huawei E3531

5G Routers:

  • Huawei 5G CPE Pro 2 (H122-373)
  • Huawei 5G CPE Pro (H112-372)

(probably will work for other Huawei LTE devices too)

Will NOT work on:

LTE Routers:

  • Huawei B2368-22 (Incompatible firmware, testing device needed!)
  • Huawei B593s-22 (Incompatible firmware, testing device needed!)

Installation

PIP (pip3 on some distros)

$ pip install huawei-lte-api

Repository

You can also use these repositories maintained by me

Debian and derivatives

Add repository by running these commands

$ wget -O- https://repository.salamek.cz/deb/salamek.gpg | sudo tee /usr/share/keyrings/salamek-archive-keyring.gpg
$ echo "deb     [signed-by=/usr/share/keyrings/salamek-archive-keyring.gpg] https://repository.salamek.cz/deb/pub all main" | sudo tee /etc/apt/sources.list.d/salamek.cz.list

And then you can install a package python3-huawei-lte-api

$ apt update && apt install python3-huawei-lte-api

Archlinux

Add repository by adding this at end of file /etc/pacman.conf

[salamek]
Server = https://repository.salamek.cz/arch/pub/any
SigLevel = Optional

and then install by running

$ pacman -Sy python-huawei-lte-api

Gentoo

$ emerge dev-python/huawei-lte-api

Usage

from huawei_lte_api.Client import Client
from huawei_lte_api.Connection import Connection

# with Connection('http://192.168.8.1/') as connection: For limited access, I have valid credentials no need for limited access
with Connection('http://admin:[email protected]/') as connection:
    client = Client(connection) # This just simplifies access to separate API groups, you can use device = Device(connection) if you want

    print(client.device.signal())  # Can be accessed without authorization
    print(client.device.information())  # Needs valid authorization, will throw exception if invalid credentials are passed in URL


# For more API calls just look on code in the huawei_lte_api/api folder, there is no separate DOC yet

Result dict

{'DeviceName': 'B310s-22', 'SerialNumber': 'MY_SERIAL_NUMBER', 'Imei': 'MY_IMEI', 'Imsi': 'MY_IMSI', 'Iccid': 'MY_ICCID', 'Msisdn': None, 'HardwareVersion': 'WL1B310FM03', 'SoftwareVersion': '21.311.06.03.55', 'WebUIVersion': '17.100.09.00.03', 'MacAddress1': 'EHM:MY:MAC', 'MacAddress2': None, 'ProductFamily': 'LTE', 'Classify': 'cpe', 'supportmode': None, 'workmode': 'LTE'}

Code examples

Some code examples are in /examples folder

Monitoring

SMS

Ports to other languages

Donations

  • 250 CZK (9,79 EUR) for B535-232 fund, thx @larsvinc !
  • 371,69 CZK (14,32 EUR) by Oleg Jusaew

huawei-lte-api's People

Contributors

1fexd avatar a-p-z avatar andreock avatar avilabss avatar blazejpawlak avatar cagnulein avatar cedric-dufour avatar herbetom avatar icetee avatar ilarrain avatar j-broo avatar jeffreykog avatar lazka avatar mehdiirh avatar salamek avatar sciunczyk avatar scop avatar thelime1 avatar zewelor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

huawei-lte-api's Issues

net.network() auth issue

Hi, i'm using your lib every day, thanks for your work!
I've encountered a strange issue about client.net.network().
As you can see from the script below, the client.device.information() works so the authentication process is ok, but when i try to print the net.network() it gives me an error. What do you think?

from huawei_lte_api.Client import Client
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
from huawei_lte_api.Connection import Connection
from huawei_lte_api.api.Net import Net

connection = AuthorizedConnection('http://admin:[email protected]/')
client = Client(connection)
signal = client.device.signal()
print(client.device.information())
info = client.device.information()

net = Net(connection)
print(client.net.network())
print(client.net.register())

{'Msisdn': 'XXXX', 'submask': '255.255.255.255', 'workmode': 'LTE', 'WebUIVersion': '21.100.44.00.03', 'SoftwareVersion': '11.189.61.00.1217', 'Imsi': 'XXXX', 'MacAddress2': None, 'HardwareVersion': 'WL1B520FM', 'wan_dns_address': 'XXXX', 'WanIPv6Address': None, 'Iccid': 'XXX', 'DeviceName': 'B525s-23a', 'wan_ipv6_dns_address': None, 'supportmode': 'LTE|WCDMA|GSM', 'Imei': 'XXXX', 'Classify': 'cpe', 'WanIPAddress': '10.225.163.102', 'SerialNumber': 'XXXX', 'ProductFamily': 'LTE', 'MacAddress1': 'XXXXXX'} Traceback (most recent call last): File "router.py", line 19, in <module> print(client.net.network()) File "/usr/local/lib/python3.5/dist-packages/huawei_lte_api/AuthorizedConnection.py", line 20, in wrapped return fn(*args, **kw) File "/usr/local/lib/python3.5/dist-packages/huawei_lte_api/api/Net.py", line 15, in network return self._connection.get('net/network') File "/usr/local/lib/python3.5/dist-packages/huawei_lte_api/Connection.py", line 137, in get return self._check_response_status(self._process_response_xml(response.content)) File "/usr/local/lib/python3.5/dist-packages/huawei_lte_api/Connection.py", line 37, in _process_response_xml return xmltodict.parse(xml, dict_constructor=dict) File "/usr/local/lib/python3.5/dist-packages/xmltodict.py", line 330, in parse parser.Parse(xml_input, True) xml.parsers.expat.ExpatError: no element found: line 1, column 0

Documentation

We need to create documentation for all endpoints

  • Code comments
  • Generated docs

Device.control() info please

Hi,

I saw a method (set_control) which calls Device.control with 4 as default argument. I also saw value 1 as the way to reboot the router. My watchdog program currently reboots my router when it notices that no bytes have been received during the last monitoring interval, but as the router also performs switch duties in the local LAN, I would actually like to just disconnect it from LTE and then reconnect. So, what does device.control(4) do, and how can I disconnect and reconnect the router to my mobile internet provider?

Remove @autohorized_call enforcement

Whether some method requires authentication or not varies between devices, and I suspect even between firmware revisions. The @authorized_call decorators may result in some methods not even being tried with unauthorized connections, even if they would work just fine.

I'm not fully aware of the reasoning/need for the decorator or the enforcement in the first place, so not submitting a PR. But I think it would good at least if there was no AuthorizedConnection enforcement in effect at all -- if a method that requires authorization is attempted, it'll just raise a ResponseErrorLoginRequiredException which is just fine. Perhaps just change the decorator to do enforce_authorized_connection only if there is an AuthorizedConnection there, and do nothing if not.

Provide better error when pointed to something else than a Huawei LTE device

$ python x.py 
Traceback (most recent call last):
  File "x.py", line 8, in <module>
    connection = Connection('http://httpbin.org/')
  File "[...]/huawei_lte_api/Connection.py", line 45, in __init__
    self._initialize_csrf_tokens_and_session()
[...]
xml.parsers.expat.ExpatError: syntax error: line 1, column 54

Should provide a more indicative error than a generic XML parse one. Preferably something that the user code can examine to determine that the server is not a Huawei LTE device (e.g. somehow the 404 passed through). Perhaps should not try parsing XML for 404's, use requests' raise_for_error selectively (or everywhere except selectively not) etc.

Max sessions reached

After a couple of successful executions of the sample code provided in the readme,
I get errors (No rights, already logged in...).

Then I try to login on the user interface and I read a message like "Max sessions reached, cannot login".

I wait something like 10 minutes and I can enter again.

My guess is that API does not do the "logout" when it finishes, am I missing something?

I'm on Huawei B525s-23a

Thank you

image

SMS not working for B535-232

This api seems to work great for the B535 as well, with the exception of the send_sms function:

client.sms.send_sms(['RETRACTED_NUMBER'],"Test")
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/api/Sms.py", line 107, in send_sms
)), dicttoxml_xargs=dicttoxml_xargs)
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 22, in wrapped
return fn(*args, **kw)
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 140, in post
data = self._check_response_status(self._process_response_xml(response))
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 91, in _check_response_status
error_code
huawei_lte_api.exceptions.ResponseErrorException: 100005: Unknown

Is there a way I can help debugging this to enable sms also for the B535. Ironically most of the other sms API works.

Install issue: TypeError: 'encoding' is an invalid keyword argument for this function

pip install huawei-lte-api
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting huawei-lte-api
  Using cached https://files.pythonhosted.org/packages/ef/0a/e8cb71f836aba163f0bb8f8695ee9a11c2a83a506eaddc4b6ce9d309097e/huawei-lte-api-1.1.4.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-YKM6TX/huawei-lte-api/setup.py", line 23, in <module>
        long_description=open('README.md', encoding='utf-8').read(),
    TypeError: 'encoding' is an invalid keyword argument for this function
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-YKM6TX/huawei-lte-api/

Send AT Commands

Nice work.
I have been searching on the API, and I could not find a way. I would like to know if I could send:
"AT^NVRDEX=50503,0,128" without opening the case.
it will show NV codes in hash format.

USSD Request

Hi,
Is there current support to run ussd requests using the api?

client.sms.send_sms() Not sending message

Hi All,

I'm trying to send a sms with the api. Here is my code:


print(client.sms.config())
print(client.sms.send_sms(["+34608113201"], "Hi, check the plug"))

this is the output of the prints:

{'SaveMode': '0', 'Validity': '10752', 'Sca': '+34656000311', 'UseSReport': '0', 'SendType': '1', 'pagesize': '20', 'maxphone': '50', 'import_enabled': '1', 'url_enabled': '1', 'cdma_enabled': '0', 'smscharlang': '0', 'smsisusepdu': '0', 'sms_center_number_editabled': '0', 'sms_forward_enable': '0', 'switch_enable': '0', 'country_number': None, 'phone_number': None}
OK

But there is no SMS on the destination phone

Any idea why?

regards.

*Testing Hardware needed*

Why ?

Testing HW is needed to properly maintain this library and to solve some issues:
#4 I need real HW to write full coverage unittests (i will ~use dumped responses in tests)
#1 I need real HW to write full documentation
#2 I need real HW to test this functionality and add some input FW tests to prevent bricking the device

What ?

All currently supported devices are needed or at least one of them with most of functionality enabled (Checked devices are collected/not needed anymore):

  • Huawei B310s-22 (Bought by my self for 480 CZK)
  • Huawei E3372 (Donated by @SCiunczyk)
  • Huawei B525s-23a
  • Huawei B525s-65a
  • Huawei B715s-23c
  • Huawei E3131
  • Huawei E5186s-22a
  • Huawei B535-232

... any other device using same admin interface...

How ?

  • You can send me a real HW, contact me via email in my account detail for shipping information (I live in Czech Republic BTW).

  • You can donate money to buy these devices (i will try to find some cheap in used condition on auction sites etc. if posible) via donate button on top of this project (PayPal, Patreon, Crypto). You can specify what device i should buy for that donation.

All HW/"money for HW" donations will be listed on end of README.md (Or not if you will not want to be listed)

Thank You!

dump.py checked with B818-263

Hi Salamek,

I ventured to try your listed api/ endpoints on my Huawei "B818-263" aka "HUAWEI 4G Router 3 Prime"
the results are in the attached file. I left out every endpoint that resulted in error 100003, which seems to be the equivalent for 404, wheras errors 100001,100002 and 100005 seem to inidicate, that additional information is required.. I used login for all entries.

Hardware Version: WL3818M
Software Version: 10.0.2.2(H190SP1C983&#41
WebUI Version: WEBUI 10.0.2.2&#40WS2SP2C7201&#41

Feel free to ask for assistance on my type of router.

MulMic

dump-B818-263.zip

Question

Is there any way to have telnet/ssh access to the router?
If not I might get one and start inspecting it.

Connection to E5186s-22a failed. 125002: Session error

I'm trying to connect to my huawei lte with the code example from README.md. Can someone please tell me what I'm doing wrong. I'm using Python 3.7.5 and ip/username/pwd are correct. Thank you!

from huawei_lte_api.Client import Client
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
from huawei_lte_api.Connection import Connection

connection = AuthorizedConnection('http://admin:[email protected]/')

client = Client(connection) # This just simplifies access to separate API groups

print(client.device.signal()) # Can be accessed without authorization
print(client.device.information())

and this is the result:

root@firewall:/root# python3 test.py
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 22, in wrapped
return fn(*args, **kw)
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 169, in get
return self._check_response_status(self._process_response_xml(response))
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 91, in _check_response_status error_code
huawei_lte_api.exceptions.ResponseErrorLoginCsrfException: 125002: Session error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "test.py", line 7, in
connection = AuthorizedConnection('http://admin:[email protected]/')
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/AuthorizedConnection.py", line 24, in
init
if self.user.login(True):
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/api/User.py", line 76, in login
state_login = self.state_login()
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/api/User.py", line 27, in state_login
return self._connection.get('user/state-login')
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 25, in wrapped
return fn(*args, **kw)
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 169, in get
return self._check_response_status(self._process_response_xml(response))
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/Connection.py", line 91, in _check_response_status
error_code
huawei_lte_api.exceptions.ResponseErrorLoginCsrfException: 125002: Session error

Caused by SSLError(SSLError("bad handshake

Hi,

everything was working until an autoupdate of the router, I believe. Now it cannot accept self-signed router SSL certificate.
Is there an option we should use to accept all certificates or ignore it?

B535-232
Current version: 10.0.1.1(H191SP4C983)

python3-huawei-lte-api/unknown,now 1.4.14-1 all [installed]


send_sms.py:

import sys
from huawei_lte_api.Client import Client
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
from huawei_lte_api.Connection import Connection

connection = AuthorizedConnection('http://admin:[email protected]/')
client = Client(connection) # This just simplifies access to separate API groups, you can use device = Device(connection) if you want

print(client.sms.send_sms([sys.argv[1]], sys.argv[2]))

python3 send_sms.py NUMBER MSG

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 453, in wrap_socket
cnx.do_handshake()
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1915, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 1647, in _raise_ssl_error
_raise_current_error()
File "/usr/lib/python3/dist-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 841, in validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 344, in connect
ssl_context=context)
File "/usr/lib/python3/dist-packages/urllib3/util/ssl
.py", line 357, in ssl_wrap_socket
return context.wrap_socket(sock)
File "/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py", line 459, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])",)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='10.0.0.2', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "send_sms.py", line 7, in
connection = AuthorizedConnection('http://admin:[email protected]/')
File "/usr/lib/python3/dist-packages/huawei_lte_api/AuthorizedConnection.py", line 21, in init
super().init(clear_url, timeout=timeout)
File "/usr/lib/python3/dist-packages/huawei_lte_api/Connection.py", line 45, in init
self._initialize_csrf_tokens_and_session()
File "/usr/lib/python3/dist-packages/huawei_lte_api/Connection.py", line 109, in _initialize_csrf_tokens_and_session
response = self.session.get(self.url, timeout=self.timeout)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 668, in send
history = [resp for resp in gen] if allow_redirects else []
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 668, in
history = [resp for resp in gen] if allow_redirects else []
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 247, in resolve_redirects
**adapter_kwargs
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='10.0.0.2', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))

New hardware

I've tried to integrate my B528s in Home Assistant and it seems to work well. I don't know if I can do something to provide more info.
I've not tried sms.

pytest-runner deprecation

Hi,

from https://pypi.org/project/pytest-runner/ :

Deprecation Notice
pytest-runner depends on deprecated features of setuptools and relies on features that break security mechanisms in pip. For example ‘setup_requires’ and ‘tests_require’ bypass pip --require-hashes. See also pypa/setuptools#1684.

It is recommended that you:

Remove ‘pytest-runner’ from your ‘setup_requires’, preferably removing the setup_requires option.
Remove ‘pytest’ and any other testing requirements from ‘tests_require’, preferably removing the setup_requires option.
Select a tool to bootstrap and then run tests such as tox

Add working models

Hi, i test API with two models and it going well for now.
I just need two methods, and works well:

  • client.device.signal()
  • client.device.information()
    The models are: e8372 y e3372
    Regards!

Invalid json from at least get_sms_list

#!/usr/bin/python3.8

from huawei_lte_api.Client import Client
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
import sys

connection = AuthorizedConnection('http://admin:[email protected]/')
client = Client(connection)

print(client.sms.get_sms_list())

client.user.logout()

I got:

{'Count': '2', 'Messages': {'Message': [{'Smstat': '0', 'Index': '40001', 'Phone': 'ho.', 'Content': 'Ti informiamo che la tua offerta si è rinnovata. Il prossimo rinnovo è fra un mese a partire da oggi.', 'Date': '2021-03-26 08:09:02', 'Sca': None, 'SaveType': '0', 'Priority': '0', 'SmsType': '2'}, {'Smstat': '0', 'Index': '40000', 'Phone': 'ho.', 'Content': 'La tua offerta si rinnoverà fra 2 giorni. Assicurati di avere credito disponibile sull’app o chiamando gratuitamente il 42121.', 'Date': '2021-03-24 08:07:38', 'Sca': None, 'SaveType': '0', 'Priority': '0', 'SmsType': '2'}]}}

Json validator says that it is invalid, infact I can't parse it with jq.

'Sca': None
should be
'Sca': 'None'

( missing single quote)

All strings should have double quote.

I can get a valid json with the following ( just for example ):

./huawei_sms.py | sed "s:None:'None':g" | sed "s:':\":g"

+ sign disapper

Hi
I'm using B315 Huawei LTE router.
When I tried to send SMS by API with python, i got OK but SMS wasn't arrived

~ % python3 huawei.py
{'DeviceName': 'B315s-22', 'SerialNumber': 'Q2Q8W1830500XXXX', 'Imei': '35534908865XXXX', 'Imsi': '25002027427XXXX', 'Iccid': '89701020274279XXXX', 'Msisdn': '+79207505548', 'HardwareVersion': 'WL1B310FM01', 'SoftwareVersion': '21.329.01.00.00', 'WebUIVersion': '21.313.05.00.00_Mod1.5', 'MacAddress1': '04:79:70:6C:79:DE', 'MacAddress2': None, 'ProductFamily': 'LTE', 'Classify': 'cpe', 'supportmode': None, 'workmode': 'LTE', 'WanIPAddress': '100.88.26.XX', 'WanIPv6Address': None}
{'SaveMode': '0', 'Validity': '10752', 'Sca': '+79202909090', 'UseSReport': '0', 'SendType': '1'}
OK
OK 

This is my python script

import sys
from huawei_lte_api.Client import Client
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
from huawei_lte_api.Connection import Connection

connection = AuthorizedConnection('http://admin:[email protected]/')

client = Client(connection) # This just simplifies access to separate API groups, you can use device = Device(connection) if you want

print(client.device.information())
print(client.sms.config())
print(client.sms.send_sms([+796728585XX], "Test message"))
print(client.user.logout())

I checked both requests from python and from GUI and find out, that in case of python I can't see "+" sign in the front of mobile number

Python output

<?xml version="1.0" encoding="UTF-8" ?><request><Index>-1</Index><Phones><Phone>796728585XX</Phone></Phones><Sca></Sca><Content>Test message</Content><Length>12</Length><Reserved>1</Reserved><Date>2020-01-21 09:27:49</Date></request>

GUI output

<?xml version="1.0" encoding="UTF-8"?><request><Index>-1</Index><Phones><Phone>+796728585XX</Phone></Phones><Sca></Sca><Content>testnumber2</Content><Length>11</Length><Reserved>1</Reserved><Date>2020-01-21 12:33:20</Date></request>

Is it something wrong with my script or my B315 is not fully supported?

Thanks
Andrey

E3372 - Home assistant - messages in draft - firmware version.

Hi,

I have created similar issue on git for home assistant: home-assistant/core#48240 (long story short: SMS instead of sending is adding to draft box)
but i have additional question for you.
What version of firmware will be the best to work without any problem? Can you recommend some?
I have tried few version from this: https://www.mediafire.com/folder/ll9ieqqooyhy5/Documents#d87a2pqx7olwm
but problem still exists.

Thanks in advance.

error code 100003

Hi there
I'm trying to use this API with Huawei B315 LTE router.
Everything is ok with receiving modem status, but I can't work with SMS

in case of bash script I'm getting error 100003

Any ideas how to solve this issue?
below is output of bash script

$ cat sms9.sh 
RESPONSE=`curl -s -X GET http://192.168.8.1/api/webserver/SesTokInfo`
COOKIE=`echo "$RESPONSE"| grep SessionID=| cut -b 10-147`
TOKEN=`echo "$RESPONSE"| grep TokInfo| cut -b 10-41`
 
DATA="<request><PageIndex>1</PageIndex><ReadCount>3</ReadCount><BoxType>1</BoxType><SortType>0</SortType><Ascending>0</Ascending><UnreadPreferred>1</UnreadPreferred></request>" 
 
curl -b $COOKIE -c $COOKIE -H "X-Requested-With: XMLHttpRequest" --data "$DATA" http://192.168.8.1/api/sms/sms-list --header "__RequestVerificationToken: $TOKEN" --header "Content-Type:text/xml"

Will appreciate for any help

Searching for api to switch between 4G and WAN

My B315 has the option to 'failover' from internet traffic the 4G connection to a WAN connection (or the other way around).
This failover apears to be manual.
I am searching for the api to trigger the switchover from 4G to WAN and vice versa.

Use case:
I only have 4G
The SIM in my B315 has a limited data amount (which is the max of my provider).
Now I want to link another modem to the WAN port with another SIM in it.
Now when the data amount of the B315 SIM is used, then I want to programmaticaly switchover the internet trafic to the WAN port (and thus the other modem/SIM).

I prefer not to use the B315 GUI as
a. I use the B315 as a bridge (GUI not available)
b. I want to be able to do this from the internet as well (GUI not available)

.

Receiving SMS and based on the content take further action

I am trying to use your software to detect whenever an sms is received that tells me that I have 500MB left of my data package so I can send a new SMS which gives me an extra gig of data. I think this api is right for that but can't figure out how to acces the content of received SMS' so that I can do a simple
if(message.contains("message telling me I'm nearly out of data")){
send_sms(foo, bar, etc)
}else{
console.log(message) //since no other messages will probably be received through SMS.
}

Am I on the right track or am I totally missing the point?

Tests

  • Linting
  • Full coverage tests

login_on_demand=True no longer "works"

After we removed the authorized call markers, login_on_demand=True no longer actually does what it says, there's nothing that would login on demand/automatically any more. Not sure yet what would be the best fix.

Session related issue

Hi,
I'm opening this issue as a continuation of reported problems with HomeAssistant huawei_lte integration that started few months ago. https://github.com/home-assistant/home-assistant/issues/29901
When trying to set up huawei_lte platform this error occurs:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 192, in async_setup
    hass, self
  File "/usr/src/homeassistant/homeassistant/components/huawei_lte/__init__.py", line 288, in async_setup_entry
    connection = await hass.async_add_executor_job(get_connection)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/huawei_lte/__init__.py", line 277, in get_connection
    url, username=username, password=password, timeout=CONNECTION_TIMEOUT
  File "/usr/local/lib/python3.7/site-packages/huawei_lte_api/AuthorizedConnection.py", line 24, in __init__
    if self.user.login(True):
  File "/usr/local/lib/python3.7/site-packages/huawei_lte_api/api/User.py", line 76, in login
    state_login = self.state_login()
  File "/usr/local/lib/python3.7/site-packages/huawei_lte_api/api/User.py", line 27, in state_login
    return self._connection.get('user/state-login')
  File "/usr/local/lib/python3.7/site-packages/huawei_lte_api/Connection.py", line 22, in wrapped
    return fn(*args, **kw)
  File "/usr/local/lib/python3.7/site-packages/huawei_lte_api/Connection.py", line 166, in get
    timeout=self.timeout,
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

As @scop suggested I did some test using script below:

#!/usr/bin/env python3

import http.client
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
from huawei_lte_api.Connection import Connection
from huawei_lte_api.Client import Client

URL = "http://192.168.1.1/"
USERNAME = "admin"
PASSWORD = ""
CONNECTION_TIMEOUT = 10

http.client.HTTPConnection.debuglevel = 1

if USERNAME or PASSWORD:
    connection = AuthorizedConnection(
        URL, username=USERNAME, password=PASSWORD, timeout=CONNECTION_TIMEOUT
    )
else:
    connection = Connection(URL, timeout=CONNECTION_TIMEOUT)

if isinstance(connection, AuthorizedConnection):
    Client(connection).user.logout()

and what I found - all versions of huawei_lte_api after 1.2 and till 1.4.3 does not return any error. With 1.4.4 and newer, script throws error with credentials provided.

I'm using huawei b252s-23a.

Is there a way to use proxy with API calls.

Hello there,

How can i send an API request through a proxy? just like how we can using requests package.

requests.get(url,proxies=proxies)

Is there a way to do the same with the api?

connection = AuthorizedConnection(f'http://admin:admin@{ip}',proxies=proxy)
client.sms.send_sms(numbers,message)

Feature request: receive SMS in home assistant

Are you willing to support more features in home assistant?
One of the biggest feature I am missing is the "Receive SMS" functionality.

Would you be willing to support this if I come up with a PR?

My idea is to have similar approach as the current SMS integration

I guess the only option is to poll every x time and when we notice we received a new SMS send an event and delete the SMS. Simular to the SMS integration

Tesing the example

Traceback (most recent call last):
File "router.py", line 1, in
from huawei_lte_api.Client import Client
File "/home/pi/.local/lib/python2.7/site-packages/huawei_lte_api/Client.py", line 38
def init(self, connection: Connection):

I'm just testing the example

ValueError: 3 is not a valid PasswordTypeEnum

When trying to authenticate after reset a B310 to defaults, AuthorizedConnection fails:

connection = AuthorizedConnection('http://192.168.8.1', username="admin",password="admin")

File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/AuthorizedConnection.py", line 24, in init
if self.user.login(True):
File "/usr/local/lib/python3.7/dist-packages/huawei_lte_api/api/User.py", line 83, in login
return self._login(PasswordTypeEnum(int(state_login['password_type'])))
File "/usr/lib/python3.7/enum.py", line 310, in call
return cls.new(cls, value)
File "/usr/lib/python3.7/enum.py", line 564, in new
raise exc
File "/usr/lib/python3.7/enum.py", line 548, in new
result = cls.missing(value)
File "/usr/lib/python3.7/enum.py", line 577, in missing
raise ValueError("%r is not a valid %s" % (value, cls.name))

It seems the router is returning the value 3 for PasswordTypeEnum because it is expecting to change the password.

After changing BASE64 enum to 3 it logins perfectly.

Time issue with B525S-23a

I am using a B525S-23a Huawei router and your API. Thanks for that great job.

Within the function state_login from Class User.py I was forced to add a wait in order to let the time to the router to answer correctly with a not empty dictionary.

Line number 26 :
import time
time.sleep(0,1)

Without that, the exception thrown is :
('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Thanks
Octave21
huwei-lte

Can't get signal from Huawei e8372

12d1:14db Huawei Technologies Co., Ltd. E353/E3131

print(client.device.signal())
{'pci': None, 'sc': None, 'cell_id': None, 'rsrq': None, 'rsrp': None, 'rssi': None, 'sinr': None, 'rscp': None, 'ecio': None, 'psatt': '1', 'mode': '7', 'lte_bandwidth': None, 'lte_bandinfo': None}

Running on RaspberryPI and getting a seemingly randomized object from client.sms.get_sms_list

Hey there, it's me again running into another problem! So I got the API to work brilliantly on my laptop but for convenience I'm now trying to run it on a raspberry PI for the purpose of sending an SMS to ask for extra GB's when I'm running low to my ISP. Like I said I got it to work perfectly on my laptop so I just pushed that code to a fork and then pulled that to my PI. First ran into a spot of bother because I hardly ever work with Python where I tried installing the required modules but used pip install causing me to install them for python 2.7 (dumb mistake I know, but I'm telling you this so you realize that this problem is probably a mistake on my side.)

The problem that I'm having is that when I run the following code:
`from huawei_lte_api.Client import Client
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
from huawei_lte_api.Connection import Connection
from huawei_lte_api.api.Sms import Sms
import sched, time
s = sched.scheduler(time.time, time.sleep)

def ask_extra_gigs(sc):
connection = AuthorizedConnection('http://admin:[email protected]/')
client = Client(connection) # This just simplifies access to separate API groups, you can use device = Device(connection) if you want
latest_sms = str(list(list(client.sms.get_sms_list()["Messages"].values())[0][0].values())[3])
print(latest_sms)
if '500MB' in latest_sms:
print('asking for data')
for _ in range(0, 5):
client.sms.send_sms([1280], "1GB EXTRA")
s.enter(600, 1, ask_extra_gigs, (sc,))
elif 'Gelukt!' in latest_sms:
print('plenty of data left')
s.enter(600, 1, ask_extra_gigs, (sc,))
else:
print('unexpected message')

s.enter(1, 1, ask_extra_gigs, (s,))
s.run()`
latest_sms = str(list(list(client.sms.get_sms_list()["Messages"].values())[0][0].values())[3]) this line doesn't give me the content of the latest message anymore (like it did on my windows laptop) but instead it gives one of several different options. I've come to realize that list(client.sms.get_sms_list()["Messages"].values())[0][0] can give me all the information about the latest sms in an incredibly random order.

Is this a unix problem or something? I truly have no clue, the way I see it it shouldn't care whether it is run on windows or unix based OS.

Any help is greatly appreciated

e3371 - pb module - question

Hi,

first of all - many thanks for your library - IMHO the best available now in our corner of Galaxy! I'm using it on my project based on HUAWEI E3372. BTW if you want I can send you the hardware - as I have spare one.

I would like to use Phonebook (PB) module but I'm missing many functions. Mostly I need two functions pb-new and pb-delete.

I think that I can program this functions myself and create PR, but I have no idea how to pass request xml data for pb-new. The API is expecting structure like that:

<request>
    <GroupID></GroupID>
    <SaveType></SaveType>
    <Field>
        <Name>FormattedName</Name>
        <Value></Value>
    </Field>
    <Field>
        <Name>MobilePhone</Name>
        <Value></Value>
    </Field>
    <Field>
        <Name>HomePhone</Name>
        <Value></Value>
    </Field>
    <Field>
        <Name>WorkPhone</Name>
        <Value></Value>
    </Field>
    <Field>
        <Name>WorkEmail</Name>
        <Value></Value>
    </Field>
</request>

Is that possible ? I mean passing nested dictionary parameter to the _connection.post_set call.

Failed re-login attempt after timeout

Hi,

Thank you very much for creating this library! I own Huawei B529 router and I use your library via home-assistant project to detect devices presence at home. However I noticed a problem after re-login attempt. It fails with 125003 error code. Here is the traceback:

>>> client.wlan.host_list()
Traceback (most recent call last):
  File "/home/lukasz/Programowanie-ns/huawei-lte-api/huawei_lte_api/api/User.py", line 46, in _login
    }, refresh_csfr=True)
  File "/home/lukasz/Programowanie-ns/huawei-lte-api/huawei_lte_api/Connection.py", line 112, in post
    data = self._check_response_status(self._process_response_xml(response.content))
  File "/home/lukasz/Programowanie-ns/huawei-lte-api/huawei_lte_api/Connection.py", line 64, in _check_response_status
    error_code
huawei_lte_api.exceptions.ResponseErrorException: 125003: Unknown

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lukasz/Programowanie-ns/huawei-lte-api/huawei_lte_api/AuthorizedConnection.py", line 17, in wrapped
    if not args[0]._connection.enforce_authorized_connection():
  File "/home/lukasz/Programowanie-ns/huawei-lte-api/huawei_lte_api/AuthorizedConnection.py", line 53, in enforce_authorized_connection
    if self.user.login():
  File "/home/lukasz/Programowanie-ns/huawei-lte-api/huawei_lte_api/api/User.py", line 77, in login
    return self._login(PasswordTypeEnum(int(state_login['password_type'])))
  File "/home/lukasz/Programowanie-ns/huawei-lte-api/huawei_lte_api/api/User.py", line 68, in _login
    '{}: {}'.format(e.code, message), e.code)
huawei_lte_api.exceptions.ResponseErrorException: 125003: Unknown

Reloading the connection with reload and then redoing the operation works fine. Do you have any clues how it could be fixed? Does re-login work fine for your router?

Issue in connecting to Huawei B315s-22

I recently found your project
via https://github.com/chenwei791129/Huawei-LTE-Router-SMS-to-E-mail-Sender
because I was looking for a way to forward SMS's from my remote (1500km away!) Issue Huawei B315s-22 to either email or another sms number.

I tried to get things running on a RPi running Raspbian Jessie with Python 3.5.7 (previous attempt with 3.5.1 failed with numerous issues). I am hesitating to upgrade to Python 3.7 as my RPi is remote as well and has some other stuff running based n Python 3.5)

I AM aware that my device (Huawei B315s-22) is not on your "tested on" list.

An unauthorized connection ok.
But an autorized connectiin attempt throws error 12500 Session error

(note in below log I changed the password to "my_password")
The output from the example code on the project main page gives me following output on following statement
connection = AuthorizedConnection('http://admin:[email protected]/')

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/Connection.py", line 22, in wrapped
    return fn(*args, **kw)
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/Connection.py", line 175, in get
    return self._check_response_status(self._process_response_xml(response))
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/Connection.py", line 91, in _check_response_status
    error_code
huawei_lte_api.exceptions.ResponseErrorLoginCsrfException: 125002: Session error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "huawei.py", line 7, in <module>
    connection = AuthorizedConnection('http://admin:[email protected]/')
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/AuthorizedConnection.py", line 24, in __init__
    if self.user.login(True):
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/api/User.py", line 76, in login
    state_login = self.state_login()
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/api/User.py", line 27, in state_login
    return self._connection.get('user/state-login')
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/Connection.py", line 25, in wrapped
    return fn(*args, **kw)
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/Connection.py", line 175, in get
    return self._check_response_status(self._process_response_xml(response))
  File "/usr/local/lib/python3.5/site-packages/huawei_lte_api/Connection.py", line 91, in _check_response_status
    error_code
huawei_lte_api.exceptions.ResponseErrorLoginCsrfException: 125002: Session error

Can you give me any hint/clue on how to try to tackle this?

Unknown error for send_sms

Hi,

Thank you for developing this api. However, I am getting an error when trying to send an sms using this api:

python3 send_sms.py "REDACTED" "Hello World"
{'cdma_enabled': '0', 'url_enabled': '1', 'import_enabled': '1', 'smsisusepdu': '0', 'SendType': '1', 'maxphone': '50', 'UseSReport': '0', 'SaveMode': '0', 'Validity': '10752', 'pagesize': '20', 'smscharlang': '0', 'Sca': '+41787777070'}
Traceback (most recent call last):
  File "send_sms.py", line 16, in <module>
    print(client.sms.send_sms(sys.argv[1], sys.argv[2]))
  File "/home/pi/.local/lib/python3.5/site-packages/huawei_lte_api/AuthorizedConnection.py", line 19, in wrapped
    return fn(*args, **kw)
  File "/home/pi/.local/lib/python3.5/site-packages/huawei_lte_api/api/Sms.py", line 114, in send_sms
    }, dicttoxml_xargs=dicttoxml_xargs)
  File "/home/pi/.local/lib/python3.5/site-packages/huawei_lte_api/Connection.py", line 112, in post
    data = self._check_response_status(self._process_response_xml(response.content))
  File "/home/pi/.local/lib/python3.5/site-packages/huawei_lte_api/Connection.py", line 64, in _check_response_status
    error_code
huawei_lte_api.exceptions.ResponseErrorException: 100005: Unknown

My script looks like this:

import sys
from huawei_lte_api.Client import Client
from huawei_lte_api.AuthorizedConnection import AuthorizedConnection
from huawei_lte_api.Connection import Connection

connection = AuthorizedConnection('http://admin:[email protected]/')

client = Client(connection) # This just simplifies access to separate API group$

print(client.sms.config())
print(client.sms.send_sms(list(sys.argv[1]), sys.argv[2]))
print(client.user.logout())

Am I doing anything wrong, or is this a bug? Using version 1.1.3 on Raspbian 9.6.

Thanks in advance for your help.

Stephan

Delete all SMS

Hi, im trying to delete all messages after I did something with the received messages, but I get the error unknown 10005. any help?

Support for self-signed/invalid certificates

Hello!

I'm having the problem that my huawei firmware comes with a weird self-signed/invalid certificate

image

which stops me from using the huawei-lte-api.

I get this error using the huawei-lte-monitoring script from @littlejo

Traceback (most recent call last):
  File "/home/userunkown/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/userunkown/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/home/userunkown/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/home/userunkown/.local/lib/python3.6/site-packages/urllib3/connection.py", line 344, in connect
    ssl_context=context)
  File "/home/userunkown/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 358, in ssl_wrap_socket
    return context.wrap_socket(sock)
  File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "/usr/lib/python3.6/ssl.py", line 817, in __init__
    self.do_handshake()
  File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/userunkown/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/userunkown/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='192.168.1.1', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)'),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "display_traffic_signal.py", line 42, in <module>
    main()
  File "display_traffic_signal.py", line 30, in main
    connection = AuthorizedConnection(f'http://{ip}/', login, password)
  File "/home/userunkown/.local/lib/python3.6/site-packages/huawei_lte_api/AuthorizedConnection.py", line 29, in __init__
    super(AuthorizedConnection, self).__init__(url)
  File "/home/userunkown/.local/lib/python3.6/site-packages/huawei_lte_api/Connection.py", line 24, in __init__
    self._initialize_csfr_tokens_and_session()
  File "/home/userunkown/.local/lib/python3.6/site-packages/huawei_lte_api/Connection.py", line 73, in _initialize_csfr_tokens_and_session
    response = requests.get(self.url)
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/sessions.py", line 668, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/sessions.py", line 668, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/sessions.py", line 247, in resolve_redirects
    **adapter_kwargs
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/userunkown/.local/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='192.168.1.1', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:847)'),))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.