grzegorz914 / homebridge-lgwebos-tv

Homebridge plugin for LG WebOS TV, publish as independent external platform accessory.
MIT License
134 stars 15 forks source link

Crashing HB service #102

Closed ArtemKiyashko closed 3 years ago

ArtemKiyashko commented 3 years ago

After a lot of experiments i realised this plugin crashing latest homebridge server just few second after launching. Disabling this plugin will stop infinite service restart and HB service working properly.

I also realised, that similar plugin (https://github.com/merdok/homebridge-webos-tv#readme) running into same behaviour. So im not really sure where is the problem, maybe in some common dependency.

grzegorz914 commented 3 years ago

May be U get some debug log from console?

infvmm commented 3 years ago

I got same problem with different plugins too, debug log is this:

[5/8/2021 14:05:41] [webostv] [Tele] Connected to TV [5/8/2021 14:05:41] [webostv] [Tele] Requesting TV information [5/8/2021 14:05:41] [webostv] [Tele] system service - getSystemInfo requested. [5/8/2021 14:05:41] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGBUS [5/8/2021 14:05:46] [HB Supervisor] Restarting Homebridge...

Some clue, if i don´t enable the tv connection it works, problem seems happen when is sharing some info.

grzegorz914 commented 3 years ago

this is not from my plugin

infvmm commented 3 years ago

yes i know, it was my test on the other, i´m currently installing yours again. It was only to let you know some clue.

infvmm commented 3 years ago

I can share with you now the log with yours:

[5/8/2021 14:29:04] [LgWebOsTv] Device: XXX.XXX.XXX.XXX Tele, waiting on confirmation... [5/8/2021 14:29:07] [LgWebOsTv] Device: XXX.XXX.XXX.XXX Tele, connected. [5/8/2021 14:29:07] [LgWebOsTv] Device: XXX.XXX.XXX.XXX Tele, connecting to TV RC Socket [5/8/2021 14:29:07] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGBUS [5/8/2021 14:29:12] [HB Supervisor] Restarting Homebridge...

I hope this log can throw more info.

grzegorz914 commented 3 years ago

what a tv model, homebridge, npm, node version? installed machine, config

infvmm commented 3 years ago

SW: 05.60.05 TV: webOS TV UH850V Homebridge v1.3.4 Node: v14.17.4 NPM: 7.20.3 Raspberry pi 4 "devices": [ { "name": "Tele", "host": "XXX", "mac": "XXX", "refreshInterval": 5, "disableLogInfo": false, "switchInfoMenu": false, "getInputsFromDevice": true } ], "platform": "LgWebOsTv"

grzegorz914 commented 3 years ago

This is webOS TV 3.0 must working, try uninstalling all other plugins and try again, may be some conflict, check write permission to disk

ArtemKiyashko commented 3 years ago

@grzegorz914 sorry, for the lack of info, havent expect so rapid reaction. So... Part from console:

[05/08/2021, 14:50:33] [LgWebOsTv] Device: 192.168.1.56 LG TV, Input: Wink, get target visibility state: SHOWN
[05/08/2021, 14:50:33] [LgWebOsTv] Device: 192.168.1.56 LG TV, Input: Российские программы, get target visibility state: SHOWN
[05/08/2021, 14:50:33] [LgWebOsTv] Device: 192.168.1.56 LG TV, Input: PREMIER, get target visibility state: SHOWN
[05/08/2021, 14:50:33] [LgWebOsTv] Device: 192.168.1.56 LG TV, Input: wifire-tv-lite, get target visibility state: SHOWN
[05/08/2021, 14:50:37] [LgWebOsTv] Device: 192.168.1.56 LG TV, connected.
[05/08/2021, 14:50:37] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGBUS
[05/08/2021, 14:50:42] [HB Supervisor] Restarting Homebridge...

OS: Raspbian GNU/Linux Buster (10) Node v: v14.17.4 Npm v: v6.14.14

Config part:

{
            "devices": [
                {
                    "name": "LG TV",
                    "host": "192.168.1.56",
                    "mac": "60:AB:14:59:79:66",
                    "refreshInterval": 5,
                    "disableLogInfo": false,
                    "switchInfoMenu": false,
                    "getInputsFromDevice": true
                }
            ],
            "platform": "LgWebOsTv"
        },

Plugin version: 1.8.17 TV Model: LG OLED C9

ArtemKiyashko commented 3 years ago

Just disabled all other plugins and got the same:

Screen Shot 2021-08-05 at 15 07 24 Screen Shot 2021-08-05 at 15 08 52
grzegorz914 commented 3 years ago

try uninstall one webOS plugin

ArtemKiyashko commented 3 years ago

@grzegorz914 done. the same =(

grzegorz914 commented 3 years ago

Can You enable debug mode in HB config and get the log again?

infvmm commented 3 years ago

In my case the log is with debug mode in HB:

[5/8/2021 14:29:07] [LgWebOsTv] Device: XX Tele, connected. [5/8/2021 14:29:07] [LgWebOsTv] Device: XX Tele, connecting to TV RC Socket [5/8/2021 14:29:07] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGBUS [5/8/2021 14:29:12] [HB Supervisor] Restarting Homebridge... [5/8/2021 14:29:12] [HB Supervisor] Starting Homebridge with extra flags: -I -D [5/8/2021 14:29:12] [HB Supervisor] Started Homebridge v1.3.4 with PID: 2878

grzegorz914 commented 3 years ago

@infvmm this is not a debug mode log

infvmm commented 3 years ago

@grzegorz914 is it not enough with -D flag?. If there is another way to enable debug mode log please let me know to be able to share more info. I´m going to share all I have currently with -D in my log, i didn´t share all info:

[5/8/2021 15:38:20] [LgWebOsTv] didFinishLaunching [5/8/2021 15:38:20] [LgWebOsTv] Adding new accessory: Tele [5/8/2021 15:38:20] [LgWebOsTv] prepareAccessory [5/8/2021 15:38:20] [LgWebOsTv] prepareInformationService [5/8/2021 15:38:20] [LgWebOsTv] Device: XXXXX Tele, prepareInformationService error: SyntaxError: Unexpected end of JSON input at JSON.parse () at lgwebosTvDevice.prepareAccessory (/usr/lib/node_modules/homebridge-lgwebos-tv/index.js:506:55) [5/8/2021 15:38:20] [LgWebOsTv] prepareTelevisionService [5/8/2021 15:38:20] [LgWebOsTv] prepareSpeakerService [5/8/2021 15:38:20] [LgWebOsTv] prepareInputsService [5/8/2021 15:38:20] [LgWebOsTv] Device: XXXXX Tele, read saved installed Apps: [] [5/8/2021 15:38:20] [LgWebOsTv] Device: XXXXX Tele, read savedInputsNames: {} [5/8/2021 15:38:20] [LgWebOsTv] Device: XXXXX Tele, read savedTargetVisibility: {} [5/8/2021 15:38:20] [LgWebOsTv] prepareInputsButtonService [5/8/2021 15:38:20] [LgWebOsTv] Device: XXXXX Tele, publishExternalAccessories. Preparing Advertiser for 'Tele XXXX' using bonjour-hap backend! Starting to advertise 'Tele XXXX' using bonjour-hap backend! [5/8/2021 15:38:20] Tele XXXX is running on port XXXXX. [5/8/2021 15:38:20] Please add [Tele XXXX] manually in Home app. Setup Code: XXXXX [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele, get current Power state successfull, state: OFF [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele, get current Input successful: [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele, get brightness successful: 0 % [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele, get closed captions successful: 0 % [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele, get current media state successful: 2 % [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele, get target media state successful: 2 % [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele 0, get current Picture mode: %s [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele, get current Mute state successful: ON [5/8/2021 15:38:21] [LgWebOsTv] Device: XXXXX Tele, get current Volume level successful: 0 [5/8/2021 15:38:25] [LgWebOsTv] Device: XXXXX Tele, connecting to TV [5/8/2021 15:38:25] [LgWebOsTv] Device: XXXXX Tele, connecting... [5/8/2021 15:38:25] [LgWebOsTv] Device: XXXXX Tele, connect error: Error: Sec-WebSocket-Accept header from server didn't match expected value of ziM5805FQP4IJwhPVjuRkstrBb4= at WebSocketClient.failHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:339:32) at WebSocketClient.validateHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:326:14) at ClientRequest.handleRequestUpgrade (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:261:14) at ClientRequest.emit (events.js:400:28) at Socket.socketOnData (_http_client.js:553:11) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:290:12) at readableAddChunk (internal/streams/readable.js:265:9) at Socket.Readable.push (internal/streams/readable.js:204:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23) [5/8/2021 15:38:25] [LgWebOsTv] Device: XXXXX Tele, waiting on confirmation... [5/8/2021 15:38:30] [LgWebOsTv] Device: XXXXX Tele, connecting to TV [5/8/2021 15:38:30] [LgWebOsTv] Device: XXXXX Tele, connecting... [5/8/2021 15:38:30] [LgWebOsTv] Device: XXXXX Tele, connect error: Error: Sec-WebSocket-Accept header from server didn't match expected value of bN9BiH1+ktxl77nO5mV9PHVewzg= at WebSocketClient.failHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:339:32) at WebSocketClient.validateHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:326:14) at ClientRequest.handleRequestUpgrade (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:261:14) at ClientRequest.emit (events.js:400:28) at Socket.socketOnData (_http_client.js:553:11) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:290:12) at readableAddChunk (internal/streams/readable.js:265:9) at Socket.Readable.push (internal/streams/readable.js:204:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23) [5/8/2021 15:38:30] [LgWebOsTv] Device: XXXXX Tele, waiting on confirmation... [5/8/2021 15:38:30] [LgWebOsTv] Device: XXXXX Tele, waiting on confirmation... [5/8/2021 15:38:32] [LgWebOsTv] Device: XXXXX Tele, connected. [5/8/2021 15:38:32] [LgWebOsTv] Device: XXXXX Tele, connecting to TV RC Socket [5/8/2021 15:38:32] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGBUS [5/8/2021 15:38:37] [HB Supervisor] Restarting Homebridge...

ArtemKiyashko commented 3 years ago

@grzegorz914

[05/08/2021, 15:52:19] [LgWebOsTv] Device: 192.168.1.56 LG TV, connecting to TV
[05/08/2021, 15:52:19] [LgWebOsTv] Device: 192.168.1.56 LG TV, connecting...
[05/08/2021, 15:52:19] [LgWebOsTv] Device: 192.168.1.56 LG TV, connect error: Error: Sec-WebSocket-Accept header from server didn't match expected value of IB10Sjb7/BMeKwogakSNMizEHAw=
    at WebSocketClient.failHandshake (/usr/local/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:339:32)
    at WebSocketClient.validateHandshake (/usr/local/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:326:14)
    at ClientRequest.handleRequestUpgrade (/usr/local/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebSocketClient.js:261:14)
    at ClientRequest.emit (events.js:400:28)
    at Socket.socketOnData (_http_client.js:553:11)
    at Socket.emit (events.js:400:28)
    at addChunk (internal/streams/readable.js:290:12)
    at readableAddChunk (internal/streams/readable.js:265:9)
    at Socket.Readable.push (internal/streams/readable.js:204:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
[05/08/2021, 15:52:19] [LgWebOsTv] Device: 192.168.1.56 LG TV, connected.
[05/08/2021, 15:52:19] [LgWebOsTv] Device: 192.168.1.56 LG TV, connecting to TV RC Socket
[05/08/2021, 15:52:19] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGBUS
[05/08/2021, 15:52:24] [HB Supervisor] Restarting Homebridge...
ArtemKiyashko commented 3 years ago

@grzegorz914 i cant see JSON parsing error like in @infvmm log, the only error i can see is

[05/08/2021, 15:52:49] [LgWebOsTv] Device: 192.168.1.56 LG TV, connect error: Error: Sec-WebSocket-Accept header from server didn't match expected value of 7qoYCKsIwn+QLrH775yCoyoTvZE=
Screen Shot 2021-08-05 at 16 05 06
grzegorz914 commented 3 years ago

are You accept permission for this plugin on TV, are You enabled LG Connect App in TV Settings

ArtemKiyashko commented 3 years ago

i dont see any request for this plugin on my TV, but Wi-Fi control from apps enabled in the settings. Do i need something else? As well i can control my TV from Lg ThinQ official app

infvmm commented 3 years ago

@grzegorz914 In my case yes for both, I have this enabled, in fact i can use the app from mobile, and HB restart in the moment I accept on TV permissions, I´ve purged all homebridge from system and started again only with this plugin, i had to assing permissions on /home/homebridge/. After that:

[5/8/2021 16:18:50] [LgWebOsTv] Initializing LgWebOsTv platform... [5/8/2021 16:18:50] [LgWebOsTv] didFinishLaunching [5/8/2021 16:18:50] [LgWebOsTv] Adding new accessory: Tele [5/8/2021 16:18:50] [LgWebOsTv] prepareAccessory [5/8/2021 16:18:50] [LgWebOsTv] prepareInformationService [5/8/2021 16:18:50] [LgWebOsTv] Device: XXX Tele, prepareInformationService error: SyntaxError: Unexpect ed end of JSON input at JSON.parse () at lgwebosTvDevice.prepareAccessory (/usr/lib/node_modules/homebridge-lgwebos-tv/index.js:506:55) [5/8/2021 16:18:50] [LgWebOsTv] prepareTelevisionService [5/8/2021 16:18:50] [LgWebOsTv] prepareSpeakerService [5/8/2021 16:18:50] [LgWebOsTv] prepareInputsService [5/8/2021 16:18:50] [LgWebOsTv] Device: XXX Tele, read saved installed Apps: [] [5/8/2021 16:18:50] [LgWebOsTv] Device: XXX Tele, read savedInputsNames: {} [5/8/2021 16:18:50] [LgWebOsTv] Device: XXX Tele, read savedTargetVisibility: {} [5/8/2021 16:18:50] [LgWebOsTv] prepareInputsButtonService [5/8/2021 16:18:50] [LgWebOsTv] Device: XXX Tele, publishExternalAccessories. Preparing Advertiser for 'Tele 1ACA' using bonjour-hap backend! Starting to advertise 'Tele 1ACA' using bonjour-hap backend! [5/8/2021 16:18:50] Tele 1ACA is running on port XXX. [5/8/2021 16:18:50] Please add [Tele 1ACA] manually in Home app. Setup Code: XXX [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele, get current Power state successfull, state: OFF [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele, get current Input successful: [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele, get brightness successful: 0 % [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele, get closed captions successful: 0 % [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele, get current media state successful: 2 % [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele, get target media state successful: 2 % [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele 0, get current Picture mode: %s [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele, get current Mute state successful: ON [5/8/2021 16:18:51] [LgWebOsTv] Device: XXX Tele, get current Volume level successful: 0 [5/8/2021 16:18:55] [LgWebOsTv] Device: XXX Tele, connecting to TV [5/8/2021 16:18:55] [LgWebOsTv] Device: XXX Tele, connecting... [5/8/2021 16:18:55] [LgWebOsTv] Device: XXX Tele, connect error: Error: Sec-WebSocket-Accept header from server didn't match expected value of fxmHBB8BBksD0kgys3NkOFmo7ak= at WebSocketClient.failHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebS ocketClient.js:339:32) at WebSocketClient.validateHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/ WebSocketClient.js:326:14) at ClientRequest.handleRequestUpgrade (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib /WebSocketClient.js:261:14) at ClientRequest.emit (events.js:400:28) at Socket.socketOnData (_http_client.js:553:11) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:290:12) at readableAddChunk (internal/streams/readable.js:265:9) at Socket.Readable.push (internal/streams/readable.js:204:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23) [5/8/2021 16:18:55] [LgWebOsTv] Device: XXX Tele, waiting on confirmation... [5/8/2021 16:19:00] [LgWebOsTv] Device: XXX Tele, connecting to TV [5/8/2021 16:19:00] [LgWebOsTv] Device: XXX Tele, connecting... [5/8/2021 16:19:00] [LgWebOsTv] Device: XXX Tele, connect error: Error: Sec-WebSocket-Accept header from server didn't match expected value of 1jAp+So5cL/MMlEW/0C4jNVwUyc= at WebSocketClient.failHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebS ocketClient.js:339:32) at WebSocketClient.validateHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/ WebSocketClient.js:326:14) at ClientRequest.handleRequestUpgrade (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib /WebSocketClient.js:261:14) at ClientRequest.emit (events.js:400:28) at Socket.socketOnData (_http_client.js:553:11) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:290:12) at readableAddChunk (internal/streams/readable.js:265:9) at Socket.Readable.push (internal/streams/readable.js:204:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23) [5/8/2021 16:19:00] [LgWebOsTv] Device: XXX Tele, waiting on confirmation... [5/8/2021 16:19:00] [LgWebOsTv] Device: XXX Tele, waiting on confirmation... [5/8/2021 16:19:00] [LgWebOsTv] Device: XXX Tele, connected. [5/8/2021 16:19:00] [LgWebOsTv] Device: XXX Tele, connecting to TV RC Socket [5/8/2021 16:19:00] [HB Supervisor] Homebridge Process Ended. Code: null, Signal: SIGBUS [5/8/2021 16:19:05] [HB Supervisor] Restarting Homebridge... [5/8/2021 16:19:05] [HB Supervisor] Starting Homebridge with extra flags: -I -D [5/8/2021 16:19:05] [HB Supervisor] Started Homebridge v1.3.4 with PID: 23703

I was reading this part and it seems it fails when tries to read the json from manufaturer info, .... here: at lgwebosTvDevice.prepareAccessory (/usr/lib/node_modules/homebridge-lgwebos-tv/index.js:506:55)

I suppose this not to be the problem :(, i don´t know how can i help more.

ArtemKiyashko commented 3 years ago

Tbh, both plugins (this and webostv) was working fine till today morning. Im 100% sure 2 days ago i was able to control my TV in HB

Moreover, i can natively add this TV to Apple Home app, but i would like to use it on a homebridge =)

grzegorz914 commented 3 years ago

Please check /var/lib/homebridge/lgwebosTv/ folder permission, here need to store all data

Zrzut ekranu 2021-08-5 o 17 02 34
ArtemKiyashko commented 3 years ago
pi@homebridge:/var/lib/homebridge $ ls -la
total 2884
drwxr-xr-x  8 homebridge homebridge    4096 Aug  5 16:47 .
drwxr-xr-x 46 root       root          4096 Jul 31 14:49 ..
drwxr-xr-x  2 homebridge homebridge    4096 Aug  5 10:45 accessories
-rw-r--r--  1 homebridge homebridge     387 Jun 28 20:26 auth.json
drwxr-xr-x  4 homebridge homebridge    4096 Jun 16 05:11 backups
-rw-r--r--  1 homebridge homebridge    3247 Aug  5 16:47 config.json
-rw-r--r--  1 homebridge homebridge    5769 Jun 17 10:53 homebridge-hue.json.gz
-rw-r--r--  1 homebridge homebridge 2878483 Aug  5 17:03 homebridge.log
drwxr-xr-x  2 homebridge homebridge    4096 Aug  5 11:40 lgwebosTv
drwxr-xr-x  2 homebridge homebridge    4096 Aug  5 12:22 persist
-rw-r--r--  1 homebridge homebridge    5605 Aug  5 12:24 .smartglass.tokens.json
-rw-r--r--  1 homebridge homebridge     845 Aug  5 12:08 .uix-dashboard.json
-rw-r--r--  1 homebridge homebridge      94 Aug  5 16:17 .uix-hb-service-homebridge-startup.json
-rw-r--r--  1 homebridge homebridge      81 Apr 27 13:00 .uix-secrets
drwxr-xr-x  2 homebridge homebridge    4096 Jun 18 00:03 .webosTv
drwxr-xr-x  2 homebridge homebridge    4096 Aug  5 09:46 xboxTv
pi@homebridge:/var/lib/homebridge $ 
pi@homebridge:/var/lib/homebridge/lgwebosTv $ ls -la
total 28
drwxr-xr-x 2 homebridge homebridge 4096 Aug  5 11:40 .
drwxr-xr-x 8 homebridge homebridge 4096 Aug  5 16:47 ..
-rw-r--r-- 1 homebridge homebridge    0 Jun 17 22:34 customInputs_192168156
-rw-r--r-- 1 homebridge homebridge  498 Jun 17 23:25 devInfo_192168156
-rw-r--r-- 1 homebridge homebridge 8160 Jun 17 23:25 inputs_192168156
-rw-r--r-- 1 homebridge homebridge  401 Aug  5 11:43 inputsNames_192168156
-rw-r--r-- 1 homebridge homebridge   32 Jun 17 23:25 key_192168156
-rw-r--r-- 1 homebridge homebridge    0 Jun 17 22:34 targetVisibilityInputs_192168156
pi@homebridge:/var/lib/homebridge/lgwebosTv $ 
ArtemKiyashko commented 3 years ago

do you need content any of this files?

infvmm commented 3 years ago

My case have permissions but all is empty:

0 -rw-r--r-- 1 homebridge homebridge 0 ago 5 16:09 devInfo_192168192 0 -rw-r--r-- 1 homebridge homebridge 0 ago 5 16:09 inputs_192168192 0 -rw-r--r-- 1 homebridge homebridge 0 ago 5 16:09 inputsNames_192168192 0 -rw-r--r-- 1 homebridge homebridge 0 ago 5 16:09 targetVisibilityInputs_192168192

grzegorz914 commented 3 years ago

all looks good, I don't know what is wrong on Your side, I have running this on 4 different TV all working correct

grzegorz914 commented 3 years ago

All are empty because HB crashes before plugin stores it’s data

ArtemKiyashko commented 3 years ago

The only change I made yesterday - added “arm_64=1” into boot.txt of my RPI. Because without that there was another problem (not related to HB) :) Not sure if it’s matter, but…

grzegorz914 commented 3 years ago

Revert this changes and try again

infvmm commented 3 years ago

Me too, but i think both of us can´t revert this, in my case generate OOM in rasp i think due to a bug.

ArtemKiyashko commented 3 years ago

@infvmm indeed!

ArtemKiyashko commented 3 years ago

I can try a little bit later, but as @infvmm mentioned we cannot remove this option forever, but just to determine the problem I will do it temporary

infvmm commented 3 years ago

What I could read: Sec-WebSocket-Accept header from server didn't match expected value --> This only happens when more than one WS connections are made in a tight loop. Unit test can reproduce this most of the time. Being a tight loop: a loop which heavily uses I/O or processing resources, failing to adequately share them with other programs running in the operating system.

It could be this change (arm_64) affect.

I was doing a tcpdump trying to check anything, what I saw: HTTP/1.1: Upgrade connection, websocket upgrade. Websocket version 13 HTTP/1.1: Switching protocols Websocket: register Websocket: response with id: 61ad..... HTTP/1.1: Upgrade connection, websocket upgrade. HTTP/1.1: Switching protocols Websocket: register Websocket: 409 register already in progress Websocket: response with id: 0f0.....

It seems it registers twice with two different ids, i think i only enabled one in the tv. Problem is it could be as HB reboot i took two different registration but i don´t think so.

Without knowledge about what it should do it´s what i can take.

infvmm commented 3 years ago

without: “arm_64=1" [5/8/2021 18:18:47] [LgWebOsTv] Device: XXX Tele, connecting to TV [5/8/2021 18:18:47] [LgWebOsTv] Device: XXX Tele, connecting... [5/8/2021 18:18:47] [LgWebOsTv] Device: XXX Tele, connect error: Error: Sec-WebSocket-Accept header from server didn't match expected value of zqcmGmGfo9mMBcY6aRZmIPn37XQ= at WebSocketClient.failHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/WebS ocketClient.js:339:32) at WebSocketClient.validateHandshake (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib/ WebSocketClient.js:326:14) at ClientRequest.handleRequestUpgrade (/usr/lib/node_modules/homebridge-lgwebos-tv/node_modules/websocket/lib /WebSocketClient.js:261:14) at ClientRequest.emit (events.js:400:28) at Socket.socketOnData (_http_client.js:553:11) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:290:12) at readableAddChunk (internal/streams/readable.js:265:9) at Socket.Readable.push (internal/streams/readable.js:204:10) at TCP.onStreamRead (internal/stream_base_commons.js:188:23) [5/8/2021 18:18:47] [LgWebOsTv] Device: XXX Tele, connected. [5/8/2021 18:18:47] [LgWebOsTv] Device: XXX Tele, connecting to TV RC Socket [5/8/2021 18:18:47] [LgWebOsTv] Device: XX Tele, RC Socket connected. [5/8/2021 18:18:52] [LgWebOsTv] Device: XX Tele, requesting Device Info. [5/8/2021 18:18:52] [LgWebOsTv] Device: XX Tele, get System info response: { returnValue: true, features: [Object], receiverType: 'dvb', modelName: '49UH850V-ZA' }

Same error but....different result.

If I enable arm_64 fails again.

ArtemKiyashko commented 3 years ago

Well… and what we can do then? :D

grzegorz914 commented 3 years ago

Not related to the plugin itself