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

Issue with midea cloud: bad gateway #13

Open
ghost opened this issue Jul 14, 2021 · 2 comments
Open

Issue with midea cloud: bad gateway #13

ghost opened this issue Jul 14, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 14, 2021

since 13-Jul-2021 an issue with Midea cloud exists.
when running script dehumi_control.py an exception occurs.

Steps to reproduce:
start dehumi_control.py with -e user@mail -p

select menu 0 -- log in to midea cloud -- OK
select menu 1 -- list appliances -- OK
select menu 3 -- get status -- ERROR

from running with -d option:
EBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mapp.appsmb.com:443
DEBUG:urllib3.connectionpool:https://mapp.appsmb.com:443 "POST /v1/appliance/transparent/send HTTP/1.1" 502 170
DEBUG:root:MideaClient::send_api_request: response=

<title>502 Bad Gateway</title>

502 Bad Gateway


openresty

INFO:root:MideaClient::send_api_request: response_status=502, response_reason=Bad Gateway
Traceback (most recent call last):
File "dehumi_control.py", line 387, in
main(sys.argv)
File "dehumi_control.py", line 362, in main
getDeviceStatus()
File "dehumi_control.py", line 75, in getDeviceStatus
res = client.get_device_status(deviceId)
File "/home/pi/iotenv/lib/python3.5/site-packages/midea_inventor_lib/midea_client.py", line 203, in get_device_status
decodedReplyStr = self.appliance_transparent_send(deviceId, dataStr)
File "/home/pi/iotenv/lib/python3.5/site-packages/midea_inventor_lib/midea_client.py", line 525, in appliance_transparent_send
"applianceId": appliance_id })
File "/home/pi/iotenv/lib/python3.5/site-packages/midea_inventor_lib/midea_client.py", line 585, in __api_request
response = self.__send_api_request(path, args)
File "/home/pi/iotenv/lib/python3.5/site-packages/midea_inventor_lib/midea_client.py", line 596, in __send_api_request
data = response.json()
File "/home/pi/iotenv/lib/python3.5/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.5/json/init.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@Tezzlicious
Copy link

Tezzlicious commented Jul 14, 2021

Same issue.

Update: I went for the following solution: https://github.com/Hypfer/esp8266-midea-dehumidifier

@deepcoder
Copy link

The client request :
https://mapp.appsmb.com/v1/appliance/transparent/send/new

seems to fail and return a non-json, but rather HTML response of "502 Bad Gateway"

not being a json response seems to cause the code at line 596 of midea_client.py :

data = response.json()

to fail.

The Midea IOS app seems to get this 502 Bad Gateway reply to this request, ignores it and move forward with no apparent negative consequences. Watching this interaction via mitmproxy.org proxy.

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

No branches or pull requests

2 participants