Open macharborguy opened 2 years ago
Just as a follow up, i ran the same code on my Raspberry Pi 4B, and i received a different error. Still a connection error to 192.168.1.2, but this time the following...
node:events:368
throw er; // Unhandled 'error' event
^
Error: connect EHOSTUNREACH 192.168.1.2:8060
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)
Emitted 'error' event on ClientRequest instance at:
at Socket.socketErrorListener (node:_http_client:447:9)
at Socket.emit (node:events:390:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -113,
code: 'EHOSTUNREACH',
syscall: 'connect',
address: '192.168.1.2',
port: 8060
}
Having the same issue, when a chromecast disconnects for any reason and I try to send a play command, I get this error after a while. Is there any way to catch this error? try/catch around play is not working in my that case.
Cheers
Anyone ever find a solution to this issue to prevent the app from blowing up?
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.
here is the code for my script. Like I said, super simple...
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