"event": "ms.channel.unauthorized" when sending a command

See original GitHub issue

I’m trying to send commands to a Samsung Tizen 2018 (QE55Q8FNA) using the sample code:

const config = {
  debug: true, // Default: false
  ip: '10.189.148.65',
  mac: 'C048E64BADE5',
  name: '[TV] Samsung Q8 Series (55)', // Default: NodeJS
  port: 8001, // Default: 8002
  saveToken: true
}

const control = new Samsung(config)

await control.turnOn()
await control.isAvaliable()

let token = await control.getTokenPromise()

I can see TV information coming back, but the getTokenPromise fails with

FUNCTION: ws.on message
LOG data: 
{
  "event": "ms.channel.unauthorized"
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
stijnbernardscommented, May 13, 2020

Changing to port 8002 fixes it for me. I also had to turn on debug mode to check which token is being generated. After I configured that token everything worked fine for me.

1reaction
hurrikamcommented, Mar 18, 2020

To add more context, I’ve done some debugging. The call to get a token fails on sendKeys:

getToken(done) {
        this.LOGGER.log('getToken', '');
        if (this.SAVE_TOKEN && this.TOKEN !== 'null' && this.TOKEN !== '') {
            done(this.TOKEN);
            return;
        }
        this.sendKey(keys_1.KEYS.KEY_HOME, (err, res) => {
            if (err) {
                this.LOGGER.error('after sendKey', err, 'getToken');

err is: { RangeError: Invalid WebSocket frame: invalid status code 1005

Read more comments on GitHub >

github_iconTop Results From Across the Web

"ms.channel.unauthorized" when connecting to Samsung TV ...
UnhandledResponse: {'event': 'ms.channel.unauthorized'} 2019-03-07 16:39:00 INFO ... TV is powering off, not sending command: KEY.
Read more >
“ms.channel.unauthorized” when connecting to Samsung TV ...
I get “ms.channel.unauthorized” when connecting to Samsung TV UE55NU6035 (using the samsungtv component). I'm not able to control anything ...
Read more >
Troubleshoot connectivity issues - Azure Event Hubs
Any connection attempt from an IP address that doesn't match an allowed IP rule on the Event Hubs namespace is rejected as unauthorized....
Read more >
Samsung Hubitat TV Integration (2016 and later)
Anyone aware of a way to fix the two on events? ... The Record command. ... 2.0.0]:: parseWebsocket: event = ms.channel.unauthorized, ...
Read more >
Send Auth request to Q - SamyGO Networks
{"method":"ms.channel.emit","params":{"event": "ed.installedApp.get", "to":"host"}}. You should get some json (installed) apps list as reply ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found