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

Getting "125003: Unknown" for net.setNetMode #23

Open
Pezhvak opened this issue Feb 22, 2022 · 3 comments
Open

Getting "125003: Unknown" for net.setNetMode #23

Pezhvak opened this issue Feb 22, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Pezhvak
Copy link
Contributor

Pezhvak commented Feb 22, 2022

Hi,
Thank you for creating this repository,
I'm trying to change notMode with the following code:

await con.postSet('net/net-mode', {
      'NetworkMode': '03',
      'NetworkBand': '2000004400000',
      'LTEBand': '7FFFFFFFFFFFFFFF',
  });

result is: "Error: 125003: Unknown"

The same code in python works:

connection.post_set(endpoint='net/net-mode', data={
    'NetworkMode': '03',
    'NetworkBand': '2000004400000',
    'LTEBand': '7FFFFFFFFFFFFFFF',
})

result is: "OK"

The same is happening with built-in methods:

await net.setNetMode('7FFFFFFFFFFFFFFF', '2000004400000', '02');
await net.setNetMode('7FFFFFFFFFFFFFFF', '2000004400000', '03');

result is: "Error: 125003: Unknown"

net.set_net_mode('7FFFFFFFFFFFFFFF', '2000004400000', '02')
net.set_net_mode('7FFFFFFFFFFFFFFF', '2000004400000', '03')

result is: "OK".

@Pezhvak
Copy link
Contributor Author

Pezhvak commented Feb 22, 2022

BTW, the same is happening when I'm trying to call device.reboot().

@Salamek Salamek added the bug Something isn't working label Feb 22, 2022
@Salamek
Copy link
Owner

Salamek commented Feb 22, 2022

Hi, i wont have time to check this for next few days (maybe a week) so if you need to resolve this fast, you may try to debug this your self.

  1. print() || console.log() build XML request in Python || TS version and compare if there is any difference
  2. Use wireshark to sniff HTTP request that is made to your router/modem in Python || TS version and compare
  3. ...
  4. Profit

Pezhvak added a commit to Pezhvak/huawei-lte-api-ts that referenced this issue Feb 23, 2022
Fixing issue with running out of `__requestverificationtoken` after few calls.
Relates: Salamek#23
@Pezhvak
Copy link
Contributor Author

Pezhvak commented Feb 23, 2022

@Salamek I've tried what you said and this is the result:

Trying to monitor traffic, i had to use proxy opened for the dongle (since they are hosted on another machine), surprisingly setNetMode worked fine with proxy, however when i tried to use the same script on the machine which is hosting those dongles it fails. (note that i have multiple dongles connected on the host). i don't understand how can node get confused considering we are providing modem IP to connection class hence using it in requests that is being sent, and this issue doesn't occur in python flavor.

Requests are identical between python and nodejs (python sends multiple requests one after the other before logging in to (/state-login), which i don't know if it has any effect, since all responses are equal (including response headers). this might be a problem on python side, however, to me it seems there is something wrong in axios, with that said, even trying to control the dongle over proxy, it fails to log the user out. (requests are the same again). and the error is: "125003" (which i found the issue and fixed in #24)

Here is a screenshot of requests (might be helpful to see):
Screen Shot 2022-02-23 at 3 28 13 PM
Note: the selected portion of the requests are sent using nodejs, and unselected ones is sent by python. ( you can see python sends multiple requests to /api/user/state-login before logging in). i didn't include headers and responses of the requests because they are identical except session and __RequestVerificationToken as it should be.

Since i don't have access to the machine which is hosting those dongles i cannot monitor traffic without proxy to find out why it doesn't work directly. (This problem is only with POST requests and absent if i use a proxy to connect to the dongle, GET requests like device.signal(), device.information() are working correctly without a proxy as far as i could test).

I think i will have to keep using a proxy to communicate with the dongles until you find time to look at it.

Let me know if i could help.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants