Search code examples
pythonat-commandpyserial

How to send AT commands to Huawei E3272 Hilink with python(pyserial)?


In the previous generations of USB modems, it was easy to send AT commands by using Pyserial and directing the commands to the corresponding /dev/USBACM device. However, this Huawei device creates its own virtual interface and hence ifconfig shows it as eth1 and "dmesg | grep tty" doesnt really show it. So my question is how do I send my AT commands using python and pyserial? Thanks. PS : Feel free to weigh in other alternative approaches.


Solution

  • So I found the answer almost 7 months ago and I thought it would be a good idea to share. I was able to read the information from the modem by using RESTFul APIs provided by Huawei. In other words, information from the modem can be retrieved or set by using standard HTTP verbs (GET, POST, PUT, DELETE). A list of these Huawei APIs can be found in this link (The website is in Polish language. However, google translate can do the trick for you) http://forum.jdtech.pl/Watek-hilink-api-dla-urzadzen-huawei

    Implementing this can be tiresome. This guy has written a python program that implements almost all APIs in the link above. With minor effort, you could re-write the python program to suit your needs.

    https://github.com/max246/huawei/blob/master/Huawei.py