Salamek / huawei-lte-api

API For huawei LAN/WAN LTE Modems
GNU Lesser General Public License v3.0
367 stars 90 forks source link

Disabling automatic online updates #167

Open iMiMx opened 1 year ago

iMiMx commented 1 year ago

As far as I can see, disabling automatic online updates - and forced updates, 'do not require user to login for updates' - is not possible?

Under the OTA / System sections in the UI, I have the following:

OTA - http://192.168.8.1/api/online-update/autoupdate-config

<?xml version="1.0" encoding="UTF-8"?><request><auto_update>1</auto_update><ui_download>0</ui_download></request>
<?xml version="1.0" encoding="UTF-8"?><request><auto_update>0</auto_update><ui_download>0</ui_download></request>

System - http://192.168.8.1/api/online-update/configuration

<?xml version="1.0" encoding="UTF-8"?><request><autoUpdateInterval>1</autoUpdateInterval><server_force_enable>1</server_force_enable></request>
<?xml version="1.0" encoding="UTF-8"?><request><autoUpdateInterval>1</autoUpdateInterval><auto_update_enable>1</auto_update_enable><not_need_login>1</not_need_login><server_force_enable>1</server_force_enable></request>

Testing on an E8372h-820 and E8372h-320, device info:

{'DeviceName': 'E8372h-820', 'SerialNumber': 'xxxx', 'Imei': 'xxxx', 'Imsi': 'xxx', 'Iccid': 'xxx', 'Msisdn': None, 'HardwareVersion': 'CL4E8372HM', 'SoftwareVersion': '10.0.5.1(H195SP2C983)', 'WebUIVersion': 'WEBUI 10.0.5.1(W13SP5C7401)', 'MacAddress1': 'xx:xx:xx:xx:xx:xx', 'MacAddress2': None, 'WanIPAddress': '10.216.28.166', 'wan_dns_address': '10.206.128.1,10.206.128.1', 'WanIPv6Address': None, 'wan_ipv6_dns_address': None, 'ProductFamily': 'LTE', 'Classify': 'wingle', 'supportmode': 'LTE|WCDMA|GSM', 'workmode': 'LTE', 'submask': '255.255.255.255', 'Mccmnc': '23415', 'iniversion': 'E8372h-820-CUST 10.0.5.1(C1431)', 'uptime': '4857', 'ImeiSvn': '01', 'WifiMacAddrWl0': '94:E9:EE:68:8E:A9', 'WifiMacAddrWl1': None, 'spreadname_en': 'HUAWEI Mobile WiFi 2 mini', 'spreadname_zh': 'HUAWEI Mobile WiFi 2 mini'}

Reading is possible it seems, but not setting/post-ing:

print(client.online_update.autoupdate_config())
print(client.online_update.configuration())
{'auto_update': '0', 'ui_download': '0'}
{'autoUpdateInterval': '1', 'auto_update_enable': '1', 'not_need_login': '0', 'server_force_enable': '0'}
Salamek commented 1 year ago

I don't understand the Q, You want to disable automatic updates and it is not working?

iMiMx commented 1 year ago

My apologies. Whilst I might be wrong, it looks like retrieving values is supported, but not changing? Is that correct?

    def configuration(self) -> GetResponseType:
        return self._session.get('online-update/configuration')

    def autoupdate_config(self) -> GetResponseType:
        return self._session.get('online-update/autoupdate-config')

https://github.com/Salamek/huawei-lte-api/blob/master/huawei_lte_api/api/OnlineUpdate.py

Salamek commented 1 year ago

Currently i'm not aware of any way to change this settings using this lib... but i'll have a look if i can find some way...