Open Pezhvak opened 2 years ago
BTW, the same is happening when I'm trying to call device.reboot()
.
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
@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):
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.
Hi, Thank you for creating this repository, I'm trying to change
notMode
with the following code:result is: "Error: 125003: Unknown"
The same code in python works:
result is: "OK"
The same is happening with built-in methods:
result is: "Error: 125003: Unknown"
result is: "OK".