Closed jerrodh closed 3 years ago
@jerrodh
sorry lag replying.
At sight, your TV is one of the older models that still requires WoL (wake on lan) to resume. This is already the aim of #30. Sadly, i've been progressing on this front very slowly, due to two orders of reasons - first, the sad times we 're on which end being too time consuming and routine changing :( and second, because i do not have a suitable TV to test and the changes i 'll need to make (that mess with the plugin current workflow) are potentially messy to the plugin's overall stability/sanity. There's also the non trivial issue that the API we consume of the models we currently support is a superset of an older one (and it's not always clear what exactly changed and in which model year). With all this stated, i hope to have something sane and testable for you and @jvic1234 (from #30) soonish.
All the best, and thanks for your patience!
António
@jerrodh
could you plz give a try to homebridge-vieramatic=2.0.11-beta.2 and report back? (needs to be installed manually - npm install homebridge-vieramatic=2.0.11-beta.2 as plain update won't do since i've tagged it as beta.)
Thanks in advance!
I have installed the update. With the same settings above, the logs seem to indicate that it found an ST60 TV (please add...) etc. but then subsequent failures cause homebridge to boot-loop and I had to disable the plugin in config.json to get it to proceed.
What does 2.0.11-b2 allege to fix? Are you implementing WoL, or simply changing when/whether the app scan happens?
Let me gather the relevant error portions of the log, and I'll post those shortly.
[[...other plugins' lines removed for clarity...]]
found a 'Panasonic VIErA' TV (ST60) at '192.168.1.33' .
[11/16/2020, 7:01:32 PM] [PanasonicVieraTV] successfully loaded VIERA ST60
[11/16/2020, 7:01:32 PM] VIERA ST60 DC2A is running on port 35751.
[11/16/2020, 7:01:32 PM] Please add [VIERA ST60 DC2A] manually in Home app. Setup Code: 598-44-365
[[...other plugins' lines removed for clarity...]]
[11/16/2020, 7:01:38 PM] TypeError: Cannot read property 'X_ScreenState' of undefined
at Subscription.<anonymous> (/usr/lib/node_modules/homebridge-vieramatic/src/viera.ts:163:37)
at Object.onceWrapper (events.js:422:26)
at Subscription.emit (events.js:315:20)
at /usr/lib/node_modules/homebridge-vieramatic/node_modules/node-upnp-subscription/index.js:37:37
at Parser.<anonymous> (/usr/lib/node_modules/homebridge-vieramatic/node_modules/xml2js/lib/parser.js:304:18)
at Parser.emit (events.js:315:20)
at SAXParser.onclosetag (/usr/lib/node_modules/homebridge-vieramatic/node_modules/xml2js/lib/parser.js:262:26)
at emit (/usr/lib/node_modules/homebridge-vieramatic/node_modules/sax/lib/sax.js:624:35)
at emitNode (/usr/lib/node_modules/homebridge-vieramatic/node_modules/sax/lib/sax.js:629:5)
at closeTag (/usr/lib/node_modules/homebridge-vieramatic/node_modules/sax/lib/sax.js:889:7)
at SAXParser.write (/usr/lib/node_modules/homebridge-vieramatic/node_modules/sax/lib/sax.js:1436:13)
at Parser.exports.Parser.Parser.parseString (/usr/lib/node_modules/homebridge-vieramatic/node_modules/xml2js/lib/parser.js:323:31)
at Parser.parseString (/usr/lib/node_modules/homebridge-vieramatic/node_modules/xml2js/lib/parser.js:5:59)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-vieramatic/node_modules/parsexmlresponse/index.js:15:23)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
[11/16/2020, 7:01:38 PM] Got SIGTERM, shutting down Homebridge...
Note also, when the TV was off during my first homebridge reboot after the upgrade, it failed gracefully -- something like "Please make sure the TV is ON and available on the network".
@jerrodh
latest mods context is #43 which happens to be a pre condition for WoL changes.
a quick question - crash above is with the TV on or off ? i.e. happens ALL the time or only when TV is OFF ?
thanks for your patience!
This crash (and associated homebridge boot-loop) only occurred when the TV is ON. When the TV is OFF, the plugin initialization failed gracefully -- "Please make sure the TV is ON and available on the network"
Thus, FYI, I haven't been able to add the TV accessory to HomeKit - I'll need to clear this error to allow Homebridge to load successfully before I can do that.
can you past here plz the output of curl -vvvL https://TV_IP_ADDRESS:55000/nrc/sdd_0.xml
when the TV is ON ?
curl -vvvL https://192.168.1.33:55000/nrc/sdd_0.xml
* Trying 192.168.1.33...
* TCP_NODELAY set
* Connected to 192.168.1.33 (192.168.1.33) port 55000 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
That's from the device (RPi 3B+) running Homebridge.
sorry. my fault. command had a typo. curl -vvvL http://TV_IP_ADDRESS:55000/nrc/sdd_0.xml
(it is http not https)
Without using https://, but rather http://, I get the following XML:
* Trying 192.168.1.33...
* TCP_NODELAY set
* Connected to 192.168.1.33 (192.168.1.33) port 55000 (#0)
> GET /nrc/sdd_0.xml HTTP/1.1
> Host: 192.168.1.33:55000
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 200 OK
< CONTENT-LENGTH: 6635
< Content-Type: text/xml; charset="utf-8"
< SERVER: Panasonic-VIErA/1, UPnP/1.0, Panasonic MIL DLNA SERVER
< CONNECTION: close
<
<?xml version="1.0"?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
<specVersion><major>1</major><minor>0</minor></specVersion>
<actionList>
<action>
<name>X_SendKey</name>
<argumentList>
<argument>
<name>X_KeyEvent</name>
<direction>in</direction>
<relatedStateVariable>X_KeyEvent</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_SendString</name>
<argumentList>
<argument>
<name>X_String</name>
<direction>in</direction>
<relatedStateVariable>X_String</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_GetInputMode</name>
<argumentList>
<argument>
<name>X_InputMode</name>
<direction>out</direction>
<relatedStateVariable>X_InputMode</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_GetKeyboardType</name>
<argumentList>
<argument>
<name>X_KeyboardType</name>
<direction>out</direction>
<relatedStateVariable>X_KeyboardType</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_GetVectorInfo</name>
<argumentList>
<argument>
<name>X_PortNumber</name>
<direction>out</direction>
<relatedStateVariable>X_PortNumber</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_GetGamepadInfo</name>
<argumentList>
<argument>
<name>X_PortNumber</name>
<direction>out</direction>
<relatedStateVariable>X_PortNumber</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_GetAppInfo</name>
<argumentList>
<argument>
<name>X_InfoType</name>
<direction>in</direction>
<relatedStateVariable>X_InfoType</relatedStateVariable>
</argument>
<argument>
<name>X_AppInfo</name>
<direction>out</direction>
<relatedStateVariable>X_AppInfo</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_LaunchApp</name>
<argumentList>
<argument>
<name>X_AppType</name>
<direction>in</direction>
<relatedStateVariable>X_AppType</relatedStateVariable>
</argument>
<argument>
<name>X_LaunchKeyword</name>
<direction>in</direction>
<relatedStateVariable>X_LaunchKeyword</relatedStateVariable>
</argument>
<argument>
<name>X_SessionId</name>
<direction>out</direction>
<relatedStateVariable>X_SessionId</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_ConnectApp</name>
<argumentList>
<argument>
<name>X_AppType</name>
<direction>in</direction>
<relatedStateVariable>X_AppType</relatedStateVariable>
</argument>
<argument>
<name>X_SessionId</name>
<direction>in</direction>
<relatedStateVariable>X_SessionId</relatedStateVariable>
</argument>
<argument>
<name>X_ConnectKeyword</name>
<direction>in</direction>
<relatedStateVariable>X_ConnectKeyword</relatedStateVariable>
</argument>
<argument>
<name>X_ConnectAddr</name>
<direction>in</direction>
<relatedStateVariable>X_ConnectAddr</relatedStateVariable>
</argument>
<argument>
<name>X_Message</name>
<direction>out</direction>
<relatedStateVariable>X_Message</relatedStateVariable>
</argument>
</argumentList>
</action>
<action>
<name>X_QueryApp</name>
<argumentList>
<argument>
<name>X_AppType</name>
<direction>in</direction>
<relatedStateVariable>X_AppType</relatedStateVariable>
</argument>
<argument>
<name>X_SessionId</name>
<direction>in</direction>
<relatedStateVariable>X_SessionId</relatedStateVariable>
</argument>
<argument>
<name>X_QueryKeyword</name>
<direction>in</direction>
<relatedStateVariable>X_QueryKeyword</relatedStateVariable>
</argument>
<argument>
<name>X_Message</name>
<direction>out</direction>
<relatedStateVariable>X_Message</relatedStateVariable>
</argument>
</argumentList>
</action>
</actionList>
<serviceStateTable>
<stateVariable sendEvents="no">
<name>X_KeyEvent</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_String</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="yes">
<name>X_InputMode</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="yes">
<name>X_KeyboardType</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_PortNumber</name>
<dataType>ui2</dataType>
</stateVariable>
<stateVariable sendEvents="yes">
<name>X_ScreenState</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_InfoType</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="yes">
<name>X_AppInfo</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_AppType</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_LaunchKeyword</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_SessionId</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_ConnectKeyword</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_ConnectAddr</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_Message</name>
<dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
<name>X_QueryKeyword</name>
<dataType>string</dataType>
</stateVariable>
</serviceStateTable>
* Curl_http_done: called premature == 0
* Closing connection 0
ok. thnxs! need to be dig a bit more now :-)
@jerrodh
can you confirm that homebridge-vieramatic=2.0.11-beta.3
that i just published does not crash anymore, nor other unintended side effects ? (won't go much further yet on your TV - but crash should be gone hopefully already :-) )
thanks again for your patience, and have a great weekend!
Indeed, with beta 3:
TV OFF: Homebridge launches and ignores the TV that it cannot reach. No crash.
TV ON: Homebridge launches, the plugin indicates the TV was found and indicates that it has added my HDMI inputs in the config -- Homebridge does not crash. It does not, however, appear to expose the TV to be added in the Home app. Should it have?
No other side effects I can see at this point.
Thanks for your efforts.
@jerrodh
Humm... tricky. i'm on UTC (Porto, Portugal), but we'll see what we can do.
some questions,
a) your set (P50ST60) with latest beta should had the plugin to generate an accessories/vieramatic.json
file (path is relative to where homebridge's config.json
is located). Please paste its contents here ?
b) when off (standby) your TV stays pingable ? (or curl -iL TV_IP_ADDRESS:55000/
returns anything vs timouting)
c) if unreachable above i suppose your TV is one of those who wake with Wake On Lan - it is ?
d) is your TV set still manageable by TV Panasonic's own "Panasonic TV Remote TV 3" mobile app (IOS install link and Android install link)?
if it is would be too much to ask for some wireshark traces from your phone talking to the TV ? (power on/power off, volume up/down, switching hdmi inputs) ?
thanks again for your patience, and have a great weekend!
(a) Here:
{
"4D454930-0200-1000-8001-8CC1216EF9CB":{
"data":{
"inputs":{
"hdmi":[
{
"id":"2",
"name":"Apple TV",
"hidden":0
},
{
"id":"3",
"name":"Xbox One",
"hidden":0
},
{
"id":"3",
"name":"XBOX ONE",
"hidden":0
}
],
"applications":{
"0":{
"name":"Web Browser",
"id":"0077777700000002",
"hidden":1
},
"1":{
"name":"YouTube",
"id":"0070000200000001",
"hidden":1
},
"2":{
"name":"Netflix",
"id":"0010000200000001",
"hidden":1
},
"3":{
"name":"Xumo",
"id":"0310005700000001",
"hidden":1
},
"4":{
"name":"Media player",
"id":"0387878700000032",
"hidden":1
},
"5":{
"name":"DLNA server",
"id":"0387878700000014",
"hidden":1
},
"6":{
"name":"VIERA Link",
"id":"0387878700000016",
"hidden":1
},
"7":{
"name":"TV",
"id":"0387878700000001",
"hidden":1
},
"8":{
"name":"Menu",
"id":"0387878700000009",
"hidden":1
},
"9":{
"name":"Paint",
"id":"0387878700000026",
"hidden":1
},
"10":{
"name":"Put Three",
"id":"0387878700000036",
"hidden":1
},
"11":{
"name":"Family Reversi",
"id":"0387878700000037",
"hidden":1
},
"12":{
"name":"Touch Connect",
"id":"0387878700000038",
"hidden":1
},
"13":{
"name":"Jotter",
"id":"0387878700000022",
"hidden":1
}
},
"TUNER":{
"hidden":0
}
},
"specs":{
"friendlyName":"VIERA ST60",
"modelName":"Panasonic VIErA",
"modelNumber":"ST60",
"manufacturer":"Panasonic",
"serialNumber":"4D454930-0200-1000-8001-8CC1216EF9CB",
"requiresEncryption":false
}
}
}
}
(b) TV does not ping when off. (c) Unfortunately I'm not even convinced it will do WoL, at least over the wireless interface. I vaguely recall one of the authors of an older plugin stating that this model wouldn't do it? Is there a command-line test I can run to send a 'magic packet'? (d) That app works for control, but again - only locates the TV when it is on. When it turns the TV off, the power button disappears on the remote, as if to indicate there's no way to turn it back on over the network. Not promising for WoL... (e) Perhaps. I'll give it a try later today.
Hi again!
re: d) test plz with "Panasonic TV Remote TV 2" (also available in app store)
and replace plz node_modules/homebridge-vieramatic/dist/viera.js
with the full contents from this gist, and restart homebridge (all with TV on). confirm that you are now able to control TV (volume) and change outputs ;-) [if i'm getting it right you 'll get full feature set (including TV off) other than being unable to turn it on - taht would be next step ;-) ]
humm ... on your TV on Menu -> Network -> Viera Remote Settings do you have Viera Remote ON ? per manual
(c) Unfortunately I'm not even convinced it will do WoL, at least over the wireless interface
yes... Pana models circa 2013 appear to shutdown the wifi interface to save power when on standby... so, if you have a chance to try with a wired interface ...OTOH Re: Wake On Lan not clear that you model has it as only higher models from that year were supposed to have if i'm reading the right stuff the right way.
I will try all of this later tonight. I might even be able to repurpose an old Airport express as a wireless-wired bridge and get the TV a connected on its wired interface. I'll try to send an 'etherwake' magic packet once I get that done.
humm ...
on your TV on Menu -> Network -> Viera Remote Settings do you have Viera Remote ON ? per manual
"TV Remote App Settings" -> "TV Remote App" ON, yes.
I replaced viera.js with your gist version above. Ultimately in order to get the TV to appear in HomeKit I had to reset my Homebridge instance entirely and re-add everything I have. I'm not sure whether I had a pre-existing issue, so it's hard to know whether the JS alone could have worked.
I haven't yet tried connecting via a wired connection, but Remote 2 does also work.
@jerrodh ,
so, with mod if i understood correctly everything works ? (except power on) ?
so, with mod if i understood correctly everything works ? (except power on) ?
Sorry, I should have been more clear. Yes - everything is working (except power on). Home app OFF command, input changing, control center TV remote app menu/back, volume, etc. Thanks much for getting me this far.
Some tv only supports tv wake on on lan on wired connection only. My tv supports both wireless and wired wake on lan.
On Sun, Nov 22, 2020 at 9:59 AM António Meireles notifications@github.com wrote:
@jerrodh https://github.com/jerrodh ,
so, with mod if i understood correctly everything works ? (except power on) ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AntonioMeireles/homebridge-vieramatic/issues/39#issuecomment-731777149, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALMVTMGXTQZVRE6WE2MAVSTSRE7OZANCNFSM4SVG72UQ .
-- Thank You Vic Joshi 1505969 Alberta Ltd. 403-399-8200
@jvic1234 what's your model ?
@jerrodh please report if you have a chance wired behavior... and if tour set supports wake on lan... we're getting closer !
thank you all for your patience!
Just connected the PN50ST60 to a wired connection (via wireless bridge) and tried:
sudo etherwake [tv wired MAC address]
Doesn't seem to work with this quick first attempt. Will try a direct wired connection at some point, but honestly WoL is not a super-high priority for my application, as I usually turn this TV on via HDMI-CEC with my AppleTV.
@jerrodh fwiw if the Panasonic Remote 2 mobile app is also unable to turn it on even when TV is connected to wired network then probably it doesn't support Wake on lan 🤕
@AntonioMeireles Right, Remote 2 and Remote 3 both hide their Power buttons once the TV is turned off, even when connected via the wired interface. I'm not optimistic.
Ez950 is the model.
Panasonic has so many remote apps
Tv remote 2 is able to turn on tv using wol packet. I am able to turn on tv from my pc using Wol command.
On Sun, Nov 22, 2020 at 3:20 PM jerrodh notifications@github.com wrote:
@AntonioMeireles https://github.com/AntonioMeireles Right, Remote 2 and Remote 3 both hide their Power buttons once the TV is turned off, even when connected via the wired interface. I'm not optimistic.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AntonioMeireles/homebridge-vieramatic/issues/39#issuecomment-731856582, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALMVTMAC6UF7Q6NDRPRPLBDSRGFDPANCNFSM4SVG72UQ .
-- Thank You Vic Joshi 1505969 Alberta Ltd. 403-399-8200
@jvic1234
just released 2.0.11
. fwiw if no structural issues arise wol support for sets that depend on it will happen in next release cycle.
@jvic1234, @jerrodh
2.0.12-beta.1
is just out and comes with tentative support for wake on lan sets.
install it and then just add to the TV's defs in homebridge's config.json
a line along "mac":"ACTUAL_TV_MAC_ADDRESS"
and restart homebridge. please give feedback about how far this is from actually working :-) [as i have no way to test ...]
@jvic1234
Hi!, anything still missing with currently shipping plugin ? or may i close ?
Thanks in advance!
folks, closing, as afaict we'd gone as far as we could in this regrad. please reopen or fill a new issue if you find that there's still room for improvement.
I recently switched to this plugin after an older one started failing as described by another user here:
https://reddit.com/r/homebridge/comments/i09164/panasonic_tv_plugin_crash/
However, I am having trouble getting this newer plugin to initialize. According to the logs:
Can the app scan be disabled for this TV?
Since this TV is not accessible while off, I understand that I’ll never be able to turn it on with HomeKit. My desire, however, is that this plugin would expose it to HomeKit and simply assume that it is OFF if it is inaccessible, and expose volume/input switching and power off functionality if the TV is on.
Error from homebridge logs:
[10/18/2020, 12:16:12 PM] [PanasonicVieraTV] TV was OFF; turning it ON for a bit in order to fetch its built-in app list [10/18/2020, 12:16:15 PM] [PanasonicVieraTV] turning TV OFF again [10/18/2020, 12:16:15 PM] [PanasonicVieraTV] unable to fetch Apps list from the TV { error: Error: connect ECONNREFUSED 192.168.1.33:55000 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '192.168.1.33', port: 55000, config: { url: 'http://192.168.1.33:55000/nrc/control_0', method: 'post', data: '<?xml version="1.0" encoding="utf-8"?> None </u:X_GetAppList> </s:Body> </s:Envelope>',
headers: [Object],
transformRequest: [Array],
transformResponse: [Array],
timeout: 2000,
adapter: [Function: httpAdapter],
responseType: 'text',
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus]
},
request: Writable {
_writableState: [WritableState],
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
_options: [Object],
_ended: false,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 293,
_requestBodyBuffers: [Array],
_onNativeResponse: [Function (anonymous)],
_currentRequest: [ClientRequest],
_currentUrl: 'http://192.168.1.33:55000/nrc/control_0',
_timeout: Timeout {
_idleTimeout: -1,
_idlePrev: null,
_idleNext: null,
_idleStart: 19530,
_onTimeout: null,
_timerArgs: undefined,
_repeat: null,
_destroyed: true,
} }
Raspberry Pi 3B+ Homebridge v1.2.3 Node v14.8.0 NPM v6.14.7 homebridge-vieramatic v2.0.7
Relevant section of config.json:
{ "tvs": [ { "ipAddress": "192.168.1.33", "hdmiInputs": [ { "id": "2", "name": "Apple TV" }, { "id": "3", "name": "Xbox One" } ], "customVolumeSlider": false } ], "platform": "PanasonicVieraTV" }