Git Product home page Git Product logo

Comments (19)

mmende avatar mmende commented on August 16, 2024

What model are you using? I only have a test device that supports the legacy protocol and another one from 2014 (yet unsupported) which pairs completely different than the newer models. Maybe your model is one of the newer ones I was not able to test.

from homebridge-samsungtv-control2.

 avatar commented on August 16, 2024

I have the same problem. I'm using an UE50RU7409UXZG from 2019.

from homebridge-samsungtv-control2.

mmende avatar mmende commented on August 16, 2024

Thanks for the feedback ... I just added a second library to be able to control TV's that use pin code authentication to pair but also TV's that don't work with the current implementation maybe. Since it is already required for these TV's to do the pairing outside of homebridge by calling the pairing command manually once, I might also move the non pin pairing to this script. I'll report back here when the new version is published.

from homebridge-samsungtv-control2.

mmende avatar mmende commented on August 16, 2024

I just published v2.0.0-alpha.10 with the new pairing logic outside of homebridge. If you know the ip and mac address of your tv you can try these two methods and will instantly know if one of the methods worked when the tv toggles it's mute state:

npx samsung-ctrl pair1 <ip> <mac>

or

npx samsung-ctrl pair2 <ip> <mac>

e.g. npx samsung-ctrl pair2 123.456.789.42 0A:60:10:86:2A:04

If it worked out you'll get a token you then simply add to your config as further described in the readme.
Please let me know if it worked.

from homebridge-samsungtv-control2.

 avatar commented on August 16, 2024

I'm getting this error log when executing your commands:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/bin/node',
1 verbose cli '/usr/lib/node_modules/npm/bin/npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'samsung-ctrl@latest',
1 verbose cli '--global',
1 verbose cli '--prefix',
1 verbose cli '/home/homebridge/.npm/_npx/3376',
1 verbose cli '--loglevel',
1 verbose cli 'error',
1 verbose cli '--json'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session a08a7076414fa745
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 404 https://registry.npmjs.org/samsung-ctrl 1114ms
8 http fetch GET 404 https://registry.npmjs.org/samsung-ctrl 811ms
9 silly fetchPackageMetaData error for samsung-ctrl@latest 404 Not Found - GET https://registry.npmjs.org/samsung-ctrl - Not found
10 timing stage:rollbackFailedOptional Completed in 5ms
11 timing stage:runTopLevelLifecycles Completed in 2021ms
12 verbose stack Error: 404 Not Found - GET https://registry.npmjs.org/samsung-ctrl - Not found
12 verbose stack at /usr/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:114:15
12 verbose stack at processTicksAndRejections (internal/process/task_queues.js:97:5)
13 verbose statusCode 404
14 verbose pkgid samsung-ctrl@latest
15 verbose cwd /var/lib/homebridge
16 verbose Linux 4.19.118-v7+
17 verbose argv "/usr/bin/node" "/usr/lib/node_modules/npm/bin/npm-cli.js" "install" "samsung-ctrl@latest" "--global" "--prefix" "/home/homebridge/.npm/_npx/3376" "--loglevel" "error" "--json"
18 verbose node v12.18.3
19 verbose npm v6.14.6
20 error code E404
21 error 404 Not Found - GET https://registry.npmjs.org/samsung-ctrl - Not found
22 error 404
23 error 404 'samsung-ctrl@latest' is not in the npm registry.
24 error 404 You should bug the author to publish it (or use the name yourself!)
25 error 404 Note that you can also install from a
26 error 404 tarball, folder, http url, or git url.
27 verbose exit [ 1, true ]

from homebridge-samsungtv-control2.

ggroel avatar ggroel commented on August 16, 2024

from homebridge-samsungtv-control2.

mmende avatar mmende commented on August 16, 2024

My bad ... I thought npx could resolve the cli script without it being installed. To fix it install the plugin first

npm i -g homebridge-samsungtv-control

Afterwars you should be able to run the commands without npx in front...

from homebridge-samsungtv-control2.

mmende avatar mmende commented on August 16, 2024

I might rename the cli script to homebridge-samsungtv-control so that npx is able to resolve it without the need to install it in the first place...

from homebridge-samsungtv-control2.

mmende avatar mmende commented on August 16, 2024

Martín, hello ... sorry for my ignorance, but where do I execute those commands ?. In the HomeBridge terminal? In my server terminal ?. From the terminal of my server it gives me this result root @ NAS: ~ # npx samsung-ctrl pair1 10.0.1.3 E4: 7C: F9: E8: 58: B8 npm ERR! code E404 npm ERR! 404 Not Found - GET http://registry.npmjs.org/samsung-ctrl - Not found npm ERR! 404 npm ERR! 404 'samsung-ctrl @ latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-07-24T14_12_39_901Z-debug.log Installation of ['samsung-ctrl @ latest'] failed with code 1 root @ NAS: ~ # npx samsung-ctrl pair2 10.0.1.3 E4: 7C: F9: E8: 58: B8 npm ERR! code E404 npm ERR! 404 Not Found - GET http://registry.npmjs.org/samsung-ctrl - Not found npm ERR! 404 npm ERR! 404 'samsung-ctrl @ latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2020-07-24T14_12_48_507Z-debug.log Installation of ['samsung-ctrl @ latest'] failed with code 1 Gastón

El 24 jul. 2020, a las 10:55, Martin Mende @.***> escribió: I just published v2.0.0-alpha.10 with the new pairing logic outside of homebridge. If you know the ip and mac address of your tv you can try these two methods and will instantly know if one of the methods worked when the tv toggles it's mute state: npx samsung-ctrl pair1 or npx samsung-ctrl pair2 e.g. npx samsung-ctrl pair2 123.456.789.42 0A:60:10:86:2A:04 If it worked out you'll get a token you then simply add to your config as further described in the readme. Please let me know if it worked. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/APBDDDEZ24T4MZOCVNKBJK3R5GHFJANCNFSM4PDGW2HQ.

Install the plugin global first if you haven't already npm i -g homebridge-samsungtv-control and then you should be able to run samsung-ctrl pair1 <ip> <mac> or samsung-ctrl pair2 <ip> <mac>

from homebridge-samsungtv-control2.

ggroel avatar ggroel commented on August 16, 2024

from homebridge-samsungtv-control2.

 avatar commented on August 16, 2024

pi@eiger:~ $ samsungtv-ctrl pair1 192.168.178.38 24:FC:E5:4C:B2:F4
(node:5468) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at http://192.168.178.38:8001/ms/1.0/ reason: Unexpected token < in JSON at position 0
at /usr/lib/node_modules/homebridge-samsungtv-control/node_modules/node-fetch/lib/index.js:272:32
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async SamsungTv.fetchDeviceInfo (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-remote/lib/SamsungTv.js:37:20)
at async SamsungTv.init (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-remote/lib/SamsungTv.js:19:20)
at async Command.pinPair (/usr/lib/node_modules/homebridge-samsungtv-control/dist/cli.js:44:5)
(node:5468) 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:5468) [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.

pi@eiger:~ $ samsungtv-ctrl pair2 192.168.178.38 24:FC:E5:4C:B2:F4
Ok... sending the pairing request to your tv. Please click allow when asked
(node:5478) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
(node:5478) UnhandledPromiseRejectionWarning: Error: Did not receive token from Samsung TV
at /usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/lib/samsung.js:89:28
at /usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/lib/samsung.js:77:21
at WebSocket. (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/lib/samsung.js:278:17)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/websocket.js:797:20)
at Receiver.emit (events.js:315:20)
at Receiver.dataMessage (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:437:14)
at Receiver.getData (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:367:17)
at Receiver.startLoop (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:143:22)
at Receiver._write (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:78:10)
(node:5478) 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: 1)
(node:5478) [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.

mmende avatar mmende commented on August 16, 2024

Updated it to be named as the plugin itself...
You could also try port 8001

npx homebridge-samsungtv-control pair2 192.168.178.38 24:FC:E5:4C:B2:F4 --port 8001

from homebridge-samsungtv-control2.

 avatar commented on August 16, 2024

When I try the command with pair1 it says "enter the pin you see on your tv" but the tv isn't showing any key.

And when I try it with pair2 the tv asks if I want to allow NodeJS controlling my tv -> clicking "allow" on the tv results in following error:

pi@eiger:~ $ npx homebridge-samsungtv-control pair2 192.168.178.38 24:FC:E5:4C:B2:F4
Ok... sending the pairing request to your tv. Please click allow when asked
(node:15682) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
That didn't work unfortunatelly. Here are some other possible solutions:

  1. Try another port npx homebridge-samsungtv-control pair2 192.168.178.38 24:FC:E5:4C:B2:F4 --port 8001
  2. Try the other pairing method npx homebridge-samsungtv-control pair1 192.168.178.38 24:FC:E5:4C:B2:F4

and npx homebridge-samsungtv-control pair2 192.168.178.38 24:FC:E5:4C:B2:F4 --port 8001 results in:

pi@eiger:~ $ npx homebridge-samsungtv-control pair2 192.168.178.38 24:FC:E5:4C:B2:F4 --port 8001
Ok... sending the pairing request to your tv. Please click allow when asked

/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/lib/samsung.js:66
throw new Error('Error send Key');
^

Error: Error send Key
at /usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/lib/samsung.js:66:23
at WebSocket. (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/lib/samsung.js:299:17)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnError (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/websocket.js:777:13)
at Receiver.emit (events.js:315:20)
at errorOrDestroy (internal/streams/destroy.js:108:12)
at onwriteError (_stream_writable.js:418:5)
at onwrite (_stream_writable.js:445:5)
at Receiver.startLoop (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:152:5)
at Receiver._write (/usr/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:78:10)

from homebridge-samsungtv-control2.

sadpixel avatar sadpixel commented on August 16, 2024

Encountering the exact same error as reported by maucherli on 7/24 on a 55" Frame 2020 model (QN55LS03TAFXZA)

from homebridge-samsungtv-control2.

JasonAvg avatar JasonAvg commented on August 16, 2024

I too have the same error as maucherli when trying pair2 method with port 8001 ... My TV is a 2017 Q7F 49" with latest firmware

from homebridge-samsungtv-control2.

ernesto-jimenez avatar ernesto-jimenez commented on August 16, 2024

Same problem here.

When I used the homebridge-samsung-tizen plugin last year it worked fine, @mmende you might be able to see how they implemented the pairing.

from homebridge-samsungtv-control2.

gregorskii avatar gregorskii commented on August 16, 2024

I am seeing it connect, but it prompts "Allow" every time I control the TV from the accessories tab of homebridge. For me Q80T the pair2 option works, but it pops up the menu not mute. When I add the device with the token it lists in terminal the home app it says the token is invalid.

from homebridge-samsungtv-control2.

blaauboer avatar blaauboer commented on August 16, 2024

I have the same problem, for each command the prompt shows again on the TV. I get the following in the Homebridge logs:

(node:2941) UnhandledPromiseRejectionWarning: RangeError: Invalid WebSocket frame: invalid status code 1005
at Receiver.controlMessage (/usr/local/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:464:18)
at Receiver.getData (/usr/local/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:350:42)
at Receiver.startLoop (/usr/local/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:143:22)
at Receiver._write (/usr/local/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/receiver.js:78:10)
at writeOrBuffer (internal/streams/writable.js:358:12)
at Receiver.Writable.write (internal/streams/writable.js:303:10)
at TLSSocket.socketOnData (/usr/local/lib/node_modules/homebridge-samsungtv-control/node_modules/samsung-tv-control/node_modules/ws/lib/websocket.js:900:35)
at TLSSocket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at TLSSocket.Readable.push (internal/streams/readable.js:223:10)
at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)
(node:2941) 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: 13)

I have a Samsung UE32M5600 and got the token in my config.

from homebridge-samsungtv-control2.

TristanBrotherton avatar TristanBrotherton commented on August 16, 2024

Same issue here with a Samsung frame 2021. I'll dig a bit deeper to see if I can figure out a path to resolution.

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.