-
Notifications
You must be signed in to change notification settings - Fork 48
Description
I have a barebones script based off of the example code in the README, a simple listener on the client that listens for the device event, and a console.log that prints out the resulting device objects.
After a few moments, i receive an Unhandled Error event showing a timeout while waiting for a response from 192.168.1.2.
After checking my NetGear Nighthawk router's connected devices screen, it shows that there is no device on that IP address. There is also no events available for me to listen for and handle this event, and the app simply crashes.
events.js:353
throw er; // Unhandled 'error' event
^
Error: connect ETIMEDOUT 192.168.1.2:8060
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
Emitted 'error' event on ClientRequest instance at:
at Socket.socketErrorListener (_http_client.js:475:9)
at Socket.emit (events.js:376:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4039,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '192.168.1.2',
port: 8060
}
here is the code for my script. Like I said, super simple...
const ChromecastAPI = require('chromecast-api')
const Client = new ChromecastAPI()
Client.on('device',(device)=>{
console.log('device ', device)
})
Before the error is emitted and the app crashes, it does fine all of the Chromecasts, Nest Hubs and Cast Groups on my network. The app just doesnt run long enough for me to really do anything