-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'send' of null #36
Comments
@linchen4000 Is the log from you trying to play something after hitting the problem? If so what is the status of the adapter (content of chromecast.0..status ? The adapter should restart automatically after hitting an exception - if this is not the case I would need to fix that. |
Yes the log was after I tried to play something and it didn't work. I reinstalled the hole adapter after having this problem more often. But after that so far the error has not yet occured again. |
Okay, now it occurred again:
And the adapter is still alive and did not restart.
|
I'm experiencing something very similar |
I think I resolved it by restarting the adapter daily in the night with a CRON job. |
Sadly the issue appears multiple times per day sometimes even per hour. So I don't think I can work around it using a cron job. |
I am using this adapter to output speech from sayit and also the 'bongs' from our doorbell (just a nice MP3 file) and have been trying to debug this issue with...
Looks like One can start the adapter and request playback of any number of items so long as they are withing a short period of each other. However, after some time with no playback the above I notice it's just over 1 minute between the last playback and the connection closed message. Something else odd when looking at the debug logs is that the heartbeat messages all look fine (ie. one 'PING' followed by a 'PONG' for each device detected) until at some point they start being duplicated (ie. two sets of 'PING' followed by a 'PONG' for each device detected!). This duplication always seems to happen some time between the last successful playback and the failure which appears rather suspicious. BTW, my stack trace looks like this just to confirm it's the same one we're talking about:
|
So the problem is that the closed connection from the underlying castv2 module is not passed up as expected to the castv2-client and therefore is not triggering a reconnect here: A fix is discussed here: thibauts/node-castv2-client#58 (comment), and indeed changing the line in persistentClient.js from... //If connection closes afterwards then re-open it again
that._client.once("close", function(){
that._close();
that._connectClient();
}); ...to... //If connection closes afterwards then re-open it again
that._client.client.once("close", function(){
that._close();
that._connectClient();
}); ... works perfectly. Or at least for me. I will create an issue in that module and reference everything there. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. Please open a new issue if still relevant and make sure to include all relevant details, logs and reproduction steps. Thank you for your contributions. |
After a frew requests for chromecast text to speech triggers over the sayit plugin, there is an error with the chromecast instance. When I restart the instance, the problem is gone. But it's very annoying that the error is always, when I have more than a few requests in a short time and the chromecast did not play any playlists anymore...
The text was updated successfully, but these errors were encountered: