Isaksson / node-red-contrib-unifi

MIT License
52 stars 20 forks source link

Ver 0.3.2 problem #111

Closed PowerZone21 closed 1 year ago

PowerZone21 commented 1 year ago

Hi, Updated from 0.3.1 to 0.3.2 today on my raspberry Pi. Everytime i push 'Inject' the system restarts

Anybody else have this problem?

Isaksson commented 1 year ago

Hello. Are you sure that 0.3.1 worked for you or did you update from 0.2.x to 0.3.2?

PowerZone21 commented 1 year ago

Not 100% shure, it was the version available before 0.3.2

Isaksson commented 1 year ago

Ahh okey, then I guess that you went from 0.2.x the difference between 0.3.1 and 0.3.2 is only added example.

I have not tested this version on an Rpi but several Windows installations without any issues.

Do you have same kind of Node-RED Log that could indicate what's happening?

PowerZone21 commented 1 year ago

I tried to add a debug node, but nothing reported.

About 5 sec after I push inject, node-red restarts. Nothing reported in debug window.

Isaksson commented 1 year ago

Because Node-RED is restarting there must be some fatal error. Do you start Node-RED by console or some script? We need to to see the console output and maybe there we could see what's going on.

PowerZone21 commented 1 year ago

I have tried to log the console while pushing inject `pi@raspberrypi:~ $ node-red-log

5 Aug 13:49:51 - [error] [magic-home-rgbcw:PZ_Ice] Command timed out
5 Aug 14:02:20 - [info] [glances:PZ-Watch] pushover POST succeeded:
"{\"status\":1,\"request\":\"b2a2a086-37c0-4206-baeb-fc36a1c1e01b\"}"
5 Aug 14:32:20 - [info] [glances:PZ-Watch] pushover POST succeeded:
"{\"status\":1,\"request\":\"7a83cbee-f507-4311-9fdc-0762e8ce687d\"}"
5 Aug 14:59:51 - [error] [magic-home-rgbcw:PZ_Ice] Command timed out
5 Aug 15:02:20 - [info] [glances:PZ-Watch] pushover POST succeeded:
"{\"status\":1,\"request\":\"08e6b0e0-2dae-4296-88a2-d6b393d260d5\"}"
5 Aug 15:28:35 - [error] [magic-home-rgbcw:PZ_kitchen_strip] Command timed out
5 Aug 15:31:38 - [error] [magic-home-rgbcw:PZ_kitchen_strip] Command timed out
5 Aug 15:32:20 - [info] [glances:PZ-Watch] pushover POST succeeded:
"{\"status\":1,\"request\":\"4becf0b9-4a75-45ca-b381-3045fdd3f848\"}"
5 Aug 15:34:43 - [error] [magic-home-rgbcw:PZ_kitchen_strip] Command timed out
5 Aug 15:39:28 - [error] [magic-home-rgbcw:PZ_kitchen_strip] Command timed out
5 Aug 15:42:35 - [error] [magic-home-rgbcw:PZ_kitchen_strip] Command timed out
5 Aug 15:45:56 - [error] [magic-home-rgbcw:PZ_kitchen_strip] Command timed out
5 Aug 15:49:32 - [error] [magic-home-rgbcw:PZ_kitchen_strip] Command timed out
5 Aug 15:53:11 - [error] [magic-home-rgbcw:PZ_kitchen_strip] Command timed out
Broadlink: Data Received - Determining Type.
Broadlink: BroadlinkData <Buffer 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>
Broadlink: Success Data Received - Type 2 Data Successful.
5 Aug 15:55:40 - [info] [RM:PZ_UniversalRemote] Broadlink: Closing Device Connection
5 Aug 15:59:51 - [error] [magic-home-rgbcw:PZ_Ice] Command timed out
5 Aug 16:02:20 - [info] [glances:PZ-Watch] pushover POST succeeded:
"{\"status\":1,\"request\":\"59b15593-c982-41ee-9f8a-16615340e3a2\"}"
5 Aug 16:03:56 - [red] Uncaught Exception:
5 Aug 16:03:56 - [error] TypeError: Cannot read properties of undefined (reading 'data')
    at /home/pi/.node-red/node_modules/node-red-contrib-unifi/unifi-helper.js:1826:40
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 2.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
5 Aug 16:04:18 - [info]
Welcome to Node-RED
===================
5 Aug 16:04:18 - [info] Node-RED version: v3.0.2
5 Aug 16:04:18 - [info] Node.js  version: v16.19.0
5 Aug 16:04:18 - [info] Linux 5.10.17-v7l+ arm LE
5 Aug 16:04:19 - [info] Loading palette nodes
5 Aug 16:04:23 - [info] Dashboard version 3.5.0 started at /ui
5 Aug 16:04:24 - [info] Settings file  : /home/pi/.node-red/settings.js
5 Aug 16:04:24 - [info] Context store  : 'default' [module=memory]
5 Aug 16:04:24 - [info] User directory : /home/pi/.node-red
5 Aug 16:04:24 - [warn] Projects disabled : editorTheme.projects.enabled=false
5 Aug 16:04:24 - [warn] Flows file name not set. Generating name using hostname.
5 Aug 16:04:24 - [info] Flows file     : /home/pi/.node-red/flows_raspberrypi.json
5 Aug 16:04:24 - [info] Server now running at http://127.0.0.1:1880/
5 Aug 16:04:24 - [warn]

`

Isaksson commented 1 year ago

I see, this seems to be related to the new error handling. I am on vacation and don't have access to a computer, but if you feel comfortable to edit files, then you could try to comment out // row 1826 to 1832 in the file named unifi-helper.js and then restart Node-RED and then try again.

This file that you should edit is located inte the module folder where this Node is installed.

PowerZone21 commented 1 year ago

I have absolutly no idea how to edit this, but no problem. I have waited i while for the node to work sinse the 'tibber' node problem started. So a little more waiting are good for me

Isaksson commented 1 year ago

I have now release version 0.3.3, please try and see if that fixes your issue.

PowerZone21 commented 1 year ago

Hi. Updated to 0.3.3 and that problem solved, no restart.

When I push 'inject' Unifi node shows 'unknown error' Tried both with and without SSL

Isaksson commented 1 year ago

Thanks for the test, yeah, the root cause must be something else for you, the reason why it crashed for you with 0.3.2 was after the request already had failed.

Your test is with the Tibber Node disabled?

PowerZone21 commented 1 year ago

My tibber is enabled ans in use.

Isaksson commented 1 year ago

Ahh I see, then we have to wait for some kind of response from the developer of the Tibber Node. No response yet from the developer, I have posted an issue at his GitHub

PowerZone21 commented 1 year ago

Thats allright👍🏻