Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I ran the example but didn't work #198

Open
Zibri opened this issue Dec 8, 2023 · 6 comments
Open

I ran the example but didn't work #198

Zibri opened this issue Dec 8, 2023 · 6 comments
Labels
question Further information is requested

Comments

@Zibri
Copy link

Zibri commented Dec 8, 2023

Device nameB535-933
Orange.eg FlyBOX

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)
...    print(client.device.signal())
...    print(client.device.information())
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zibri/.local/lib/python3.10/site-packages/huawei_lte_api/Connection.py", line 32, in __init__
    super().__init__(url, timeout=timeout, requests_session=requests_session)
  File "/home/zibri/.local/lib/python3.10/site-packages/huawei_lte_api/Session.py", line 75, in __init__
    self._initialize_csrf_tokens_and_session()
  File "/home/zibri/.local/lib/python3.10/site-packages/huawei_lte_api/Session.py", line 176, in _initialize_csrf_tokens_and_session
    token = self._get_token()
  File "/home/zibri/.local/lib/python3.10/site-packages/huawei_lte_api/Session.py", line 309, in _get_token
    data = self.get('webserver/token')
  File "/home/zibri/.local/lib/python3.10/site-packages/huawei_lte_api/Session.py", line 34, in wrapped
    return fn(*args, **kw)
  File "/home/zibri/.local/lib/python3.10/site-packages/huawei_lte_api/Session.py", line 305, in get
    return cast(dict, self._check_response_status(self._process_response_data(response)))
  File "/home/zibri/.local/lib/python3.10/site-packages/huawei_lte_api/Session.py", line 123, in _process_response_data
    return xmltodict.parse(data, dict_constructor=dict) if data else {}
  File "/home/zibri/.local/lib/python3.10/site-packages/xmltodict.py", line 378, in parse
    parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: junk after document element: line 2, column 0
>
@Salamek
Copy link
Owner

Salamek commented Dec 8, 2023

Are you sure that http://192.168.8.1/ is correct IP of your device? It so, it is also possible that B535-933 is using different FW than expected (provided by Huawei or by Orange)

@Zibri
Copy link
Author

Zibri commented Dec 8, 2023

Yep... weirdly that happened using pip3 install...
So I cloned this repository and then I did pip3 install .
after that it worked.
So perhaps the repositoryis different.

@Zibri
Copy link
Author

Zibri commented Dec 8, 2023

@Salamek do you have any idea how could I dump/intercept the firmware update?
fwup
There is one available but I do not wish to update. I wish to dump it.

@Salamek
Copy link
Owner

Salamek commented Dec 8, 2023

@Zibri
Copy link
Author

Zibri commented Dec 8, 2023

Try this call,

https://github.com/Salamek/huawei-lte-api/blob/1a28bbf96eec2480b04e03b46584f67ffeb9dc11/huawei_lte_api/api/OnlineUpdate.py#L15C9-L15C17

(or maybe status or check_new_version)

url-list, status and check new version return there is an update and the version but not the URL..

==== OnlineUpdate.check_new_version
100002: No support

==== OnlineUpdate.status
{'CurrentComponentIndex': '0',
 'CurrentComponentStatus': '12',
 'DownloadProgress': '0',
 'TotalComponents': '1',
 'autodownload': '0',
 'forcedupdate': '0',
 'updatebatterystatus': '0',
 'upgradetype': '0'}

==== OnlineUpdate.url_list
{'ComponentList': {'Component': {'ChangeLog': {'component': {'@name': 'FIRMWARE1',
                                                             '@version': '11.0.5.51(H470SP3C314)'},
                                               'default-language': {'#text': '1033',
                                                                    '@name': 'en-us'},
                                               'language': [{'@code': '1033',
                                                             '@name': 'en-us',

@Salamek
Copy link
Owner

Salamek commented Dec 9, 2023

@Zibri well that is where my ideas end... maybe try to access telnet and see what you can do there? idk...

@Salamek Salamek added the question Further information is requested label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants