neilpatel121 / homebridge-skyq-tvremote

Apache License 2.0
10 stars 3 forks source link

Homebridge crashing on accessory publish #14

Closed benfysh closed 3 years ago

benfysh commented 3 years ago

Describe The Bug: Homebridge restarting on v1.1.1 when IP address is populated.

To Reproduce: Install v1.1.1 Setup details in settings or config: Restart Homebridge to apply config The error in the logs below is shown and Homebridge restarts

Expected behavior: Homebridge not crashing

Logs:

[16/04/2021, 10:21:39] TypeError: Cannot read property 'Characteristic' of undefined
    at SkyTVPlugin.publishExternalAccessory (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:99:48)
    at /usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:48:14
    at Array.forEach (<anonymous>)
    at new SkyTVPlugin (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:45:22)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:440:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:372:27)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:159:29)

Plugin Config:

                {
            "devices": [
                {
                    "name": "Sky Q",
                    "ipAddress": "192.168.6.223"
                },
                {
                    "name": "Sky Q Mini",
                    "ipAddress": "192.168.6.224"
                },
                {
                    "name": "Sky Q Mini 2",
                    "ipAddress": "192.168.6.225"
                }
            ],
            "platform": "skyq-tvremote"
        }

Screenshots: N/A

Environment:

SmolSoftBoi commented 3 years ago

Could you test v1.1.2 please?

benfysh commented 3 years ago

Now getting a different also crashing error in the logs

[16/04/2021, 13:34:06] TypeError: Cannot read property 'uuid' of undefined
    at SkyTVPlugin.publishExternalAccessory (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:115:22)
    at /usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:48:14
    at Array.forEach (<anonymous>)
    at new SkyTVPlugin (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:45:22)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:440:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:372:27)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:159:29)
Starting to advertise 'Office TV 95B8' using ciao backend!
[16/04/2021, 13:34:06] Office TV 95B8 is running on port 32935.
[16/04/2021, 13:34:06] Please add [Office TV 95B8] manually in Home app. Setup Code: 031-54-157
[16/04/2021, 13:34:06] [BroadlinkRM] Office TV getSwitchState: 0
[16/04/2021, 13:34:06] Got SIGTERM, shutting down Homebridge...
[16/04/2021, 13:34:07] [skyq-tvremote] The sky box is in standby
[16/04/2021, 13:34:07] ERR_SERVER_CLOSED: Cannot send packets on a closed mdns server!
    at MDNSServer.assertBeforeSend (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:403:13)
    at MDNSServer.sendOnAllNetworksForService (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:302:10)
    at MDNSServer.sendQueryBroadcast (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:263:26)
    at Prober.sendProbeRequest (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:165:17)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
SmolSoftBoi commented 3 years ago

Could you test 1.1.1-beta.1 please?

benfysh commented 3 years ago

Slightly different error

[16/04/2021, 13:46:46] TypeError: Accessory is not a constructor
    at SkyTVPlugin.publishExternalAccessory (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:118:23)
    at /usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:48:14
    at Array.forEach (<anonymous>)
    at new SkyTVPlugin (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:45:22)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:440:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:372:27)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:159:29)
Starting to advertise 'Office TV 95B8' using ciao backend!
[16/04/2021, 13:46:46] Office TV 95B8 is running on port 35985.
[16/04/2021, 13:46:46] Please add [Office TV 95B8] manually in Home app. Setup Code: 031-54-157
[16/04/2021, 13:46:46] [BroadlinkRM] Office TV getSwitchState: 0
[16/04/2021, 13:46:46] Got SIGTERM, shutting down Homebridge...
[16/04/2021, 13:46:47] [BroadlinkRM] [INFO] Discovered Broadlink RM3 Mini (2737) at 192.168.7.26 (34:ea:34:e3:d6:d5)
[16/04/2021, 13:46:47] [skyq-tvremote] The sky box is in standby
[16/04/2021, 13:46:47] ERR_SERVER_CLOSED: Cannot send packets on a closed mdns server!
    at MDNSServer.assertBeforeSend (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:403:13)
    at MDNSServer.sendOnAllNetworksForService (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:302:10)
    at MDNSServer.sendQueryBroadcast (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:263:26)
    at Prober.sendProbeRequest (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:165:17)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
SmolSoftBoi commented 3 years ago

Could you test v1.1.1-beta.2?

benfysh commented 3 years ago

this is the latest:

[16/04/2021, 15:26:02] Error: Cannot add a Service with the same UUID '0000003E-0000-1000-8000-0026BB765291' as another Service in this Accessory without also defining a unique 'subtype' property.
    at Accessory.addService (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:445:17)
    at PlatformAccessory.addService (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:93:41)
    at SkyTVPlugin.publishExternalAccessory (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:122:44)
    at /usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:46:14
    at Array.forEach (<anonymous>)
    at new SkyTVPlugin (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:43:22)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:440:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:372:27)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:159:29)
Starting to advertise 'Office TV 95B8' using ciao backend!
[16/04/2021, 15:26:02] Office TV 95B8 is running on port 39581.
[16/04/2021, 15:26:02] Please add [Office TV 95B8] manually in Home app. Setup Code: 031-54-157
[16/04/2021, 15:26:02] [BroadlinkRM] Office TV getSwitchState: 0
[16/04/2021, 15:26:02] Got SIGTERM, shutting down Homebridge...
[16/04/2021, 15:26:02] [skyq-tvremote] The sky box is in standby
[16/04/2021, 15:26:02] ERR_SERVER_CLOSED: Cannot send packets on a closed mdns server!
    at MDNSServer.assertBeforeSend (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:403:13)
    at MDNSServer.sendOnAllNetworksForService (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:302:10)
    at MDNSServer.sendQueryBroadcast (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:263:26)
    at Prober.sendProbeRequest (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:165:17)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
SmolSoftBoi commented 3 years ago

Could you test 1.1.1-beta.3 please?

benfysh commented 3 years ago

Now getting"

[16/04/2021, 16:44:41] TypeError: Cannot read property 'Characteristic' of undefined
    at SkyTVPlugin.publishExternalAccessory (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:206:78)
    at /usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:46:14
    at Array.forEach (<anonymous>)
    at new SkyTVPlugin (/usr/local/lib/node_modules/homebridge-skyq-tvremote/src/platform.ts:43:22)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:440:40
    at Array.forEach (<anonymous>)
    at Server.loadPlatforms (/usr/local/lib/node_modules/homebridge/src/server.ts:372:27)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:159:29)
Starting to advertise 'Office TV 95B8' using ciao backend!
[16/04/2021, 16:44:41] Office TV 95B8 is running on port 38473.
[16/04/2021, 16:44:41] Please add [Office TV 95B8] manually in Home app. Setup Code: 031-54-157
[16/04/2021, 16:44:41] [BroadlinkRM] Office TV getSwitchState: 0
[16/04/2021, 16:44:41] Got SIGTERM, shutting down Homebridge...
[16/04/2021, 16:44:41] [skyq-tvremote] The sky box is in standby
[16/04/2021, 16:44:41] ERR_SERVER_CLOSED: Cannot send packets on a closed mdns server!
    at MDNSServer.assertBeforeSend (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:403:13)
    at MDNSServer.sendOnAllNetworksForService (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:302:10)
    at MDNSServer.sendQueryBroadcast (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:263:26)
    at Prober.sendProbeRequest (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:165:17)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
SmolSoftBoi commented 3 years ago

Could you test v1.1.1-beta.4 please?

benfysh commented 3 years ago

That one worked, didnt crash Homebridge but I needed to remove and add back the boxes for them to respond in the home app but all good now. Thanks 👍

As an aside am misremembering or did the logs specify which box the entries related to as its now just generic?

[16/04/2021, 17:04:38] [skyq-tvremote] Set Active: ACTIVE
[16/04/2021, 17:04:43] [skyq-tvremote] Skipping Active: new value is equal to current value
[16/04/2021, 17:04:48] [skyq-tvremote] Set Active: INACTIVE
SmolSoftBoi commented 3 years ago

That's great, could you test v1.1.1-beta.5 for the logs please?

benfysh commented 3 years ago

confirmed as working in v1.1.1-beta.5

[16/04/2021, 17:51:28] [skyq-tvremote] [Sky Q] Get Active: INACTIVE
[16/04/2021, 17:51:28] [skyq-tvremote] [Sky Q Mini 2] Get Active: INACTIVE
[16/04/2021, 17:51:28] [skyq-tvremote] [Sky Q Mini] Get Active: INACTIVE