tomikaa87 / gree-remote

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

Registering AC on the network #29

Open grunci opened 4 years ago

grunci commented 4 years ago

Hi, Do you have information about how the registration of the AC happens on the network? I mean, when I set the WiFi access for the device on EWPE application.

Regards, Grunci

tomikaa87 commented 4 years ago

Hi,

I didn't capture the communication sequence of this, but it would be awesome if we could add this to the documentation.

If you have the time you can try the capture. One way you can do this on an android phone via the app called Packet Capture by Grey Shirts. It basically sets up a proxy on the phone and captures the traffic between the phone and the AC. Just start the proxy before setting up the WiFi access in the EWPE application and it'll capture the communication. You can upload the capture here and I'll help you analyze it or you can do it yourself with Wireshark.

Another way is to use a linux PC with a WiFi adapter that can be switched to monitor mode. The easiest way to use Kali linux live from a USB stick. If you choose this I can help you setup the system for packet capturing.

ziceva commented 4 years ago

Hi,

When in "setup more", the AC creates a WiFi Access Point with the name being the last 4 bytes of the MAC address. I have managed to connect to this AP with password 12345678 and I have simply sent the following telegram to IP 192.168.1.1 (the AC IP on the "setup mode" AP) on the UDP port 7000

{"psw": "<wifi pass>","ssid": "<wifi ap>","t": "wlan"}

And this seemed to do the trick for my AC ...

doppiaemme commented 4 years ago

Hi,

When in "setup more", the AC creates a WiFi Access Point with the name being the last 4 bytes of the MAC address. I have managed to connect to this AP with password 12345678 and I have simply sent the following telegram to IP 192.168.1.1 (the AC IP on the "setup mode" AP) on the UDP port 7000

{"psw": "<wifi pass>","ssid": "<wifi ap>","t": "wlan"}

And this seemed to do the trick for my AC ...

This would be an amazing feature.... I hate using the app, it's full of bugs, and I don't trust entering my wifi password in there... can we trust the password, from the app, doesn't go into some questionable cloud service?

it would be great to have an easy command to push the SSID and PW like you showed above!

uriel-frankel commented 3 years ago

Thanks @doppiaemme I added his feature.

nameoftherose commented 2 years ago

@uriel-frankel , is the feature asked by @doppiaemme publicly available? Thank you

MotiGross commented 2 years ago

Hi, i'm adding the AC unit response: {"t":"ret","r":200}

uriel-frankel commented 2 years ago

@nameoftherose it was merged a year ago

narcisrazvanpopescu commented 1 year ago

Please can you post here an step by step procedure to send the ssid and pass to the unit in ap mode. I have 2 units that I can't make them registering to the network with Gree+ because I always get an error at 50-60% of the inclusion process. If included in the network I can control them with HA. Many thanks!

augre commented 1 year ago

Hi, This is not a direct answer to your question. I could register the AC-s to the network with an older iphone SE 2022. I tried it with Pixel 6a and older android phones. If I remember correctly then the issue was that some buttons did not show up on the Androui GUI but they did on the IOS. maybe this helps.

narcisrazvanpopescu commented 1 year ago

I tried everything with galaxy S21+ an s10 I have 2 more units included but the problem I think it is on the server side and without inclusion I can't make them join the network and control them with Home Assistant (need for Gree+ only for joining network).

MotiGross commented 1 year ago

Hi, working with "hyper terminal" is an option? if the answer is yes:
step 1. using either a phone or laptop, scan the available WIFI networks, if you find something like "c69b6c4d" choose it and connect with password: 12345678 if you can't find any of such weird WIFI SSID, check you AC unit if WIFI is on, if it's is ON, reset the AC unit: turn it off, than press those 2 buttons on the remote control: MODE +WIFI at the same time for ~3seconds. turn the power off and on(unplugged from the mains power) , and repeat step 1 to search WIFI networks note, write down this SSID name, you'll need it after.

Step 2, assuming the phone/laptop connected to the AC unit WIFI directly, open terminal (i'm using Hercules with my laptop win10 , and used once something on my android phone can't remember the name) you need to set the target , which is your AC unit, which at this point has the IP=192.168.1.1 , and set the port to 7000 udp. step 3: send the connect to your home WIFI command as string . the template is : {"psw": "xxx","ssid": "yyy","t": "wlan"} note, replace xxx with your WIFI psw, and replace yyy with your WIFI SSID. at this point you might get response: {"t":"ret","r":200} and might not, any way, keep your eyes on your wifi setup , if you're no longer connected to the AC directly , and this SSID not avaible via scan, it most likely now connected to your home WIFI, my way to check if it is indeed connected, is to login to my router, goes over the DHCP connected devices, if the previous weird SSID which u write somewhere if u followed my advice at step 1) , shown as one of the connected MAC IDs . the full MAC id is a bit longer, but the SSID is the last digits of the MAC.

i hope it helps :-)

narcisrazvanpopescu commented 1 year ago

Thank you guys for help, I will try to follow your specifications when I will at location where the units are. I also find that the Unix echo and nc command can be used.

narcisrazvanpopescu commented 1 year ago

I finally succeeded registering the units into my network by sending that packet. My units didn't send any response, but after few seconds has joined the network and after few minutes the Gree integration from Homeassistant adopted the units. Thanks again for your huge help!

stefanturcanu commented 1 year ago

I finally succeeded registering the units into my network by sending that packet. My units didn't send any response, but after few seconds has joined the network and after few minutes the Gree integration from Homeassistant adopted the units. Thanks again for your huge help!

Hi narcis, been trying for a while to get my gree ACs on the network as well. Would you please share the terminal commands? Mersi frumos! :)

narcisrazvanpopescu commented 1 year ago

I used UDP/TCP WIDGET for Android and send the message> {"psw":"parolawifi","ssid":"ssidwifi","t":"wlan"} to 192.168.1.1 port 7000, after i joined the network created by Gree AC. I think i received from AC the message {"t":"scan}. Be aware that you will not be able to see the AC in the Gree+ (witch it is a crap) app but you can manage the unit from Homeassistant or any other automation software capable to administrate Gree locally. If you have access to Homeassistant from outside your network you will also have remote access to AC units, I use Tailscale for that. (poti sa ma contactezi privat pe @gmail.com)

ziceva commented 1 year ago

The same messages can be sent from a PC with the Packet Sender app ...

csubakk commented 11 months ago

Hy! The template for open wifi network? {"psw": "","ssid": "yyy","t": "wlan"} not worked form me.

The response was: {"t":"ret","r":200,"mac":"XXXXXXX"}

MotiGross commented 11 months ago

I can only guess it trying to, could be that "ret" =retry? Could be that you typed wrong password? Can you share here the whole string as you sent it?

csubakk commented 11 months ago

The password is empty. Is an open wifi network.

{"psw": "","ssid": "yyy","t": "wlan"}

where "yyy' is my network ssid

The response was same for everybody, for me was the mac address in plus