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

ERROR:Could not parse error code 20101 #265

Closed
tq23ld opened this issue Dec 4, 2022 · 4 comments
Closed

ERROR:Could not parse error code 20101 #265

tq23ld opened this issue Dec 4, 2022 · 4 comments

Comments

@tq23ld
Copy link

tq23ld commented Dec 4, 2022

I have python 3.9.2 and meross-iot 0.4.5.0. On running any of the examples eg valve.py I get the following errors. I have double checked my login details are correct.

pi@raspberrypi:~ $ sudo python valve.py
ERROR:Could not parse error code 20101.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/meross_iot/http_api.py", line 294, in _async_authenticated_post
error = ErrorCodes(code)
File "/usr/lib/python3.9/enum.py", line 360, in call
return cls.new(cls, value)
File "/usr/lib/python3.9/enum.py", line 677, in new
raise ve_exc
ValueError: 20101 is not a valid ErrorCodes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/valve.py", line 59, in
loop.run_until_complete(main())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/pi/valve.py", line 14, in main
http_api_client = await MerossHttpClient.async_from_user_password(email=EMAIL, password=PASSWORD)
File "/usr/local/lib/python3.9/dist-packages/meross_iot/http_api.py", line 106, in async_from_user_password
creds = await cls.async_login(email=email,
File "/usr/local/lib/python3.9/dist-packages/meross_iot/http_api.py", line 203, in async_login
response_data = await MerossHttpClient._async_authenticated_post(url=url,
File "/usr/local/lib/python3.9/dist-packages/meross_iot/http_api.py", line 296, in _async_authenticated_post
raise AuthenticatedPostException(f"Unknown/Unhandled response code received from API. "
meross_iot.model.http.exception.AuthenticatedPostException: Unknown/Unhandled response code received from API. Response was: {'apiStatus': 20101, 'sysStatus': 0, 'info': '', 'timeStamp': 1670167413, 'data': {}}

@albertogeniola
Copy link
Owner

Hi!
Unfortunately, I cannot reproduce this error. Moreover, it looks like there is no info in the Meross APP about the API status code 20101, it must be some sort of internal/undocumented state provided by the HTTP API.

What devices do you own? Can we test someting different, such as a MSS310 or MSS210 smart plugs, which are simpler and do not involve the usage of a HUB?

@tourmaline3333
Copy link

I have same issue.

  • Python 3.10.6
  • meross_iot 0.4.5.9
  • MSS110 (x2)
  • OS Ubuntu

I run code on README.md, change from mss310 to mss110.
and, set email and pass.


/file/pub/list.py:51: DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
ERROR:Could not parse error code 20101.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/meross_iot/http_api.py", line 294, in _async_authenticated_post
error = ErrorCodes(code)
File "/usr/lib/python3.10/enum.py", line 385, in call
return cls.new(cls, value)
File "/usr/lib/python3.10/enum.py", line 710, in new
raise ve_exc
ValueError: 20101 is not a valid ErrorCodes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/file/pub/list.py", line 52, in
loop.run_until_complete(main())
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/file/pub/list.py", line 13, in main
http_api_client = await MerossHttpClient.async_from_user_password(email=EMAIL, password=PASSWORD)
File "/usr/local/lib/python3.10/dist-packages/meross_iot/http_api.py", line 106, in async_from_user_password
creds = await cls.async_login(email=email,
File "/usr/local/lib/python3.10/dist-packages/meross_iot/http_api.py", line 203, in async_login
response_data = await MerossHttpClient._async_authenticated_post(url=url,
File "/usr/local/lib/python3.10/dist-packages/meross_iot/http_api.py", line 296, in _async_authenticated_post
raise AuthenticatedPostException(f"Unknown/Unhandled response code received from API. "
meross_iot.model.http.exception.AuthenticatedPostException: Unknown/Unhandled response code received from API. Response was: {'apiStatus': 20101, 'sysStatus': 0, 'info': '', 'timestamp': 1677860545, 'data': {}}

@tourmaline3333
Copy link

I resolved this issue.
I had missed set email and pass.

[before]
'MEROSS_EMAIL'
'MEROSS_PASSWORD'

[after]
"YOUR_MEROSS_CLOUD_EMAIL"
"YOUR_MEROSS_CLOUD_PASSWORD"

@albertogeniola
Copy link
Owner

Glad you solved it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants