Skip to content

chanakalin/hilinkapi

Repository files navigation

Huawei HiLink Python 3 API

This will provide a Python 3 API to manage HiLink based Huawei USB modems,

  • E8372h-320
  • E8372h-155
  • E3372h-320
  • E3372h-153

having WebUI version 10.xx.xx, 17.xxx.xx and 21.xxx.xx variants.

Choose the best rotation method suppport with your mobile carrier.

Python packages

Following python package installations are required apart from defaults

pip3 install requests
pip3 install xmltodict
pip3 install beautifulsoup4
pip3 install uuid

API Test

Run apiTest.py python script to test functionalities. Example provided for 4 modem types supporting using both with and without authentication

python3 apiTest.py

Native compilation using Cython

This is for building native linux libraries build from python sources

Have to add python source files into cythonNativeCompile.py

ext_modules = [
...
Extension("HiLinkAPI",  ["HiLinkAPI.py"]),
...
]

Python packages

Cython has to be install prior to native compilation.

pip3 install cython

Compile

Run following to build native libraries from python source

python3 cythonNativeCompile.py build_ext --inplace

Test results

E3372h-153 E3372h-320 E8372h-320

License

This piece of software API is licensed under MIT license.

Huawei and HiLink are registered trademarks/products of Huawei Technologies Co. Ltd and/or its parents organizations.