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

[FAST3890V2] Incompatible model using example code #1

Open
slimcdk opened this issue May 21, 2020 · 5 comments
Open

[FAST3890V2] Incompatible model using example code #1

slimcdk opened this issue May 21, 2020 · 5 comments
Assignees
Labels
blocked help wanted Extra attention is needed new-device

Comments

@slimcdk
Copy link

slimcdk commented May 21, 2020

Hi. I got this model:

Key Value
Board ID: FAST3890_D0
Symmetric CPU Threads: 2
Build Timestamp: 20190823_1045
Linux Version: 3.14.28-Prod_6.1.2mp2
Wireless Driver Version: 7.14.164.17 (r683874)
Systime: 2020-05-21T11:04:28+01:00
Standard Specification Compliant Docsis 3.1
Hardware Version FAST3890V2 Rev:V2.0
Software Version FAST3890_TDC_50.10.22.T1
Cable Modem Serial Number DM1705907002004
CM certificate Installed

I tried your example script with my informations, but received this error:

christian@desktop:~$ python3 sagemcom.py 
Traceback (most recent call last):
  File "sagemcom.py", line 19, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "sagemcom.py", line 9, in main
    logged_in = await sagemcom.login()
  File "/home/christian/.local/lib/python3.8/site-packages/sagemcom_api/client.py", line 204, in login
    response = await self.__api_request_async([actions], True)
  File "/home/christian/.local/lib/python3.8/site-packages/sagemcom_api/client.py", line 149, in __api_request_async
    async with session.post(api_host, data="req=" + json.dumps(payload, separators=(',', ':'))) as response:
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client.py", line 504, in _request
    await resp.start(conn)
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 847, in start
    message, payload = await self._protocol.read()  # type: ignore  # noqa
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/streams.py", line 591, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: None

Using Python 3.8.2

@iMicknl
Copy link
Owner

iMicknl commented May 23, 2020

Have you tried both encryption methods? (md5 and sha512). Could you try to log in via the router web interface, and run the following command via your console.

$.xmo.getValuesTree("Device/DeviceInfo")

@iMicknl iMicknl self-assigned this May 23, 2020
@slimcdk
Copy link
Author

slimcdk commented May 23, 2020

Yea, I have tried both, which yields same error.

This is what I get from running that command.

Uncaught TypeError: Cannot read property 'getValuesTree' of undefined
    at <anonymous>:1:7
(anonymous) @ VM210:1

image

@slimcdk
Copy link
Author

slimcdk commented May 24, 2020

Here are the full scripts and logs.

Python 3.8.2 and MD5

christian@desktop:~$ cat sagemcom.py && python3 sagemcom.py 
import asyncio
from sagemcom_api import SagemcomClient, EncryptionMethod

async def main():
    # Choose EncryptionMethod.MD5 or EncryptionMethod.SHA512
    sagemcom = SagemcomClient('192.168.100.1', 'admin', '<my password>', EncryptionMethod.MD5)

    ## Login method could be used to test the credentials
    logged_in = await sagemcom.login()

    if logged_in:
        device_info = await sagemcom.get_device_info()
        print(device_info)

    ## Or just call get_device_info() directly
    device_info = await sagemcom.get_device_info()
    print(device_info)

asyncio.run(main())
Traceback (most recent call last):
  File "sagemcom.py", line 19, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "sagemcom.py", line 9, in main
    logged_in = await sagemcom.login()
  File "/home/christian/.local/lib/python3.8/site-packages/sagemcom_api/client.py", line 204, in login
    response = await self.__api_request_async([actions], True)
  File "/home/christian/.local/lib/python3.8/site-packages/sagemcom_api/client.py", line 149, in __api_request_async
    async with session.post(api_host, data="req=" + json.dumps(payload, separators=(',', ':'))) as response:
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client.py", line 504, in _request
    await resp.start(conn)
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 847, in start
    message, payload = await self._protocol.read()  # type: ignore  # noqa
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/streams.py", line 591, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: None

Python 3.8.2 and SHA512

christian@desktop:~$ cat sagemcom.py && python3 sagemcom.py 
import asyncio
from sagemcom_api import SagemcomClient, EncryptionMethod

async def main():
    # Choose EncryptionMethod.MD5 or EncryptionMethod.SHA512
    sagemcom = SagemcomClient('192.168.100.1', 'admin', '<my password>', EncryptionMethod.SHA512)

    ## Login method could be used to test the credentials
    logged_in = await sagemcom.login()

    if logged_in:
        device_info = await sagemcom.get_device_info()
        print(device_info)

    ## Or just call get_device_info() directly
    device_info = await sagemcom.get_device_info()
    print(device_info)

asyncio.run(main())
Traceback (most recent call last):
  File "sagemcom.py", line 19, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "sagemcom.py", line 9, in main
    logged_in = await sagemcom.login()
  File "/home/christian/.local/lib/python3.8/site-packages/sagemcom_api/client.py", line 204, in login
    response = await self.__api_request_async([actions], True)
  File "/home/christian/.local/lib/python3.8/site-packages/sagemcom_api/client.py", line 149, in __api_request_async
    async with session.post(api_host, data="req=" + json.dumps(payload, separators=(',', ':'))) as response:
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client.py", line 504, in _request
    await resp.start(conn)
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 847, in start
    message, payload = await self._protocol.read()  # type: ignore  # noqa
  File "/home/christian/.local/lib/python3.8/site-packages/aiohttp/streams.py", line 591, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: None

@iMicknl iMicknl changed the title Incompatible model using example code [FAST3890V2] Incompatible model using example code May 24, 2020
@iMicknl
Copy link
Owner

iMicknl commented May 24, 2020

@slimcdk it looks like your FAST3890V2 model is using a different firmware than the others tested. I have the FAST3890V3 myself, which works like a charm. If you are not able to run $.xmo.getValuesTree("Device/DeviceInfo"), this means that they don't have the same internal API available unfortunately.

If you look in the Network tab of your console, do you see any XHR requests?

@slimcdk
Copy link
Author

slimcdk commented May 24, 2020

Yea, I guess you are right :/

There is no XHR type requests.
image

@iMicknl iMicknl added bug Something isn't working help wanted Extra attention is needed labels May 25, 2020
@iMicknl iMicknl added blocked new-device and removed bug Something isn't working labels Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked help wanted Extra attention is needed new-device
Projects
None yet
Development

No branches or pull requests

2 participants