Giter Site home page Giter Site logo

Comments (9)

mmende avatar mmende commented on August 18, 2024

Hm strange... this is probable a library agnostic problem that originates from this library. I am not 100% familiar with the way this library actually controls the tv unfortunately. Maybe I'll try to dive a bit deeper into the library to fix some bugs like these myself when I find some time to do so.

from homebridge-samsungtv-control2.

Dennaldo avatar Dennaldo commented on August 18, 2024

Below is the error printed in the HomeBridge log when I press the Power button on the device from both the Home app and from HomeBridge accessories:

(node:1013) UnhandledPromiseRejectionWarning: Error: Unable to handleEvent
at /usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/SamsungTvConnection.js:130:13
at /usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/Messages.js:30:31
at new Promise ()
at Messages.handle (/usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/Messages.js:29:12)
at onMessageEmitter (/usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/SamsungTvConnection.js:45:12)
at WebSocket. (/usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/SamsungTvConnection.js:157:9)
at WebSocket.emit (events.js:315:20)
at Receiver._receiver.onmessage (/usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/ws/lib/websocket.js:137:47)
at Receiver.dataMessage (/usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/ws/lib/receiver.js:409:14)
at Receiver.getData (/usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/ws/lib/receiver.js:347:12)
at Receiver.startLoop (/usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/ws/lib/receiver.js:143:16)
at Receiver.add (/usr/local/lib/node_modules/@dustinblackman/homebridge-samsungtv-control/node_modules/ws/lib/receiver.js:117:10)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:284:9)
at Socket.Readable.push (_stream_readable.js:223:10)
(Use node --trace-warnings ... to show where the warning was created)
(node:1013) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1013) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

from homebridge-samsungtv-control2.

djsomi avatar djsomi commented on August 18, 2024

Same issue here, it was OK for the first time / day, now trowing this error for every button press.

from homebridge-samsungtv-control2.

maverixx avatar maverixx commented on August 18, 2024

Same Issue. Managed to reconnect by (1) Resetting Samsung TV to factory settings, (2) reinstalling "SamsungTV Control" and going through pairing again. Sadly, the TV Q85T2020 now continuously want me to "Allow Node.js" each and everytime I send a command (and the command isn't implemented). Other wise the programming is really neat and Mr MMENDE deserves credit for the neatest yet seen Homebridge installation + auto config code. 😄

(Very happy to provide Logs if this is helpful. Just message me :) )

from homebridge-samsungtv-control2.

deepontech avatar deepontech commented on August 18, 2024

Same here, keeps asking to allow Node.js

from homebridge-samsungtv-control2.

patrickkettner avatar patrickkettner commented on August 18, 2024

looked at this for a bit. At least for devices that use the underlying samsung-tv-control (which I think is any device that is requiring the pin, but 🤷‍♂️), the token isn't being passed over. Specifically, the initiation of it here

  const control = new Samsung(cfg)

is passing in this config

  const cfg = getRemoteConfig(config)

which is being generated by this function

const getRemoteConfig = (config: DeviceConfig) => {
  const model = parseSerialNumber(config.modelName)
  const { year = 2013 } = model || {}
  const supportsLegacy = typeof year === `number` && year < 2014
  const port = config.remoteControlPort || supportsLegacy ? 55000 : 8002
  return {
    mac: config.mac,
    ip: config.lastKnownIp,
    name: PLATFORM_NAME,
    port,
  }
}

the token that is being added to the configuration file is not being passed in. I manually added this line

token: config.token,

to my own version locally, and its working now.

const getRemoteConfig = (config: DeviceConfig) => {
  const model = parseSerialNumber(config.modelName)
  const { year = 2013 } = model || {}
  const supportsLegacy = typeof year === `number` && year < 2014
  const port = config.remoteControlPort || supportsLegacy ? 55000 : 8002
  return {
    mac: config.mac,
    ip: config.lastKnownIp,
    name: PLATFORM_NAME,
    token: config.token,
    port,
  }
}

from homebridge-samsungtv-control2.

mmende avatar mmende commented on August 18, 2024

Thanks for the effort @patrickkettner. I just added your changes and published v2.0.3

from homebridge-samsungtv-control2.

djsomi avatar djsomi commented on August 18, 2024

Hi Guys,

Thanks for the update, I've tested it, was good for a few days, than it started to throwing this again:

(node:30540)_ UnhandledPromiseRejectionWarning: Error: Unable to handleEvent
at /usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/SamsungTvConnection.js:130:13
at /usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/Messages.js:30:31
at new Promise ()
at Messages.handle (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/Messages.js:29:12)
at onMessageEmitter (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/SamsungTvConnection.js:45:12)
at WebSocket. (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-remote-pin-paired/lib/Connection/SamsungTvConnection.js:157:9)
at WebSocket.emit (events.js:400:28)
at Receiver._receiver.onmessage (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/ws/lib/websocket.js:137:47)
at Receiver.dataMessage (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/ws/lib/receiver.js:409:14)
at Receiver.getData (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/ws/lib/receiver.js:347:12)
at Receiver.startLoop (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/ws/lib/receiver.js:143:16)
at Receiver.add (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/ws/lib/receiver.js:117:10)
at Socket.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:293:12)
at readableAddChunk (internal/streams/readable.js:267:9)
at Socket.Readable.push (internal/streams/readable.js:206:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
(node:30540) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:30540) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

from homebridge-samsungtv-control2.

djsomi avatar djsomi commented on August 18, 2024

Tried to remove and add again, now it TV cant be added anymore. Mabye its from IOS 15?

from homebridge-samsungtv-control2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.