stas-demydiuk / ewpe-smart-mqtt

MQTT bridge for EWPE Smart powered devices
MIT License
64 stars 26 forks source link

not binding... #12

Closed frnandu closed 3 years ago

frnandu commented 4 years ago

I have a GREE+ AC unit working with ewpe android app, and I wanted to try out this code, but I'm not getting the "New device bound" message I see other on the forums that others are getting just after the "New Device found (....) binding...", I tried to send commands but I get Device not found, here's my log:

2020-06-29T17:59:00.296Z [info]: Trying to connect to MQTT server mqtt://127.0.0.1 ... 2020-06-29T17:59:00.447Z [info]: Successfully connected to MQTT server 2020-06-29T17:59:00.481Z [info]: Socket server is listening on 0.0.0.0:46858 2020-06-29T17:59:00.764Z [info]: New device found: Parter (f4911ed59a49), binding... 2020-06-29T17:59:00.768Z [info]: New device found: Sypialnia (f4911ec262a3), binding... 2020-06-29T17:59:18.416Z [info]: MQTT message received: ewpe-smart/f4911ec262a3/set {Pow: 1, SetTem: 23} (node:985) UnhandledPromiseRejectionWarning: Error: Device f4911ec262a3 not found

Any ideas what can cause this? Thanks

stas-demydiuk commented 4 years ago

Could you please set LOG_LEVEL to debug and share the log

frnandu commented 4 years ago

ewpe-smart-mqtt@1.0.3 start /home/pi/projects/ewpe-smart-mqtt node index.js

2020-07-04T11:51:01.007Z [info]: Trying to connect to MQTT server mqtt://127.0.0.1 ... 2020-07-04T11:51:01.158Z [info]: Successfully connected to MQTT server 2020-07-04T11:51:01.192Z [info]: Socket server is listening on 0.0.0.0:36408 2020-07-04T11:51:01.194Z [debug]: Scanning network 192.168.1.255 for available devices... 2020-07-04T11:51:01.492Z [info]: New device found: Sypialnia (f4911ec262a3), binding... 2020-07-04T11:51:01.496Z [debug]: Sending request to 192.168.1.23:7000: {mac:f4911ec262a3,t:bind,uid:0} 2020-07-04T11:51:01.498Z [info]: New device found: Parter (f4911ed59a49), binding... 2020-07-04T11:51:01.499Z [debug]: Sending request to 192.168.1.18:7000: {mac:f4911ed59a49,t:bind,uid:0}

frnandu commented 4 years ago

Nmap scan report for pc149.home (192.168.1.18) Host is up (0.081s latency). All 9999 scanned ports on pc149.home (192.168.1.18) are filtered MAC Address: F4:91:1E:D5:9A:49 (Zhuhai Ewpe Information Technology)

Nmap done: 1 IP address (1 host up) scanned in 815.12 seconds

stas-demydiuk commented 4 years ago

Looks like device is not responding on binding request. What model of AC unit do you have?

Also could you please try to change network address from 192.168.1.255 to 192.168.1.23 and check if anything will change

frnandu commented 4 years ago

I have Innova Racker model.

pi@pi4:~/projects/ewpe-smart-mqtt $ export NETWORK=192.168.1.23 pi@pi4:~/projects/ewpe-smart-mqtt $ npm start npm WARN npm npm does not support Node.js v10.19.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9. npm WARN npm You can find the latest version at https://nodejs.org/

ewpe-smart-mqtt@1.0.3 start /home/pi/projects/ewpe-smart-mqtt node index.js

2020-07-04T12:54:05.099Z [info]: Trying to connect to MQTT server mqtt://127.0.0.1 ... 2020-07-04T12:54:05.248Z [info]: Successfully connected to MQTT server 2020-07-04T12:54:05.282Z [info]: Socket server is listening on 0.0.0.0:50629 2020-07-04T12:54:05.283Z [debug]: Scanning network 192.168.1.23 for available devices... 2020-07-04T12:54:05.323Z [info]: New device found: Sypialnia (f4911ec262a3), binding... 2020-07-04T12:54:05.326Z [debug]: Sending request to 192.168.1.23:7000: {mac:f4911ec262a3,t:bind,uid:0}

Also, I tried android app "Packet Capture" to see what kind of network traffic is using my app to connect to the AC unit: Screenshot_20200704-145724_Packet Capture Screenshot_20200704-145730_Packet Capture

So it seems there are UDP packets going to 192.168.1.18 port 7000.... The app I'm using is "Wifi Smart".

On the "Ewpe smart" app when not logged in it doesn't see the units, only when I logon to the ewpe servers, and them the traffic seems to be all going to ewpe servers.

Do you have any idea what might be the problem? Do you think that means ewpe doesn't work locally, only remotely?

frnandu commented 4 years ago

I suspect that maybe these models don't work with old ewpe wifi protocol from ewpe smart app. The packets with ewpe servers seem to be somehow encrypted: Screenshot_20200704-150733_Packet Capture Screenshot_20200704-150739_Packet Capture

So my guess is that the "Wifi smart" app (which works locally on WIFI) maybe has a newer encryption key or some other way of communicating with these units. Any ideas how to crack them?

stas-demydiuk commented 4 years ago

Try to ask @tomikaa87 in the original gree-remote repo for help

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...