AntonioMeireles / homebridge-vieramatic

Homebridge plugin for Panasonic™ Viera™ TVs (includes support for 2018 and later models)
Apache License 2.0
43 stars 9 forks source link

setInput 500 HTTPError: Response code 500 (Internal Server Error) #97

Open ViniciusPine opened 2 years ago

ViniciusPine commented 2 years ago

Describe your issue

When I try to going through all HDMI Inputs or Turn ON/OFF after Wake Up the command doesn't respond.

Issue Context

1. Homebridge LOG

[25/02/2022, 12:05:13] [PanasonicVieraTV] setInput 500 HTTPError: Response code 500 (Internal Server Error)
    at Request.<anonymous> (file:///usr/local/lib/node_modules/homebridge-vieramatic/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:640:26)
    at Request.emit (node:events:532:35)
    at Request._onResponseBase (file:///usr/local/lib/node_modules/homebridge-vieramatic/node_modules/got/dist/source/core/index.js:729:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Request._onResponse (file:///usr/local/lib/node_modules/homebridge-vieramatic/node_modules/got/dist/source/core/index.js:768:13) {
  input: undefined,
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1645801513349,
    socket: 1645801513352,
    lookup: 1645801513364,
    connect: 1645801513364,
    secureConnect: undefined,
    upload: 1645801513365,
    response: 1645801513373,
    end: 1645801513381,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 3,
      dns: 12,
      tcp: 0,
      tls: undefined,
      request: 1,
      firstByte: 8,
      download: 8,
      total: 32
    }
  },
  options: {
    request: undefined,
    agent: { http: undefined, https: undefined, http2: undefined },
    h2session: undefined,
    decompress: true,
    timeout: {
      connect: undefined,
      lookup: undefined,
      read: undefined,
      request: 1500,
      response: undefined,
      secureConnect: undefined,
      send: undefined,
      socket: undefined
    },
    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_EncryptedCommand xmlns:u="urn:panasonic-com:service:p00NetworkControl:1"><X_ApplicationId>AQz/Irgn68KRwg==</X_ApplicationId><X_EncInfo>IYUXdPn+eyNLw4o+DUbonpmWNZvClZtiOMfSvvPUUVZTbqMtmvo17lYIqLZfK9HOkU17wiVMz53gEouGbB7fBviJAI3sP+1MJxaY3nV6IK/TbMhM6voB3OSV6Vm9QRcX15JnDtk2GgM3s0ulibRAT9uzhsvj/P9AiYWYS7vTXlZrD76W4AXOeQTq9x5TnyhFD/FM060wEMNtv7Ep/gBgARlQ9nRLxaVXNCaXxTSIw/vMgulp53DcJ5mQMG75CUJ40jNWuR2NeN83rO0fdLhBQfy4i2SiqUNwSiW/jcFmahytB7O3MtNcBN254bMhlxmtePmNaqsrfqkxd6x3dof7X/3iSjOcN3Ju7jvyw4NH/G8OFNZ09jXsRjF7RrrCjD6w</X_EncInfo></u:X_EncryptedCommand></s:Body></s:Envelope>',
    form: undefined,
    json: undefined,
    cookieJar: undefined,
    ignoreInvalidCookies: false,
    searchParams: undefined,
    dnsLookup: undefined,
    dnsCache: undefined,
    context: {},
    hooks: {
      init: [],
      beforeRequest: [],
      beforeError: [],
      beforeRedirect: [],
      beforeRetry: [],
      afterResponse: []
    },
    followRedirect: true,
    maxRedirects: 10,
    cache: undefined,
    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: '10.0.0.41:55000',
      pragma: 'no-cache',
      soapaction: '"urn:panasonic-com:service:p00NetworkControl:1#X_EncryptedCommand"',
      'content-length': '751',
      'accept-encoding': 'gzip, deflate, br'
    },
    methodRewriting: false,
    dnsLookupIpVersion: undefined,
    parseJson: [Function: parse],
    stringifyJson: [Function: stringify],
    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'
      ],
      maxRetryAfter: undefined,
      calculateDelay: [Function: calculateDelay],
      backoffLimit: Infinity,
      noise: 100
    },
    localAddress: undefined,
    method: 'POST',
    createConnection: undefined,
    cacheOptions: {
      shared: undefined,
      cacheHeuristic: undefined,
      immutableMinTimeToLive: undefined,
      ignoreCargoCult: undefined
    },
    https: {
      alpnProtocols: undefined,
      rejectUnauthorized: undefined,
      checkServerIdentity: undefined,
      certificateAuthority: undefined,
      key: undefined,
      certificate: undefined,
      passphrase: undefined,
      pfx: undefined,
      ciphers: undefined,
      honorCipherOrder: undefined,
      minVersion: undefined,
      maxVersion: undefined,
      signatureAlgorithms: undefined,
      tlsSessionLifetime: undefined,
      dhparam: undefined,
      ecdhCurve: undefined,
      certificateRevocationLists: undefined
    },
    encoding: undefined,
    resolveBodyOnly: false,
    isStream: false,
    responseType: 'text',
    url: URL {
      href: 'http://10.0.0.41:55000/nrc/control_0',
      origin: 'http://10.0.0.41:55000',
      protocol: 'http:',
      username: '',
      password: '',
      host: '10.0.0.41:55000',
      hostname: '10.0.0.41',
      port: '55000',
      pathname: '/nrc/control_0',
      search: '',
      searchParams: URLSearchParams {},
      hash: ''
    },
    pagination: {
      transform: [Function: transform],
      paginate: [Function: paginate],
      filter: [Function: filter],
      shouldContinue: [Function: shouldContinue],
      countLimit: Infinity,
      backoff: 0,
      requestLimit: 10000,
      stackAllItems: false
    },
    setHost: true,
    maxHeaderSize: undefined
  }
} 

2. Config.json

            "platform": "PanasonicVieraTV",
            "tvs": [
                {
                    "appId": "AQz/Irgn68KRwg==",
                    "customVolumeSlider": false,
                    "encKey": "JevABcCx1neq7P81EpmQKA==",
                    "friendlyName": "TV da Sala",
                    "hdmiInputs": [
                        {
                            "id": "2",
                            "name": "Apple TV"
                        },
                        {
                            "id": "1",
                            "name": "Receiver"
                        }
                    ],
                    "ipAddress": "10.0.0.41"
                }
            ]

4. Details about your specific homebridge setup

5. Additional Info

If I reboot the Homebridge service with TV turned on, works properly. The issue happens when the Homebridge is running and TV is off. When I turn on the Tv via remote control (this TV Model don't have Wake on LAN), the TV show turned ON on HomeKit but interactions doesn't work, like Turn ON/OFF and HDMI Inputs.

AntonioMeireles commented 2 years ago

@ViniciusPine

Hi again!

just a first quick NOTE - unless the firmware for your set in your side of the world is substantially different than the one here in Europe - ALL sets that require encryption should also support WakeOnLan and Networked StandBy.

Just make sure that all settings referenced here are activated (you have them all on your set, right ? can you post a screenshot too please).

for WOL to be attempted you 'd need to have the mac address set in the homebridge config (and per what you posted you haven't), but even that shouldn't be needed as networked standby is supposed to work and be available.

thanks again for reporting, and one way or another, just like last time, we'll sort this out :-)

Have a great weekend too!

António

AntonioMeireles commented 2 years ago

@ViniciusPine

can you please also attach here the contents of your accessories/vieramatic.json file ? (path is relative to dir where your homebridge config is)

ViniciusPine commented 2 years ago

here IMG_3BDED7A2BB02-1

Here in Brazil at least this TV model doesn't have WOL support. Like the print. When I bought in 2018, this was an upset, even before I start with Homebridge/HomeKit

@ViniciusPine

can you please also attach here the contents of your accessories/vieramatic.json file ? (path is relative to dir where your homebridge config is)

And how can I do that? (I'm digging in advance for this info)

ViniciusPine commented 2 years ago

@ViniciusPine

can you please also attach here the contents of your accessories/vieramatic.json file ? (path is relative to dir where your homebridge config is)

{"4D454930-0200-1000-8001-80C755135201":{"data":{"inputs":{"applications":{"0":{"id":"0387878700000102","name":"Apps Market"},"1":{"id":"0010000200000001","name":"Netflix","hidden":0},"2":{"id":"0010000100180001","name":"Amazon Prime Video","hidden":0},"3":{"id":"0070000200180001","name":"YouTube","hidden":0},"4":{"id":"0076011007000001","name":"Telecine Play"},"5":{"id":"0076009407000001","name":"Globoplay","hidden":0},"6":{"id":"0387878700000141","name":"Audio Link","hidden":0},"7":{"id":"0387878700000003","name":"Guia DTV","hidden":0},"8":{"id":"0077777700160002","name":"Browser"},"9":{"id":"0387878700000050","name":"Multi Janelas"},"10":{"id":"0387878700000013","name":"TV gravada"},"11":{"id":"0387878700150020","name":"Calendário"},"12":{"id":"0387878700000016","name":"VIERA Link","hidden":0},"13":{"id":"0010003800000001","name":"Globosat Play"},"14":{"id":"0010001800000001","name":"TuneIn"},"15":{"id":"0010005200000001","name":"Jacaré Banguela"},"16":{"id":"0010003600000001","name":"Santos TV"},"17":{"id":"0010003100000001","name":"TV Cultura"},"18":{"id":"0076011107000001","name":"Looke"},"19":{"id":"0010004700000001","name":"TV Estadão"},"20":{"id":"0310003A00000001","name":"Estadão"},"21":{"id":"0076002307170001","name":"Digital Concert Hall"},"22":{"id":"0387878700000140","name":"Central de notificações"},"23":{"id":"0070002900000002","name":"Disney+"},"24":{"id":"0070003000000001","name":"Apple TV+"},"25":{"id":"0070003100000001","name":"YouTube Music"}},"hdmi":[{"id":"2","name":"Apple TV"},{"id":"1","name":"Receiver"}],"TUNER":{"hidden":0}},"ipAddress":"10.0.0.41","specs":{"friendlyName":"TV da Sala","manufacturer":"Panasonic","modelName":"Panasonic VIErA","modelNumber":"TC-55FX800B","requiresEncryption":true,"serialNumber":"4D454930-0200-1000-8001-80C755135201"}}}
AntonioMeireles commented 2 years ago

@ViniciusPine

sorry lag! (work/life not leaving much time left for watching TV or doing OSS development).

according to https://www.manualowl.com/m/Panasonic/TC-55FX800/Manual/655379 your TV should really have at the veryt least WOL support. (page 58) [it's not clear if it has networked standby]. can you change TV language to english and check again that the feature is not there ?

(per your screenshot above the key options should be under the "Controle Remoto" tab...)

image

a priori what is needed is to have those two settings as ON . then grab gthe TV's macaddress and add "mac": "YOUR_TV_MAC_ADDRESS", to your TV's homebridge config block.

bug me again if things still not behave plz.

Thanks again for your patience, and have a great weekend!

ViniciusPine commented 2 years ago

@ViniciusPine

sorry lag! (work/life not leaving much time left for watching TV or doing OSS development).

according to https://www.manualowl.com/m/Panasonic/TC-55FX800/Manual/655379 your TV should really have at the veryt least WOL support. (page 58) [it's not clear if it has networked standby]. can you change TV language to english and check again that the feature is not there ?

(per your screenshot above the key options should be under the "Controle Remoto" tab...)

image

a priori what is needed is to have those two settings as ON . then grab gthe TV's macaddress and add "mac": "YOUR_TV_MAC_ADDRESS", to your TV's homebridge config block. bug me again if things still not behave plz.

Thanks again for your patience, and have a great weekend!

Hey, thanks for your answer! I changed the language but nothing changes, same menus behavior. Doesn't appear de WOL option. I think the "B" on the part number have some meaning. Sadly. But thanks for your research! The issues are still happening.