Giter Club home page Giter Club logo

androidtv-remote's People

Contributors

louis49 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidtv-remote's Issues

Unhandled error (at TLSSocket.<anonymous> (/.../RemoteManager.js:107:21))

This was all working fine up until today. My previously paired TV stopped working so attempted a re-pair and got the same error. Here's what it looks like when using the example.js script:

$ node ./example.js 
Start Pairing Connect
tv Pairing connected
tv Pairing secure connected 
Receive : 7,8,2,16,200,1,90,0
Receive : {"protocolVersion":2,"status":"STATUS_OK","pairingRequestAck":{}}
Receive : 16,8,2,16,200,1,162,1,8,18,4,8,3,16,6,24,1
Receive : {"protocolVersion":2,"status":"STATUS_OK","pairingOption":{"outputEncodings":[{"type":"ENCODING_TYPE_HEXADECIMAL","symbolLength":6}],"preferredRole":"ROLE_TYPE_INPUT"}}
Receive : 8,8,2,16,200,1,250,1,0
Receive : {"protocolVersion":2,"status":"STATUS_OK","pairingConfigurationAck":{}}
Code : XXXXXX
Sending code :  XXXXXX
Receive : 42,8,2,16,200,1,202,2,34,10,32,174,196,77,47,215,11,128,83,224,226,179,60,125,89,172,113,64,113,167,2,112,94,191,75,48,212,3,172,224,155,96,254
Receive : {"protocolVersion":2,"status":"STATUS_OK","pairingSecretAck":{"secret":"rsRNL9cLgFPg4rM8fVmscUBxpwJwXr9LMNQDrOCbYP4="}}
tv Paired!
tv Pairing Connection closed false
Start Remote Connect
tv Remote secureConnect
tv Receive : {"remoteConfigure":{"code1":637,"deviceInfo":{"model":"BRAVIA 4K GB","vendor":"Sony","unknown1":1,"unknown2":"9","packageName":"com.google.android.tv.remote.service","appVersion":"5.2.473254133"}}}
Create Remote {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"21K9CTO1WW","vendor":"LENOVO","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}
Sending {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"21K9CTO1WW","vendor":"LENOVO","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}
tv Receive : {"remoteError":{"value":true,"message":{"remoteConfigure":{"code1":622,"deviceInfo":{"model":"21K9CTO1WW","vendor":"LENOVO","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}}}
node:events:505
    throw err; // Unhandled 'error' event
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
  error: RemoteError {
    value: true,
    message: RemoteMessage { remoteConfigure: [RemoteConfigure] }
  }
})
    at RemoteManager.emit (node:events:503:17)
    at TLSSocket.<anonymous> (/home/xxx/node_modules/androidtv-remote/dist/remote/RemoteManager.js:107:21)
    at TLSSocket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:545:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:495:3)
    at Readable.push (node:internal/streams/readable:375:5)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 'ERR_UNHANDLED_ERROR',
  context: {
    error: RemoteError {
      value: true,
      message: RemoteMessage {
        remoteConfigure: RemoteConfigure {
          code1: 622,
          deviceInfo: RemoteDeviceInfo {
            model: '21K9CTO1WW',
            vendor: 'LENOVO',
            unknown1: 1,
            unknown2: '1',
            packageName: 'androitv-remote',
            appVersion: '1.0.0'
          }
        }
      }
    }
  }
}

Node.js v20.10.0

Restart with error ECONNRESET

=> Do not auto-restart remote when socket answer ECONNRESET

Meaning :

  • Cert was revoked by an other app
  • Bad Cert
  • No cert

=> Emit specific error

save cert

hello

is there a way to save the cert afterthe first pairing and reuse later so I won't need to do the pairing process again?
I saw the method getCertificate() but it looks like it's used just to reconnect or something like that, it's not saving the cert into a .pem file.

thanks

Error: connect ECONNREFUSED

Env:

  • node: v14.19.0
  • Android Box TX6: version 9

My Code:

const AndroidRemote = require("androidtv-remote");

let host = "192.168.22.14";
let options = {
    pairing_port : 6467,
    remote_port : 6466,
    name : 'androidtv-remote',
}
let androidRemote = new AndroidRemote.AndroidRemote(host, options)

let started = androidRemote.start();

Run on command prompt:

$ node app.js
Start Pairing Connect
Error: connect ECONNREFUSED 192.168.137.205:6467
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
  errno: -4078,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.22.14',
  port: 6467
}
192.168.22.14 Pairing Connection closed true
false

What wrong ?

Suggested improvements

Description

First of all, thanks for this great package. I've been using it recently for a home automation service and it works great.

But I've noticed a few areas which could be improved upon. I've described the issues I'm having with the current situation and provided a possible solution.

The three improvements that would make this package even better are:

  1. Adding a configurable timeout for the failed connection/reconnect timeout
  2. Refactor the console info/debug logs to an event
  3. Make the AndroidRemote emit the connection close event

 

1. Configurable timeout

I'm using your package for a home automation service which has very little resources available and I would like to increase the reconnect timeout when the client receives a closed event without an error. Because I think this usually means the device is just completely off and there's no need to check it every second.

Suggestion

For example add a default timeout:

class RemoteManager extends EventEmitter {
    constructor(host, port, certs, configurableTimeout = 1000) {

RemoteManager.js

That's used in the on('close') event:

this.client.on('close', async (hasError) => {
  console.info(this.host + " Remote Connection closed ", hasError);
  if (hasError) {
    ...
  } else {
    await new Promise(resolve => setTimeout(resolve, configurableTimeout));
    
    await this.start().catch((error) => {
      console.error(error);
    });
  }
})

RemoteManager.js

 

2. Refactor console logs

Because the home automation service I'm using sends me the console output any time something fails it would be a huge improvement if I only get the logs which I choose to output instead of all the debug messages which are outputted to the console by this package.

Suggestion

Refactor all console.info, console.debug, console.error, etc, calls to emitting an event. I think most classes already extend the EventEmitter so you could very easily refactor the current situation:

this.client.on('timeout', () => {
    console.debug('timeout');
    this.client.destroy();
});

RemoteManager.js

To something like:

this.client.on('timeout', () => {
    this.emit('log.debug', 'timeout');
    this.client.destroy();
});

RemoteManager.js

And then make these events bubble up.

Then if you would like to keep the current behavior the only thing you would need to do is bind a listener on the client for these log events:

let androidRemote = new AndroidRemote(host, options)

androidRemote.on('log.debug', (...args) => {
    console.debug(args)
});
androidRemote.on('log.info', (...args) => {
    console.info(args)
});
androidRemote.on('log.error', (...args) => {
    console.error(args)
});

example.js

 

3. Emit the close event

The home automation service I use keeps track of if a device is available or not. There is currently no nice way for me to update this state from the events the AndroidRemote emits because it doesn't emit an event for if the connection was closed.

This would be very useful because with this event I'd be able to tell if the device is available or not. At the moment I always need to assume that the device isn't available and then update it's state to available when the AndroidRemote emits a ready event.

But there's currently no way for me to change the device's state to unavailable if the RemoteManager loses connection to the TV and starts trying to reconnect to it.

Suggestion

If you could make the close event in the RemoteManager bubble up to so the AndroidRemote emits the same event that would be a huge help!

this.client.on('close', async (hasError) => {
    this.emit('close', hasError)
    ...

RemoteManager.js

 

Let me know if there's anything I can do to help!

how ping packet looks like?

Hi,
How did u know how to parse a ping packet and to identify it and send a ping packet back (and also how that one looks like?)
cuz sometime I get from the tv a ping message that starts like this:
[66, 8, 8 ...]
sometimes like this:
[66, 7, 8 ... ]

is there any logic behing this?

ERR_UNHANDLED_ERROR

Salut Louis,

J'ai installé hier androidtv-remote. J'ai réussi le pairing, par contre quand j'envoie une commande je reçois cette erreur (pour info j'ai essayé de redémarrer ma TV):

code: 'ERR_UNHANDLED_ERROR',
  context: {
    error: RemoteError {
      value: true,
      message: RemoteMessage {
        remoteKeyInject: RemoteKeyInject { keyCode: 91, direction: 3 }
      }
    }
  }

J'utilise le même exemple que toi (au passage dans le readme et example,js tu marques RemoteKeyCode.MUTE alors que ça devrait être RemoteKeyCode.KEYCODE_MUTE):

androidRemote.on('ready', async function (){
      androidRemote.sendKey(RemoteKeyCode.KEYCODE_MUTE, RemoteDirection.SHORT)
  }.bind(this))

En debug ça donne :

Start Remote Connect
192.168.0.47 Remote secureConnect
192.168.0.47 Receive : {"remoteConfigure":{"code1":639}}
192.168.0.47 Bytes : 5,10,3,8,255,4
Create Remote {"remoteConfigure":{"code1":622,"deviceInfo":{"unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}
DEBUG payload =>  {
  remoteConfigure: {
    code1: 622,
    deviceInfo: {
      model: undefined,
      vendor: undefined,
      unknown1: 1,
      unknown2: '1',
      packageName: 'androitv-remote',
      appVersion: '1.0.0'
    }
  }
}
DEBUG message =>  RemoteMessage {
  remoteConfigure: {
    code1: 622,
    deviceInfo: {
      model: undefined,
      vendor: undefined,
      unknown1: 1,
      unknown2: '1',
      packageName: 'androitv-remote',
      appVersion: '1.0.0'
    }
  }
}
DEBUG array of bytes =>  <Buffer 24 0a 22 08 ee 04 12 1d 18 01 22 01 31 2a 0f 61 6e 64 72 6f 69 74 76 2d 72 65 6d 6f 74 65 32 05 31 2e 30 2e 30>
Sending {"remoteConfigure":{"code1":622,"deviceInfo":{"unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}
Create Remote {"remoteKeyInject":{"keyCode":91,"direction":3}}
DEBUG payload =>  { remoteKeyInject: { keyCode: 91, direction: 3 } }
DEBUG message =>  RemoteMessage { remoteKeyInject: { keyCode: 91, direction: 3 } }
DEBUG array of bytes =>  <Buffer 06 52 04 08 5b 10 03>
Sending {"remoteKeyInject":{"keyCode":"KEYCODE_MUTE","direction":"SHORT"}}
192.168.0.47 Receive : {"remoteError":{"value":true,"message":{"remoteKeyInject":{"keyCode":"KEYCODE_MUTE","direction":"SHORT"}}}}
192.168.0.47 Bytes : 12,26,10,8,2,18,6,82,4,8,91,16,3

J'ai vu que tu as fait une màj aujourd'hui (v1.0.6) donc j'ai mis à jour et j'ai utilisé le fichier example.js mais maintenant j'obtiens:

Start Remote Connect
Error: error:0680009B:asn1 encoding routines::too long
    at node:internal/tls/secure-context:65:13
    at Array.forEach (<anonymous>)
    at setCerts (node:internal/tls/secure-context:63:3)
    at configSecureContext (node:internal/tls/secure-context:152:5)
    at Object.createSecureContext (node:_tls_common:116:3)
    at Object.connect (node:_tls_wrap:1621:48)
    at D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:48:37
    at new Promise (<anonymous>)
    at D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:39:14
    at Generator.next (<anonymous>) {
  opensslErrorStack: [
    'error:0488000D:PEM routines::ASN1 lib',
    'error:0688010A:asn1 encoding routines::nested asn1 error',
    'error:06800066:asn1 encoding routines::bad object header'
  ],
  library: 'asn1 encoding routines',
  reason: 'too long',
  code: 'ERR_OSSL_ASN1_TOO_LONG'
}
D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:148
      _this2.client.destroy();
                    ^

TypeError: Cannot read properties of undefined (reading 'destroy')
    at D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:148:21
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:22:103)
    at _next (D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:24:194)
    at D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:24:364
    at new Promise (<anonymous>)
    at D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:24:97
    at RemoteManager.stop (D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\remote\RemoteManager.js:149:7)
    at AndroidRemote.stop (D:\experiments\android_pop\js\node_modules\androidtv-remote\dist\index.js:102:24)
    at file:///D:/experiments/android_pop/js/example.js:106:15

Une idée du problème ?

Je continue à bidouiller pour essayer de comprendre ce qu'il se passe…

Merci

Connection times out on tv shutoff

Hey,

Is there something I'm missing or something I need to turn on so the connection doesn't close and time out when I turn off the TV. I'm not able to turn on the TV via this protocol.

Android TV Message Send Help

@louis49
I have been able to do a successful SSL Handshake from Android to Android TV. Next thing is that I need to send message via SSL Socket.

Can anyone help me in that?
In NodeJS Version it is done through proto.
How to do it in Android. Can u share some insights.

Running issue with React-Native

@louis49
Thanks for the help. Can u help how to make it run in react-native.
It throws node-forge (unable to resolve module) error in react-native.

Can u help how to make it work in react-native

send more data to TV with the app deep link

Hi
I am trying to analyze how I can send extra data with the appLink message.
So currently the RemoteAppLinkLaunchRequest has only one field which is the app_link.
but what if I want to send more data with that request? what if I want to add "extra" params?
is it possible?

Losing connection when entering in the search tab

Hello

I'm having "Remote connection closed" errors whenever I navigate to the search tab in the laucher screen.
I tried this with Nvidia Shield and Google Chromecast so I think it's an issue with all android devices.

Did you get this error too?

open apps drawer on tv

hi,

I'm trying to figure out how to open the apps drawer on the tv.
what keycode should it be?
because I tried 284 (KEYCODE_ALL_APPS) and it didn't work
It is the behavior of pressing the 9-dot button on the remote.

image

SEND KEY

@louis49
How to send UP DOWN LEFT RIGHTS in sendKey. Can u please tell.
androidRemote.sendKey(RemoteKeyCode.UP, RemoteDirection.SHORT) is not workinng

Remote installation of app?

Do you know if there is any way to remotely install a new app via this protocol? Would be very handy? Thanks for all your effort so far

Need Help

Hey @louis49

Really need ur help. I want to integrate Android TV Remote in Android and IOS App using React Native. I have given all my energy to it. Can u please help me guide how to achieve the same.

Any sort of guidance from u would be helpful.

Volume

Salut Louis,

Est-ce que le volume est retourné correctement pour la Freebox Pop (si c'est ce que tu as ?) ?

androidRemote.on('volume', function (volume){
      console.debug("Volume : " + volume.level + '/' + volume.maximum + " | Muted : " + volume.muted);
  });

Car quand je teste sur ma TV Android, j'obtiens "0/0" pour le volume actuel et maximum, et muted à false tout le temps. Mais comme le volume est géré par ma Freebox Révolution connecté au Home Cinema… c'est peut-être pour ça !

Question on generated certificates

Let me first start with a warm "Thank you" for this project!

Working great, but I need some guidance on reusing the certificate that is generated during the first pairing request.
You're stating: After first succeeded pairing, you can reuse generated certs with getCertificate() by sending it in constructor options.
Is the certificate stored somewhere already and if so, on what constructor-part should I add it?

Could you please elaborate on that one?

Ping message issue and resulted closed connection

I'm working on a Java implementation of this, but I'm encountering difficulties with the ping request.

It appears that the client responds with the count of received ping messages, but the server doesn't just reply with this value; instead, it closes the connection shortly after.

Would you be willing to share the payload, in bytes, that you use to respond to the ping request?

Setup Help - Hostname

Can anyone help me on How to get "hostname" & Cert, Basically I need to know how to pair

determine tv version

Hello
is there also a request that I can send to the tv before the connection process to determine tv tv protocol version? if it's v1 or v2?
thanks!

Key directoins

Hello

what is the difference when sending a key with a direction of START_LONG followed by END_LONG
and not send everything with just on event of SHORT direction?

wy would we preffer sometime doing two actions and send START_LONG followed by END_LONG and not just one action and send one SHORT?

thanks

ECONNREFUSED

I have got the error when try to connect to the androidtv. Could you please review this error:

Start Pairing Connect
192.168.2.112 Pairing connected
192.168.2.112 Pairing secure connected 
192.168.2.112 Pairing Connection closed false
Start Remote Connect
192.168.2.112 Error: connect ECONNREFUSED 192.168.2.112:6466
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
  errno: -61,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.2.112',
  port: 6466
}
192.168.2.112 Remote Connection closed  true
ECONNREFUSED
Start Remote Connect
192.168.2.112 Error: Client network socket disconnected before secure TLS connection was established
    at connResetException (node:internal/errors:691:14)
    at TLSSocket.onConnectEnd (node:_tls_wrap:1585:19)
    at TLSSocket.emit (node:events:402:35)
    at endReadableNT (node:internal/streams/readable:1343:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'ECONNRESET',
  path: undefined,
  host: '192.168.2.112',
  port: 6466,
  localAddress: undefined
}
192.168.2.112 Remote Connection closed  true
Unpaired
ECONNRESET

What's wrong there? Have any suggest to solve issue? Thank you so much!

Some keys not work

Hi, thanks for your great work, I'm trying to rewrite your lib using Swift and it works pretty well already, but I've met the problem, that some important keys just don't work, in example KEYCODE_TV_INPUT, it's very important key on controller and it's not work.

In your lib they don't work either, do you have any idea why it could happen? Just for doublecheck I've tested the same key using ADB, and input source screen appears.

How to send text

Does anyone have a clue how to send text to an Android TV?

I have decompiled an Android app and they seem to be using: ImeBatchEdit.

Need Help

@louis49

Is there a way to replace protobufjs in react native as it gives error in loading .proto file. Is there any alternative for it

get mac address

Hi there
is there a way to get the mac address after I am connected to the TV device or maybe during the connection process?

thanks!

Send text, analog adb command: "shell input text"

Hi.
When keyboard on tv is shown i send letters one by one using adb.framework command "shell input text [char]". And it works.
Now (with your framework) i'm trying
androidRemote.sendKey(keyCode, RemoteDirection.SHORT);
where keycodes for letters is:
A = 29,
B = 30,
C = 31,
D = 32,
E = 33,
F = 34

but it doesn't work

Maybe you can add some functions for sending text?

keyboard keys are not working

Hi

I am trying to make the keyboard keys to work. such as KEYCODE_A, KEYCODE_G etc but they are not working.
other keys are working fine.

do you know if I need to send them with some kind of a flag maybe?
thanks

Android TV (v2) 1st Configuration Message get error from TV

Hello

I have TCL tv (android TV) and when i try use your module - i get error.
`
node androidtv.js
AndroidRemote {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
host: '192.168.100.3',
cert: { key: undefined, cert: undefined },
pairing_port: 6467,
remote_port: 6466,
service_name: 'Service Name',
[Symbol(kCapture)]: false
}
Start Pairing Connect
192.168.100.3 Pairing connected
192.168.100.3 Pairing secure connected
Receive : 7,8,2,16,200,1,90,0
Receive : {"protocolVersion":2,"status":"STATUS_OK","pairingRequestAck":{}}
Receive : 16,8,2,16,200,1,162,1,8,18,4,8,3,16,6,24,1
Receive : {"protocolVersion":2,"status":"STATUS_OK","pairingOption":{"outputEncodings":[{"type":"ENCODING_TYPE_HEXADECIMAL","symbolLength":6}],"preferredRole":"ROLE_TYPE_INPUT"}}
Receive : 8,8,2,16,200,1,250,1,0
Receive : {"protocolVersion":2,"status":"STATUS_OK","pairingConfigurationAck":{}}
Code : 27247C
Sending code : 27247C
Receive : 42,8,2,16,200,1,202,2,34,10,32,39,7,176,213,140,50,218,19,169,117,107,145,104,201,253,128,23,229,48,225,186,231,47,115,69,76,245,211,205,53,162,96
Receive : {"protocolVersion":2,"status":"STATUS_OK","pairingSecretAck":{"secret":"Jwew1Ywy2hOpdWuRaMn9gBflMOG65y9zRUz10801omA="}}
192.168.100.3 Paired!
192.168.100.3 Pairing Connection closed false
Start Remote Connect
192.168.100.3 Remote secureConnect
true
192.168.100.3 Receive : {"remoteConfigure":{"code1":637,"deviceInfo":{"model":"Smart TV Pro","vendor":"TCL","unknown1":1,"unknown2":"11","packageName":"com.google.android.tv.remote.service","appVersion":"5.2.473254133"}}}
Create Remote {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"MacBookPro16,1","vendor":"Apple Inc.","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}
Sending {"remoteConfigure":{"code1":622,"deviceInfo":{"model":"MacBookPro16,1","vendor":"Apple Inc.","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}
192.168.100.3 Receive : {"remoteError":{"value":true,"message":{"remoteConfigure":{"code1":622,"deviceInfo":{"model":"MacBookPro16,1","vendor":"Apple Inc.","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}}}
node:events:508
throw err; // Unhandled 'error' event
^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
error: RemoteError {
value: true,
message: RemoteMessage { remoteConfigure: [RemoteConfigure] }
}
})
at new NodeError (node:internal/errors:405:5)
at RemoteManager.emit (node:events:506:17)
at TLSSocket. (/Users/hibiki/Documents/BitBucket/twillio_scripts/node_modules/androidtv-remote/dist/remote/RemoteManager.js:107:21)
at TLSSocket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {
code: 'ERR_UNHANDLED_ERROR',
context: {
error: RemoteError {
value: true,
message: RemoteMessage {
remoteConfigure: RemoteConfigure {
code1: 622,
deviceInfo: RemoteDeviceInfo {
model: 'MacBookPro16,1',
vendor: 'Apple Inc.',
unknown1: 1,
unknown2: '1',
packageName: 'androitv-remote',
appVersion: '1.0.0'
}
}
}
}
}
}

Node.js v18.19.0
`

Unhandled 'error' event in TLSSocket

This has been working well for me for quite some time, but today started seeing this error. This happens with the example code from README.md. This all worked perfectly previously but for some reason now fails.

Running on my Lenovo laptop (identified in some of this logging), after successful pairing and reconnect, the ready event is fired then this error appears on console output:

tv Receive : {"remoteError":{"value":true,"message":{"remoteConfigure":{"code1":622,"deviceInfo":{"model":"4286CTR","vendor":"LENOVO","unknown1":1,"unknown2":"1","packageName":"androitv-remote","appVersion":"1.0.0"}}}}}
node:events:504
    throw err; // Unhandled 'error' event
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
  error: RemoteError {
    value: true,
    message: RemoteMessage { remoteConfigure: [RemoteConfigure] }
  }
})
    at new NodeError (node:internal/errors:387:5)
    at RemoteManager.emit (node:events:502:17)
    at TLSSocket.<anonymous> (/home/raintonr/node_modules/androidtv-remote/dist/remote/RemoteManager.js:107:21)
    at TLSSocket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 'ERR_UNHANDLED_ERROR',
  context: {
    error: RemoteError {
      value: true,
      message: RemoteMessage {
        remoteConfigure: RemoteConfigure {
          code1: 622,
          deviceInfo: RemoteDeviceInfo {
            model: '4286CTR',
            vendor: 'LENOVO',
            unknown1: 1,
            unknown2: '1',
            packageName: 'androitv-remote',
            appVersion: '1.0.0'
          }
        }
      }
    }
  }
}

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.