tomikaa87 / gree-remote

Simple remote control utility for Gree Smart air conditioners
GNU General Public License v3.0
277 stars 65 forks source link

Innova Racker model time out #32

Closed frnandu closed 3 years ago

frnandu commented 4 years ago

Hi, I'm trying to get this to work with a Gree+ model (Innova Racker), but I get timeouts when trying to get the unit key:

pi@pi4:~/projects/gree-remote/PythonCLI $ python3 gree.py search -b 192.168.1.255 Searching for devices using broadcast address: 192.168.1.255 Search finished, found 1 device(s) Binding device: 192.168.1.23 (Sypialnia, ID: f4911ec262a3) Traceback (most recent call last): File "gree.py", line 189, in search_devices() File "gree.py", line 103, in search_devices bind_device(r) File "gree.py", line 113, in bind_device result = send_data(search_result.ip, 7000, bytes(request, encoding='utf-8')) File "gree.py", line 29, in send_data return s.recv(1024) socket.timeout: timed out

What could cause this? Newer master key or unsupported protocol version? Would appreciate any help. Thanks

frnandu commented 4 years ago

The android app "Gree smart" crashes on my S20 Galaxy, so I have no idea if it works with my units. The newer app Gree+ works but only remotely using servers. The only app that seems to work locally is "Wifi Smart' https://play.google.com/store/apps/details?id=com.wifi.smarthome&hl=en I sniffed a bit using Packet Capture and it communicates with the units on port 7000 UDP, so maybe it's just a question of a newer master key hardcoded into that app. What do you think?

tomikaa87 commented 4 years ago

Hi @frnandu,

So the scan part of the communication is still the same, the devices respond properly, but when you send the binding packed encrypted with the generic AES key, it doesn't respond? I can check if the app you've linked contains another generic key.

frnandu commented 4 years ago

That would be great. I tried to decompile it but I don't have experience in that.

tomikaa87 commented 4 years ago

@frnandu the WiFi Smart app uses the same generic AES key, so it should not be the problem. I've updated the Python CLI script, can you please check if it works now?

frnandu commented 4 years ago

Unfortunately the same:

Searching for devices using broadcast address: 192.168.1.255 Search finished, found 2 device(s) Binding device: 192.168.1.23 (Sypialnia, ID: f4911ec262a3) Traceback (most recent call last): File "gree.py", line 190, in search_devices() File "gree.py", line 104, in search_devices bind_device(r) File "gree.py", line 114, in bind_device result = send_data(search_result.ip, 7000, bytes(request, encoding='utf-8')) File "gree.py", line 30, in send_data return s.recv(1024) socket.timeout: timed out

Aaron0621 commented 4 years ago

Ok guys, seems like I have found the root of the problem....

Its not the bridge app, its not this github app to communicate with the gree-like wifi module-d ACs...

It's the effing "you can only start to control this AC IF you effing register an account on effing EWPE app on effing EWPE cloud with your email, where you wont even get a "hello to EWPE cloud" email...

Somehow, my wifi unit my AC stopped contacting with that "european server" I chose when I "registered" (btw, wtf are they doing with my data??? no service, but you have to register...)

I tried to reconfigure my effing router from 0 (AsusMerlin, had a lot of conf....), tried to move the router much closer (maybe it disconnects a lot) etc.

But when I tried to setup the AC again, it couldnt see the AC...I saw in my routers log, that the AC succesfully connects to it, but my phone app didn't pick it up...

After a long time, i figured, to make another "ACCOUNT", but on a different "server" from where I really live...

Low and behold, here comes The Greatest White Gandalf, and wusshh, it registers within seconds,_"npm start", then no more "memory leak" or anything...

So this problem has to do something with the wifi module registering (or just tries to, or the actual server rejects it for some reason etc) itself on this effing "ewpe cloud"...

My God, help these people...

frnandu commented 4 years ago

I'm not sure I understand exactly, you registered on a different server on the chinese app (which one?) and THEN the code from github (which one exactly?) did work? Can you provide more details?

Aaron0621 commented 4 years ago

In EWPE app, you first and foremost have to create/register an account, right? It asks for a username, email, password and REGION. I've had my region set to EUROPE, and after a month, almost the same thing was happening to me as you - this code (gree-remote) when I started it, it found my device, stating its current settings, device_id etc. But after like 2 minutes, the code ended with an error of memory leak.

Couldn't get it to run.

So what I did, was set up a new account on the phone app EWPE, with a different username, email, and foremost, SERVER (America I think, but I don't think it matters). Right after that, it worked flawlessly when I added the same AC unit with EWPE on the newly created acc.

I guess the phone app registers the device_id on their servers, and if it fails to update it (on my first acc, there must have been a blackout of some sort on the server), it cannot update it once again, since its already registered...or something alike.

frnandu commented 4 years ago

I'm not getting memory leak error just socket time out when trying to bind (using PythonCLI). Which code did you run from this gree-remote, was is also the PythonCLI or something else? Thanks for the help

Aaron0621 commented 4 years ago

Oh sorry, I wrote at the wrong github repository... I meant the one that's an mqtt bridge...but that uses this in some way, isnt it? I saw you posted this there too. So I say you re-register your "acc" on EWPE again on a different region (server), and try to link it up again.

frnandu commented 4 years ago

Do you mean the https://github.com/stas-demydiuk/ewpe-smart-mqtt code? So after register on EWPE app on a different region (server), you just run ewpe-smart-mqtt with npm start and it worked?

Aaron0621 commented 4 years ago

I'm sorry but since I literally wrote it down 3 times already...I feel like you are either trying to troll me, or you shouldn't use such things if you can't see and interpret the explicitly written words I've written before.

frnandu commented 4 years ago

no trolling, I guess since both the phone app and the code from https://github.com/stas-demydiuk/ewpe-smart-mqtt are called/named EWPE, it wasn't clear to me what exactly were you refering too. Besides, you added the exact same response on both issues on different repositories, so not exactly very precise on your part :-/

Aaron0621 commented 4 years ago

I added the exact same response to your problem... Also, I clearly stated which EWPE I was talking about: "In EWPE app" "set up a new account on the phone app EWPE"

frnandu commented 4 years ago

Sorry but that was not clear to me... "In EWPE app" -> I understood as the phone app Only later when you wrote "Oh sorry, I wrote at the wrong github repository... I meant the one that's an mqtt bridge" it became a bit clearer.

frnandu commented 4 years ago

...or you shouldn't use such things if you can't see and interpret the explicitly written words I've written before.

In my opinion, you were not very explicitly, mainly because there are many apps for these units, I have 3 installed in my phone: 1) Wifi Smart -> https://play.google.com/store/apps/details?id=com.wifi.smarthome 2) Ewpe smart -> https://play.google.com/store/apps/details?id=com.gree.ewpesmart 3) GREE+ -> https://play.google.com/store/apps/details?id=com.gree.greeplus

none of them are called exactly EWPE, even though every works with my unit. Also there are a few code repositories which try to make these units work. I was just trying to clarify. That's why I think people give links to better explain what they are refering too.

No need to insult :-/

Aaron0621 commented 4 years ago

Man, please, stop and look at what you are doing... You have 3 apps for the same unit, which means you had to register 3 times (at least), and you claiming I'm not clear about which app, when all apps use the same methods, all need REGION when you register... Stop making yourself look like this...