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

Node-RED crash if you try to access second HVAC unit #11

Open
soosp opened this issue Nov 8, 2022 · 10 comments
Open

Node-RED crash if you try to access second HVAC unit #11

soosp opened this issue Nov 8, 2022 · 10 comments

Comments

@soosp
Copy link

soosp commented Nov 8, 2022

At one of my deployment there is two Gree HVAC units. If you try to control firstly configured one, it works well. It you try to control the second one it crashes and kills all Node-RED instance.

@soosp
Copy link
Author

soosp commented Nov 8, 2022

Here is the log fragment:

Nov  8 18:20:46 raspberrypi Node-RED[12074]: 8 Nov 18:20:46 - [info] Starting flows
Nov  8 18:20:47 raspberrypi Node-RED[12074]: 8 Nov 18:20:47 - [info] Started flows
Nov  8 18:22:06 raspberrypi Node-RED[12074]: 8 Nov 18:22:06 - [red] Uncaught Exception:
Nov  8 18:22:06 raspberrypi Node-RED[12074]: 8 Nov 18:22:06 - [error] TypeError: Cannot read property '0' of undefined
Nov  8 18:22:06 raspberrypi Node-RED[12074]:     at /home/pi/.node-red/node_modules/gree-hvac-client/lib/client.js:383:46
Nov  8 18:22:06 raspberrypi Node-RED[12074]:     at Array.forEach (<anonymous>)
Nov  8 18:22:06 raspberrypi Node-RED[12074]:     at Client._handleUpdateConfirmResponse (/home/pi/.node-red/node_modules/gree-hvac-client/lib/client.js:382:18)
Nov  8 18:22:06 raspberrypi Node-RED[12074]:     at Client._handleResponse (/home/pi/.node-red/node_modules/gree-hvac-client/lib/client.js:312:29)
Nov  8 18:22:06 raspberrypi Node-RED[12074]:     at Socket.<anonymous> (/home/pi/.node-red/node_modules/gree-hvac-client/lib/client.js:113:52)
Nov  8 18:22:06 raspberrypi Node-RED[12074]:     at Socket.emit (events.js:400:28)
Nov  8 18:22:06 raspberrypi Node-RED[12074]:     at UDP.onMessage (dgram.js:931:8)
Nov  8 18:22:06 raspberrypi systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE
Nov  8 18:22:06 raspberrypi systemd[1]: nodered.service: Failed with result 'exit-code'.
Nov  8 18:22:06 raspberrypi systemd[1]: nodered.service: Consumed 13.576s CPU time.

@soosp
Copy link
Author

soosp commented Nov 10, 2022

The modell number of the first one: GWH12QC-K6DNA1D
The second one: GW12AFC-K6DNA2F

@Henkkas52
Copy link

@soosp I have also 2 GREE units, controlled by Node RED, but they run perfectly. The only thing is you have to keep your registration at GREE+ app, because otherwise your wifi will stop after 2 weeks or so. But your situation shouldn't be an issue normally.

@sixtybi
Copy link

sixtybi commented Jan 8, 2023

I have the same problem. Have you found a solution for this?
I have two types of AC in my home:
Syen SOH09BO-E32DA4A2 (this has the same issue as descibed above)
Syen SOH12MU-E32DA1D (this is working fine with this node)

@sixtybi
Copy link

sixtybi commented Jan 8, 2023

I have found a workaround for this, but it's not a solution.
I realized that the problem is when the package type is response.
In the case of my Syen SOH09BO-E32DA4A2, the value is undefined here.
The the status can be read fine, and also the output package is fine, the AC unit is set according to the outut.
I have commented this part out in client.js:
// If package type is response, update device properties
/* if (pack.t === 'res') {
return this._handleUpdateConfirmResponse(pack);
} */

Line 312. This way there is no response to the UI right after the changes has been applied, but only after the status polling, which is set to 1 seconds by default. OK, there is some latency, but it works at least now.

If someone has a better WA/solution, please let us know. Thanks!

@bega1986
Copy link

bega1986 commented Jan 16, 2023

It is working, thank you! I cant solve the original problem, but this WA is good for me.

@ttgabi01
Copy link

ttgabi01 commented Mar 5, 2023

Hi! That's my problem. Exactly where and what should be pasted?

@bega1986
Copy link

bega1986 commented Mar 23, 2023

Hi! That's my problem. Exactly where and what should be pasted?

Hi.

In this file:
.node-red/node_modules/gree-hvac-client/lib/client.js

Original:
if (pack.t === 'res') {
return this._handleUpdateConfirmResponse(pack);
}

Modified:
/* if (pack.t === 'res') {
return this._handleUpdateConfirmResponse(pack);
} */

@ttgabi01
Copy link

ttgabi01 commented Apr 4, 2023

Thank you! Its work!

@soosp
Copy link
Author

soosp commented Jul 24, 2023

Unfortunately this workaround did not solve my problem with GW12AFC-K6DNA2F unit:

Jul 24 20:04:35 raspberrypi Node-RED[6907]: 24 Jul 20:04:35 - [red] Uncaught Exception:
Jul 24 20:04:35 raspberrypi Node-RED[6907]: 24 Jul 20:04:35 - [error] TypeError: Cannot read property '0' of undefined
Jul 24 20:04:35 raspberrypi Node-RED[6907]:     at /home/pi/.node-red/node_modules/gree-hvac-client/lib/client.js:383:46
Jul 24 20:04:35 raspberrypi Node-RED[6907]:     at Array.forEach (<anonymous>)
Jul 24 20:04:35 raspberrypi Node-RED[6907]:     at Client._handleUpdateConfirmResponse (/home/pi/.node-red/node_modules/gree-hvac-client/lib/client.js:382:18)
Jul 24 20:04:35 raspberrypi Node-RED[6907]:     at Client._handleResponse (/home/pi/.node-red/node_modules/gree-hvac-client/lib/client.js:312:29)
Jul 24 20:04:35 raspberrypi Node-RED[6907]:     at Socket.<anonymous> (/home/pi/.node-red/node_modules/gree-hvac-client/lib/client.js:113:52)
Jul 24 20:04:35 raspberrypi Node-RED[6907]:     at Socket.emit (events.js:400:28)
Jul 24 20:04:35 raspberrypi Node-RED[6907]:     at UDP.onMessage (dgram.js:931:8)
Jul 24 20:04:35 raspberrypi systemd[1]: nodered.service: Main process exited, code=exited, status=1/FAILURE
Jul 24 20:04:35 raspberrypi systemd[1]: nodered.service: Failed with result 'exit-code'.
Jul 24 20:04:35 raspberrypi systemd[1]: nodered.service: Consumed 45.586s CPU time.
Jul 24 20:04:55 raspberrypi systemd[1]: nodered.service: Scheduled restart job, restart counter is at 2.
Jul 24 20:04:55 raspberrypi systemd[1]: Stopped Node-RED graphical event wiring tool.
Jul 24 20:04:55 raspberrypi systemd[1]: nodered.service: Consumed 45.586s CPU time.
Jul 24 20:04:55 raspberrypi systemd[1]: Started Node-RED graphical event wiring tool.
˛˛˛

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

5 participants