Closed spookycheekybreeky closed 2 years ago
SORRY ! im kindad useless issue because the code is actually logic and simple !
For the peuple who need to restart or do any orther action with ths lib is simply as :
from huawei_lte_api.Client import Client from huawei_lte_api.Connection import Connection
with Connection('http://admin:Wordpassword1!@192.168.8.1/') as connection: client = Client(connection) print(client.device.reboot())
simply replace the "reboot()" in the client.device.reboot() with the action you need to do !
Hi , i would like to restart my huawei dongle with this lib but what im missing in my code for restarting it ?
Code from my file :
from huawei_lte_api.Client import Client from huawei_lte_api.Connection import Connection from huawei_lte_api.api import Device
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:MYPASSWORD@192.168.8.1/') as connection: client = Client(connection) # This just simplifies access to separate API groups, you can use device = Device(connection) if you want
For more API calls just look on code in the huawei_lte_api/api folder, there is no separate DOC yet
The output in the console i got :
C:\Users\Kalvelign\AppData\Local\Programs\Python\Python310\python.exe C:/Users/Kalvelign/Desktop/DEV/MODEM/main.py {'pci': None, 'sc': None, 'cell_id': None, 'rsrq': None, 'rsrp': None, 'rssi': None, 'sinr': None, 'rscp': None, 'ecio': None, 'mode': None, 'ulbandwidth': None, 'dlbandwidth': None, 'txpower': None, 'tdd': None, 'ul_mcs': None, 'dl_mcs': None, 'earfcn': None, 'rrc_status': None, 'rac': None, 'lac': None, 'tac': None, 'band': None, 'nei_cellid': None, 'plmn': None, 'ims': None, 'wdlfreq': None, 'lteulfreq': None, 'ltedlfreq': None, 'transmode': None, 'enodeb_id': None, 'cqi0': None, 'cqi1': None, 'ulfrequency': None, 'dlfrequency': None, 'arfcn': None, 'bsic': None, 'rxlev': None} {'DeviceName': 'E3372h-320', 'SerialNumber': 'xxXXxxXXxxXXxx', 'Imei': 'xxXXxxXXxxXXxx', 'Imsi': None, 'Iccid': None, 'Msisdn': None, 'HardwareVersion': 'CL4E3372HM', 'SoftwareVersion': '10.0.3.1(H192SP3C983)', 'WebUIVersion': 'WEBUI 10.0.3.1(W13SP5C7201)', 'MacAddress1': 'xxXXxxXXxxXXxx', 'MacAddress2': None, 'WanIPAddress': None, 'wan_dns_address': None, 'WanIPv6Address': None, 'wan_ipv6_dns_address': None, 'ProductFamily': 'LTE', 'Classify': 'hilink', 'supportmode': 'LTE|WCDMA|GSM', 'workmode': 'NO SERVICE', 'submask': None, 'Mccmnc': None, 'iniversion': 'E3372h-320-CUST 10.0.3.1(C965)', 'uptime': '3349', 'ImeiSvn': '07', 'spreadname_en': None, 'spreadname_zh': None} Traceback (most recent call last): File "C:\Users\Kalvelign\Desktop\DEV\MODEM\main.py", line 11, in
print(Device.Device.reboot())
TypeError: Device.reboot() missing 1 required positional argument: 'self'