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

Homebridge crashes - "Accessories must be created with a valid UUID" #90

Open
bsoener opened this issue Jan 17, 2022 · 103 comments
Open

Homebridge crashes - "Accessories must be created with a valid UUID" #90

bsoener opened this issue Jan 17, 2022 · 103 comments
Assignees
Labels
bug Something isn't working

Comments

@bsoener
Copy link

bsoener commented Jan 17, 2022

I have a problem this plugin. My homebridge crashes unfortunately. Anyone have an idea what this can be?

[17/01/2022, 15:47:49] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[17/01/2022, 15:47:49] [PanasonicVieraTV] Using the previously cached ones:

 {"friendlyName":"Viera ","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"WT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-20C6EBC536E5"}
[17/01/2022, 15:47:52] AssertionError [ERR_ASSERTION]: Accessories must be created with a valid UUID.
    at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:418:11)
    at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:70:9)
    at Ae.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:131:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Ae.discoverDevices (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:67:23)
    at HomebridgeAPI.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:39:7)
[17/01/2022, 15:47:52] Got SIGTERM, shutting down Homebridge...
 {
            "tvs": [
                {
                    "friendlyName": "Viera ",
                    "ipAddress": "192.168.178.115",
                    "mac": "xx:xx:xx:xx:xx:xx",
                    "hdmiInputs": [
                        {
                            "id": "1",
                            "name": "Denon"
                        },
                        {
                            "id": "2",
                            "name": "PS5"
                        }
                    ],
                    "disabledAppSupport": false,
                    "customVolumeSlider": true
                }
            ],
            "platform": "PanasonicVieraTV"
        },
@AntonioMeireles
Copy link
Owner

Hi,

thanks for reporting ...

need way more data ... a) exact plugin version, node version/arch, homebridge version ...

also, please add the output of curl -Lsk http://192.168.178.115:55000/nrc/ddd.xml.

Your TV is a bit on the older side... were working with previous versions of the plugin (if so, until which one ?) or are you trying the plugin for the first time ?

Thanks in advance!

António

@AntonioMeireles
Copy link
Owner

FWIW, this error is way, way weird...

it's complaining that your TVs S/N which we (the plugin) reuse as an UUID for Homekit/Homebridge purposes is not valid (it is!). looking into it.

@AntonioMeireles
Copy link
Owner

@bsoener

can you attach here the contents of accessories/vieramatic.json on your homebridge data dir please ?

thanks in advance!

@bsoener
Copy link
Author

bsoener commented Jan 17, 2022

So I installed this plugin a month ago and it worked great. Do not know what the reason can be.
-Node.js version v16.13.2
-Npm version v8.1.2
-Homebridge v1.3.9

How do I open this vieramatic.json?

@AntonioMeireles
Copy link
Owner

vieramatic.json is relative to the dir where it is homebridge's config.json (inside accessories subdir)

@bsoener
Copy link
Author

bsoener commented Jan 17, 2022

{"4D454930-0200-1000-8001-20C6EBC3C18D":{"data":{"inputs":{"applications":{"0":{"id":"0387878700000016","name":"VIERA Link"},"1":{"id":"0010000200000001","name":"Netflix"},"2":{"id":"0387878700000014","name":"Media Server"},"3":{"id":"0077777700000002","name":"Web Browser"},"4":{"id":"0387878700000009","name":"Haupt-Menü"},"5":{"id":"0387878700000003","name":"TV Guide"},"6":{"id":"0387878700000001","name":"TV"},"7":{"id":"0387878700000013","name":"TV-Aufnahmen"},"8":{"id":"0387878700000050","name":"Multi Window"},"9":{"id":"0387878700000049","name":"Spiegelung"},"10":{"id":"0070000200000001","name":"YouTube"},"11":{"id":"0020007100000001","name":"Meteonews TV"},"12":{"id":"0020003E00000001","name":"3doo Player for Panasonic Viera TV"},"13":{"id":"0020000600000001","name":"ARTE"},"14":{"id":"0020000300000001","name":"tagesschau"},"15":{"id":"0387878700000032","name":"Media Player"},"16":{"id":"0070001000000001","name":"PlayJam"}},"hdmi":[{"id":"1","name":"Denon"},{"id":"2","name":"PS5"}],"TUNER":{"hidden":0}},"ipAddress":"192.168.178.115","specs":{"friendlyName":"Viera ","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"WT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-20C6EBC3C18D"}}}}

AntonioMeireles added a commit that referenced this issue Jan 17, 2022
Signed-off-by: António Meireles <antonio.meireles@reformi.st>
@AntonioMeireles
Copy link
Owner

@bsoener

can you please give a try to homebridge-vieramatic@4.0.9 ? does it change anything ?

thanks in advance!

@bsoener
Copy link
Author

bsoener commented Jan 17, 2022

[17/01/2022, 16:46:21] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[17/01/2022, 16:46:21] [PanasonicVieraTV] Using the previously cached ones:

 {"friendlyName":"Viera ","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"WT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-xxxxxxxxxx"}
[17/01/2022, 16:46:25] AssertionError [ERR_ASSERTION]: Accessories must be created with a valid UUID.
    at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:418:11)
    at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:70:9)
    at Ae.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:131:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Ae.discoverDevices (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:67:23)
    at HomebridgeAPI.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:39:7)
[17/01/2022, 16:46:25] Got SIGTERM, shutting down Homebridge...

did update. still same problem..

@AntonioMeireles
Copy link
Owner

puzzled. can you please delete (or rename) the vieramatic.json file, and restart homebridge ? (but now with the TV turned ON) ?

@bsoener
Copy link
Author

bsoener commented Jan 17, 2022

vieramatic.json deleted, Tv turned on, Homebridge restarted and it works again. Thank you Perfect

@AntonioMeireles
Copy link
Owner

GREAT to hear. something odd may have happened. will close as things work for your again. will keep an eye on it anyway.

just bug me again if new issues arise.

all the best,

António

@bsoener
Copy link
Author

bsoener commented Jan 18, 2022

[18/01/2022, 16:49:33] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[18/01/2022, 16:49:33] [PanasonicVieraTV] Using the previously cached ones:

 {"friendlyName":"Viera","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"WT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-20C6EBC3C18D"}
[18/01/2022, 16:49:37] AssertionError [ERR_ASSERTION]: Accessories must be created with a valid UUID.
    at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:418:11)
    at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:70:9)
    at Ae.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:131:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Ae.discoverDevices (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:67:23)
    at HomebridgeAPI.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:39:7)
[18/01/2022, 16:49:37] Got SIGTERM, shutting down Homebridge...

Hi. Error has appeared again. Must deactivate the plugin again. What could be the reason?

@AntonioMeireles
Copy link
Owner

sad to hear that. it's strange.

do this please:

  • a) attach again existing vieramatic.json
  • b) delete it (vieramatic.json), turn TV ON, and restart homebridge then attach again the newly generated vieramatic.json. hopefully the new one will be somewhat different from the old one and may explain this...
  • c) also, could you attach full homebridge logs (since yesterday - to check if something else may be triggering this) ?

thanks in advance for your patience!

@bsoener
Copy link
Author

bsoener commented Jan 18, 2022

I will try it later. Let me know then

@bsoener
Copy link
Author

bsoener commented Jan 18, 2022

[18/01/2022, 20:22:01] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[18/01/2022, 20:22:01] [PanasonicVieraTV] Using the previously cached ones:

 {"friendlyName":"Viera","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"WT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-20C6EBC3C18D"}
[18/01/2022, 20:22:05] AssertionError [ERR_ASSERTION]: Accessories must be created with a valid UUID.
    at new Accessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:418:11)
    at new PlatformAccessory (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:70:9)
    at Ae.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:131:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Ae.discoverDevices (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:67:23)
    at HomebridgeAPI.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:39:7)
[18/01/2022, 20:22:05] Got SIGTERM, shutting down Homebridge...

@tjm7844
Copy link

tjm7844 commented Jan 18, 2022

I also have noticed this issue (I have a ZT60, so roughly same generation as @bsoener.

I've been using the plugin for at least a year with few/no issues, but noticed something a couple of days ago (maybe Saturday/Sunday, but I'm not positive): I wasn't getting the error mentioned here, and the TV would turn on using the Home App, but the tile would immediately flip to "off" (the TV would still stay on). I then couldn't turn off the TV through Home (had to use the standard IR remote).

I tried installing the 1.4.0 homebridge beta last night, and started getting this error, with homebridge crashing on loop. Played around with it for an hour or so, couldn't fix it (even after rolling back to 1.3.9 ), so went to bed. When I woke up this morning and checked again, the crashing (UUID) error had stopped.

I have since moved this plugin over to a child bridge (as I have a couple other slowish plugins anyway, so thought I might handle them all), and after restarting Homebridge, have started getting this error again. However, at least because it's on a Child Bridge, it's not crashing my entire Homebridge instance, only this plugin's process.

I went through the steps you listed above, and here were my results:

Existing/Original vieramatic.json:
{"4D454930-0200-1000-8001-8CC121609620":{"data":{"inputs":{"hdmi":[{"id":"2","name":"Receiver","hidden":0}],"applications":{"0":{"name":"Media player","id":"0387878700000032","hidden":1},"1":{"name":"DLNA server","id":"0387878700000014","hidden":1},"2":{"name":"VIERA Link","id":"0387878700000016","hidden":1},"3":{"name":"TV","id":"0387878700000001","hidden":1},"4":{"name":"Menu","id":"0387878700000009","hidden":1},"5":{"name":"Web Browser","id":"0077777700000002","hidden":1},"6":{"name":"Paint","id":"0387878700000026","hidden":1},"7":{"name":"Put Three","id":"0387878700000036","hidden":1},"8":{"name":"Family Reversi","id":"0387878700000037","hidden":1},"9":{"name":"Touch Connect","id":"0387878700000038","hidden":1},"10":{"name":"Mirroring","id":"0387878700000049","hidden":1},"11":{"name":"Netflix","id":"0010000200000001","hidden":0},"12":{"name":"YouTube","id":"0070000200000001","hidden":1},"13":{"name":"HSN Shop by Remote","id":"0010002000000001","hidden":1},"14":{"name":"CinemaNow","id":"0010000300000001","hidden":1},"15":{"name":"PlayJam","id":"0070001000000001","hidden":1},"16":{"name":"Xumo","id":"0310005700000001","hidden":1},"17":{"name":"VUDU HD Movies","id":"0010001300000001","hidden":1},"18":{"name":"Jotter","id":"0387878700000022","hidden":1},"19":{"name":"Classical Archives Player","id":"0070001700000001","hidden":1}},"TUNER":{"hidden":0}},"specs":{"friendlyName":"Living Room Panasonic","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"ZT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-8CC121609620"},"ipAddress":"192.168.1.155"}}}

-rm vieramatic.json

Had a couple of hiccups getting the bridge/device paired correctly, but confirming everything was paired correctly, here's the new vieramatic/json:
{"4D454930-0200-1000-8001-8CC121609620":{"data":{"inputs":{"applications":{"0":{"id":"0387878700000032","name":"Media player"},"1":{"id":"0387878700000014","name":"DLNA server"},"2":{"id":"0387878700000016","name":"VIERA Link"},"3":{"id":"0387878700000001","name":"TV"},"4":{"id":"0387878700000009","name":"Menu"},"5":{"id":"0077777700000002","name":"Web Browser"},"6":{"id":"0387878700000026","name":"Paint"},"7":{"id":"0387878700000036","name":"Put Three"},"8":{"id":"0387878700000037","name":"Family Reversi"},"9":{"id":"0387878700000038","name":"Touch Connect"},"10":{"id":"0387878700000049","name":"Mirroring"},"11":{"id":"0010000200000001","name":"Netflix"},"12":{"id":"0070000200000001","name":"YouTube"},"13":{"id":"0010002000000001","name":"HSN Shop by Remote"},"14":{"id":"0010000300000001","name":"CinemaNow"},"15":{"id":"0070001000000001","name":"PlayJam"},"16":{"id":"0310005700000001","name":"Xumo"},"17":{"id":"0010001300000001","name":"VUDU HD Movies"},"18":{"id":"0387878700000022","name":"Jotter"},"19":{"id":"0070001700000001","name":"Classical Archives Player"}},"hdmi":[{"id":"2","name":"Receiver"}],"TUNER":{"hidden":0}},"ipAddress":"192.168.1.155","specs":{"friendlyName":"Living Room Panasonic","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"ZT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-8CC121609620"}}}}

Would seem everything started up correctly:

[1/18/2022, 1:04:19 PM] [homebridge-vieramatic] Loaded homebridge-vieramatic v4.0.9 child bridge successfully
[1/18/2022, 1:04:19 PM] Loaded 0 cached accessories from cachedAccessories. [MACOfChildbridge].
[1/18/2022, 1:04:19 PM] [homebridge-vieramatic] handling '192.168.1.155' from config.json
[1/18/2022, 1:04:19 PM] Homebridge v1.3.9 (HAP v0.9.8) (homebridge-vieramatic) is running on port [PORTISHERE].
[1/18/2022, 1:04:19 PM] [homebridge-vieramatic] found a 'Panasonic VIErA' TV (ZT60) at '192.168.1.155' .
[1/18/2022, 1:04:19 PM] [homebridge-vieramatic] Initializing 'Living Room Panasonic' first time ever.
[1/18/2022, 1:04:19 PM] [homebridge-vieramatic] successfully loaded Living Room Panasonic

I still can't control the set (other than turning it on), and homebridge-UI won't let me edit the config directly, but at least for now, there are no more UUID crashes.

Screen Shot 2022-01-18 at 1 19 36 PM

Maybe you can find something useful here? More data never hurts, right? 🤷‍♂️

@AntonioMeireles
Copy link
Owner

@tjm7844 many many thanks...

a) do you also have friendlyName set in your homebridge's config.json ? (could you paste the config anyway plz)
b) platform plugins in general afaik won't work in bridgeed setups (homebridge design issue if i recall correctly)

looking into this. (and trying to spot a way to reproduce)

Thanks all gain for your patience!

@AntonioMeireles AntonioMeireles changed the title Homebridge crashes Homebridge crashes - "Accessories must be created with a valid UUID" Jan 18, 2022
AntonioMeireles added a commit that referenced this issue Jan 18, 2022
- and make things a bit more verbose in order to isolate root cause

Signed-off-by: António Meireles <antonio.meireles@reformi.st>
@AntonioMeireles
Copy link
Owner

@bsoener @tjm7844

could you also both give a try to homebridge-vieramatic@4.0.10. it should NOT crash whole homebridge anymore and also give us (hopefully) a bit more precise error message... (attach it please)

thanks in advance!

@bsoener
Copy link
Author

bsoener commented Jan 18, 2022

latest update done and no error message. will wait until tomorrow and report back

@tjm7844
Copy link

tjm7844 commented Jan 19, 2022

I do have a friendly name. I removed the child bridge, and updated the plugin to 4.0.10.

Here's the config:

    "tvs": [
        {
            "friendlyName": "Living Room Panasonic",
            "ipAddress": "192.168.1.155",
            "mac": "8C:C1:21:60:96:20",
            "hdmiInputs": [
                {
                    "id": "2",
                    "name": "Receiver"
                }
            ],
            "disabledAppSupport": false,
            "customVolumeSlider": true
        }
    ],
    "platform": "PanasonicVieraTV"
}

After doing the above, I restarted homebridge again, and saw this on startup:

[1/18/2022, 11:32:58 PM] [PanasonicVieraTV] device: {"friendlyName":"Living Room Panasonic","ipAddress":"192.168.1.155","mac":"8C:C1:21:60:96:20","hdmiInputs":[{"id":"2","name":"Receiver"}],"disabledAppSupport":false,"customVolumeSlider":true}
[1/18/2022, 11:32:58 PM] [PanasonicVieraTV] specs: {"friendlyName":"Living Room Panasonic"}
[1/18/2022, 11:32:58 PM] [PanasonicVieraTV] Accessories must be created with a valid UUID.

It's not crashing the whole homebridge instance, but it won't let me re-pair the device. Will let it run and see if there's any different in the morning.

@AntonioMeireles
Copy link
Owner

@tjm7844

can you post full logs plz (from homebridge early initialization ...) also, can you confirm that issue only happens if you restart homebridge with the TV in standby ?

thanks!

@AntonioMeireles
Copy link
Owner

@tjm7844, @bsoener

i've pushed a new release homebridge-vieramatic@4.0.11 (tagged as beta) so you need to npm i homebridge-vieramatic@4.0.11 to consume it. it should give us a bit more robust behaviour/detailed info. Unsure if enough to fix whole thing.

please attach here the newly generated boot logs...

and thanks once again for all your patience!

AntonioMeireles added a commit that referenced this issue Jan 19, 2022
Signed-off-by: António Meireles <antonio.meireles@reformi.st>
@bsoener
Copy link
Author

bsoener commented Jan 19, 2022

latest beta installed. The following error message from the log

[19/01/2022, 20:40:03] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[19/01/2022, 20:40:03] [PanasonicVieraTV] Using the previously cached ones:

 {"friendlyName":"Viera","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"WT60","requiresEncryption":false,"serialNumber":"4D454930-0200-1000-8001-20C6EBC3C18D"}

[19/01/2022, 20:40:07] [PanasonicVieraTV] device: {"friendlyName":"Viera ","ipAddress":"192.168.178.115","mac":"xx:xx:xx:xx:xx:xx","hdmiInputs":[{"id":"1","name":"Denon"},{"id":"2","name":"PS5"}],"disabledAppSupport":false,"customVolumeSlider":true}
[19/01/2022, 20:40:07] [PanasonicVieraTV] specs: {"friendlyName":"Viera"}
[19/01/2022, 20:40:07] [PanasonicVieraTV] Accessories must be created with a valid UUID.

@AntonioMeireles
Copy link
Owner

@bsoener

THANKS!. your data is in line with @tjm7844 previous one. that's the good news. the bad news is that i'm missing the obvious as it shouldn't just happen. FWIW the root issue is in [19/01/2022, 20:40:07] [PanasonicVieraTV] specs: {"friendlyName":"Viera"}. specsis not there and should. digging - this is some logic mistake i made somewhere.

will get back to all of you soonish.

(and thanks yet again for all your patience!)

@AntonioMeireles
Copy link
Owner

AntonioMeireles commented Jan 21, 2022

humm, depending on your setup you may need to run npm i homebridge-vieramatic@version -g to install globally.

@tjm7844
Copy link

tjm7844 commented Jan 21, 2022

Could be that. I'm running on a debian VM running on an ESXI host, but have done everything standard per the docs. I'll give that a try after I flush out the old data and reinstall.

@AntonioMeireles
Copy link
Owner

AntonioMeireles commented Jan 21, 2022

Could be that. I'm running on a debian VM running on an ESXI host, but have done everything standard per the docs. I'll give that a try after I flush out the old data and reinstall.

@tjm7844,
please do make sure that you do not have any firewall between your homebridge VM and your TVs blocking (UDP) port 9 (as otherwise the WOL magic packets won't ever hit the TV)

@tjm7844
Copy link

tjm7844 commented Jan 21, 2022

I'll verify, but I don't expect that's an issue as WOL had never been my problem. Off was my issue :)

@bsoener
Copy link
Author

bsoener commented Jan 21, 2022

On the homeapp I press the on button and on the log from the homebridge only this log appears. After a short time this on button on the homeapp jumps back to off.

[21/01/2022, 20:17:06] [PanasonicVieraTV] (setPowerStatus) 1 false
[21/01/2022, 20:17:06] [PanasonicVieraTV] sending WOL packets to awake TV
[21/01/2022, 20:17:08] [PanasonicVieraTV] Turned TV ON

Restart log I get this:

[21/01/2022, 20:20:25] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[21/01/2022, 20:20:25] [PanasonicVieraTV] Using the previously cached ones:

 {
  "friendlyName": "Viera",
  "manufacturer": "Panasonic",
  "modelName": "Panasonic VIErA",
  "modelNumber": "WT60",
  "requiresEncryption": false,
  "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
}
[21/01/2022, 20:20:25] [PanasonicVieraTV] userConfig {
  "friendlyName": "Viera ",
  "ipAddress": "192.168.178.115",
  "mac": "xx:xx:xx:xx:xx:xx",
  "hdmiInputs": [
    {
      "id": "1",
      "name": "Denon"
    },
    {
      "id": "2",
      "name": "PS5"
    }
  ],
  "disabledAppSupport": false,
  "customVolumeSlider": true
}
[21/01/2022, 20:20:25] [PanasonicVieraTV] accessory.context.device {
  "address": "192.168.178.115",
  "apps": {
    "error": {
      "code": "EHOSTUNREACH",
      "timings": {
        "start": 1642792825122,
        "socket": 1642792825124,
        "error": 1642792825201,
        "phases": {
          "wait": 2,
          "total": 79
        }
      },
      "name": "RequestError",
      "options": {
        "agent": {},
        "decompress": true,
        "timeout": {
          "request": 1500
        },
        "prefixUrl": "",
        "body": "<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:X_GetAppList xmlns:u=\"urn:panasonic-com:service:p00NetworkControl:1\">None</u:X_GetAppList></s:Body></s:Envelope>",
        "ignoreInvalidCookies": false,
        "context": {},
        "hooks": {
          "init": [],
          "beforeRequest": [],
          "beforeError": [],
          "beforeRedirect": [],
          "beforeRetry": [],
          "afterResponse": []
        },
        "followRedirect": true,
        "maxRedirects": 10,
        "throwHttpErrors": true,
        "username": "",
        "password": "",
        "http2": false,
        "allowGetBody": false,
        "headers": {
          "user-agent": "got (https://github.com/sindresorhus/got)",
          "accept": "application/xml",
          "cache-control": "no-cache",
          "content-type": "application/xml; charset=\"utf-8\"",
          "host": "192.168.178.115:55000",
          "pragma": "no-cache",
          "soapaction": "\"urn:panasonic-com:service:p00NetworkControl:1#X_GetAppList\"",
          "content-length": "285",
          "accept-encoding": "gzip, deflate, br"
        },
        "methodRewriting": false,
        "retry": {
          "limit": 0,
          "methods": [
            "GET",
            "PUT",
            "HEAD",
            "DELETE",
            "OPTIONS",
            "TRACE"
          ],
          "statusCodes": [
            408,
            413,
            429,
            500,
            502,
            503,
            504,
            521,
            522,
            524
          ],
          "errorCodes": [
            "ETIMEDOUT",
            "ECONNRESET",
            "EADDRINUSE",
            "ECONNREFUSED",
            "EPIPE",
            "ENOTFOUND",
            "ENETUNREACH",
            "EAI_AGAIN"
          ],
          "backoffLimit": null,
          "noise": 100
        },
        "method": "POST",
        "cacheOptions": {},
        "https": {},
        "resolveBodyOnly": false,
        "isStream": false,
        "responseType": "text",
        "url": "http://192.168.178.115:55000/nrc/control_0",
        "pagination": {
          "countLimit": null,
          "backoff": 0,
          "requestLimit": 10000,
          "stackAllItems": false
        },
        "setHost": true
      }
    }
  },
  "auth": {},
  "specs": {
    "friendlyName": "Viera",
    "manufacturer": "Panasonic",
    "modelName": "Panasonic VIErA",
    "modelNumber": "WT60",
    "requiresEncryption": false,
    "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
  }
}
[21/01/2022, 20:20:25] [PanasonicVieraTV] Using previously cached App listing.
[21/01/2022, 20:20:25] [PanasonicVieraTV] successfully loaded Viera
[21/01/2022, 20:20:25] Viera ED82 is running on port 38483.
[21/01/2022, 20:20:25] Please add [Viera ED82] manually in Home app. Setup Code: xxx-xx-xxx

@AntonioMeireles
Copy link
Owner

@bsoener

OK, issue at macro level is ...

  • we send 10 WOL magic packets to the TV (that takes 1 sec (10 magic pkts sent with 100ms interval)
  • then we wait an extra sec and then we try to "talk" with the TV. (and update Homebridge status assuming TV is already waked up)

so basically we're expecting that the between receiving the magic packets and becoming responsive (at API level) the TV won't take longer than 2seconds. which according to you isn't being the case.

At the same time, each 5secs we refresh TVs state (so even if it takes longer than 2 secs for TV to become responsive) at next refresh we'd expect it would be detected as up...

This is why we need a more spedite way of debugging this :-) (just email me ;-) )

@tjm7844
Copy link

tjm7844 commented Jan 21, 2022

@AntonioMeireles, thank you. The global flag was what was necessary to get the beta version installed for me. It's now showing correctly in the UI. Also, purging the plugin entirely, making sure all the various caches were removed, etc, allowed me to find and re-pair the set to homebridge.

It appears that I'm seeing similar logs to @bsoener on restart/attempting to WOL. I'm happy to email them if you'd like to see them.

Also, if it's helpful, I just did a (very unscientific) test of my TV's startup time using my phone's stopwatch, and it appears to be roughly 6.5-7 seconds (6.63, 6.51 in my two tests).

@AntonioMeireles
Copy link
Owner

@tjm7844

7secs ! ouch. even so, after those 7secs TV should then appear as ON to homekit ... can you mail me ... i just need some spedited way to debug this ...

@bsoener
Copy link
Author

bsoener commented Jan 22, 2022

What exactly do you need from me? Where is your email address?

@AntonioMeireles
Copy link
Owner

What exactly do you need from me? Where is your email address?

@bsoener

Hi, morning!

a priori i already have all info i need. I did a live debug session on @tjm7844 's TV set last night. but THANKS!...

I'll push soonish a new version with more polish and more fixed issues.

AntonioMeireles added a commit that referenced this issue Jan 22, 2022
- while digging #90 and with the awesome help from @tjm7844 who provided
  live access to an affected set it was found that on some older sets
  the TV was returning X_ScreenState with a state ('none') when online
  not yet accounted by the plugin. this is now fixed and those TVs are
  now propperly recognized as ON when they actually are on.

Signed-off-by: António Meireles <antonio.meireles@reformi.st>
AntonioMeireles added a commit that referenced this issue Jan 22, 2022
- HACK: TO BE FIXED properly as soon as core issue fully understood

  on macOs we get Error: send EADDRNOTAVAIL 255.255.255.255:9
  when sending the magic packets.

  targeting TV's address fixes that and WOL then works...

  OTOH this is not a general purpose solution as elsewhere we actually
  need to target 255.255.255.255 for WOL to work.

  issue spoted while chasing #90

- en passant src/upnpsub.ts renamed to src/networkUtils.ts

Signed-off-by: António Meireles <antonio.meireles@reformi.st>
AntonioMeireles added a commit that referenced this issue Jan 22, 2022
Signed-off-by: António Meireles <antonio.meireles@reformi.st>
@AntonioMeireles
Copy link
Owner

@bsoener, @tjm7844

please update and give a try to just released homebridge-vieramatic@4.0.17 (tagged again as beta and consumable by npm i homebridge-vieramatic@4.0.17 -g followed by an homebridge restart) and report back on its overall behaviour.

it should fix the issue of TV being ON but not being recognized as that (after being awaken) by the plugin (just found last night that older TVs advertise their availability in a slightly different way than recent ones).
It should also workaround a strange issue we've found regarding WOL behaviour (which doesn't seem exactly the same in all platforms (!)).

A great weekend for you all, and many thanks for your patience!

Thanks in advance!

António

@bsoener
Copy link
Author

bsoener commented Jan 22, 2022

Latest version installed. Unfortunately, my TV does not wake up. on the Hombridge log comes unfortunately no message.


[22/01/2022, 14:46:01] [PanasonicVieraTV] Unable to fetch specs from TV at '192.168.178.115'.
[22/01/2022, 14:46:01] [PanasonicVieraTV] Using the previously cached ones:

 {
  "friendlyName": "Viera",
  "manufacturer": "Panasonic",
  "modelName": "Panasonic VIErA",
  "modelNumber": "WT60",
  "requiresEncryption": false,
  "serialNumber": "4D454930-0200-1000-8001-20C6EBC3C18D"
}
[22/01/2022, 14:46:01] [PanasonicVieraTV] Using previously cached App listing.
[22/01/2022, 14:46:01] [PanasonicVieraTV] successfully loaded Viera
[22/01/2022, 14:46:01] Viera ED82 is running on port 36021.

@AntonioMeireles
Copy link
Owner

@bsoener

sorry to hear that. let's wait a bit for @tjm7844 feedback. if i hadn't make any aditional mistake (and his TV behaves) that means your TV is from yet another generation with slight different behaviout we'd need to accomodate ...

@tjm7844
Copy link

tjm7844 commented Jan 22, 2022

Sorry for the delay! TV has been in use this morning and just had a chance to test :) Everything still appears to be working fine for me after the update to 4.0.17. @AntonioMeireles, I never did unlink from your live code changes, but the update did appear to process and shows the new version.

Just want to confirm that I am set up correctly so my feedback is representative.

Also, there is some new behavior that we found while testing this version, wherein the TV will turn on, then the HomeKit tile flips to off, and then corrects itself back to on. Just so anyone who is reading this is aware.

@AntonioMeireles
Copy link
Owner

@tjm7844

quick question - is you TV connect to the network via wired or wirelessly ?

@tjm7844
Copy link

tjm7844 commented Jan 22, 2022

Wired - this generation of sets doesn't support WOL from a wireless connection.

@AntonioMeireles
Copy link
Owner

@bsoener

and yours ? wired or wirelessly ?

@bsoener
Copy link
Author

bsoener commented Jan 22, 2022

currently via wifi

@bsoener
Copy link
Author

bsoener commented Jan 22, 2022

I will try later via lan. then give feedback

@AntonioMeireles
Copy link
Owner

@bsoener

do plz... will publish soon an hack that may make it behave both ways (crossing fingers)

@bsoener
Copy link
Author

bsoener commented Jan 22, 2022

connected via lan and sorry does not go on and off

@AntonioMeireles
Copy link
Owner

@tjm7844

please report on just pushed homebridge-vieramatic@4.0.18. i now use an handmade WOL function. if i did it right it things should continue working for wired TV sets (i.e. they should still be wakable as in 4.0.17). OTOH sets connected wirelessly should also wake up now (if all will do, or only recent ones dunno yet).

@AntonioMeireles
Copy link
Owner

@bsoener

so, you may have a TV of yet another generation that behaves sligtly differently too ...

on you homebridge box do ...

  • git clone https://github.com/AntonioMeireles/homebridge-vieramatic.git
  • (cd homebridge-vieramatic && git log | grep -ia signed | head -n 1)

this last command will get you my email address. just email me and i'll reply back to you quickly :-)

AntonioMeireles added a commit that referenced this issue Jan 22, 2022
Signed-off-by: António Meireles <antonio.meireles@reformi.st>
@tjm7844
Copy link

tjm7844 commented Jan 22, 2022

On/off still working for me on 4.0.18.

AntonioMeireles added a commit that referenced this issue Jan 22, 2022
- also, revert 8903d31

Signed-off-by: António Meireles <antonio.meireles@reformi.st>
@AntonioMeireles
Copy link
Owner

@tjm7844

just published homebridge-vieramatic@4.0.20 (as non beta) per @tjm7844 feedback.

debugging of @bsoener issues (which seem to be separate ones) will continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants