[RELEASE] cast-web v1.2.1 - Chromecast Integration (EDGE Driver discussion begins in post 1668)

When I try to install casp-web-api-cli, i keep getting this in the log.
Since these mention grpc, I did the --unsafe-perm for the install. Nothing changed.

node /usr/local/lib/node_modules/cast-web-api-cli/node_modules/cast-web-api/api.js: symbol lookup error: /usr/local/lib/node_modules/cast-web-api-cli/node_modules/grpc/src/node/extension_binary/node-v108-linux-x64-glibc/grpc_node.node: undefined symbol: __wrap_memcpy

What OS are you on? I’m wondering if you are missing a required Node library.

thanks. Fedora 38

npm WARN deprecated source-map-url@0.4.1: See GitHub - lydell/source-map-url: [DEPRECATED] Tools for working with sourceMappingURL comments.

npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.

npm WARN deprecated source-map-resolve@0.5.3: See GitHub - lydell/source-map-resolve: [DEPRECATED] Resolve the source map and/or sources for a generated file.

npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies

npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (ReDos Vulnerability Regression Visibility Notice · Issue #797 · debug-js/debug · GitHub)

npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.

npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410

npm WARN deprecated grpc@1.24.11: This library will not receive further updates other than security fixes. We recommend using @grpc/grpc-js instead.

added 623 packages in 3m

Hi @TAustin, thanks, yes i looked at the installation instructions, but i do not know how to install the package with synology. is there some basic guidelines to install this in synology? do i need to create a docker etc. i am not familar with the installation in synology… thanks

1 Like

@Tin_Hwee_Wang I am successfully using this docker container for cast-web-api. I’m not running it on synology, but I imagine you could get it to work there.

2 Likes

A quick google search brought me to this thread: Can't install using pip on ubuntu 19.04 · Issue #22645 · grpc/grpc · GitHub

Seems to be related to a compiler option issue with grpc. You might try upgrading to Fedora 39 if you can to see if it fixes it.

Hopefully @Hoodah77 's reply is helpful to you, as I don’t know anything about a Synology box or what implications that may have on installing the cast-web-api app.

1 Like

@Hoodah77, @TAustin , thanks that is helpful, will try to figure out how to install it with the above. appreciated.

1 Like

@Hoodah77 and @TAustin , thanks, everything works perfect. i am able to run this on the synology docker

3 Likes

nice, does it detect your cast devices?

@Gokul_Gopakumar yes it did detect all of it

1 Like

Hi all, is there a new driver that supports casting a youtube video to a google cast device based on a routine action?

Some issues resolved but struggling with this issue now, from the logs
Related to google-tts.js

I was getting this:

playMedia: [{"mediaTitle":"TESTING","mediaType":"audio/mp3","mediaImageUrl":"https://lh3.googleusercontent.com/nQBLtHKqZycERjdjMGulMLMLDoPXnrZKYoJ8ijaVs8tDD6cypInQRtxgngk9SAXHkA=w300","mediaStreamType":"BUFFERED","mediaSubtitle":"SmartThings notification","googleTTS":"en-US"}]
2023-12-02T02:33:27.877Z **this.splitGoogleTTS(): googleTTS error: Error: get key failed from google**

after installing the google-tts.js @latest, then replacing the file as specified in lib/device/id mentioned a several posts above https://github.com/toddaustin07/googlecast/blob/main/google-tts.js

I get this error now:

groupsUp: {"id":"2881ce78292e6b54b66d6fa70658e257","groups":["6a1e7972-5a22-4af5-b372-81984ed94f07"]}new status: {"groupPlayback":{"on":false,"from":"6a1e7972-5a22-4af5-b372-81984ed94f07"},"application":"","status":"","title":"","subtitle":"","image":""}
playMedia: [{"mediaTitle":"TESTING","mediaType":"audio/mp3","mediaImageUrl":"https://lh3.googleusercontent.com/nQBLtHKqZycERjdjMGulMLMLDoPXnrZKYoJ8ijaVs8tDD6cypInQRtxgngk9SAXHkA=w300","mediaStreamType":"BUFFERED","mediaSubtitle":"SmartThings notification","googleTTS":"en-US"}]
this.splitGoogleTTS(): googleTTS error: **TypeError: googleTTS.getAudioUrl is not a function**

Doing it directly from SmartThings this works:
playMedia: [{"mediaTitle":"SmartThings","mediaType":"audio/mp3","mediaImageUrl":"https://lh3.googleusercontent.com/nQBLtHKqZycERjdjMGulMLMLDoPXnrZKYoJ8ijaVs8tDD6cypInQRtxgngk9SAXHkA=w300","mediaStreamType":"BUFFERED","mediaUrl":"https://audionotification-na04.smartthings.com/once/ec2cc661-b646-4c52-8535-4b2431d40f99.dbf36981-e016-4c7e-96f8-9ac585eb99cc.mp3","mediaSubtitle":"Notification"}]

Hi @TAustin 2 of my cast devices got disconnected, any idea how to troubleshoot this? Rest is ok

What version of google-tts-api do you have? I’m running 2.0.2, I so haven’t tested anything more recent then that.

Also, also did you mean doing it directly from SmartThings works? And how were you testing it when you got the error?

2.02
Working from Smarthings as in an If < Condition > " then “Play message on speaker”.
I get the error via SharpTools, an action that does “speak”.

Sorry, I can’t help you there.

You might also try it using the advanced app.

I would say try to unplug those devices, count to 10, then plug back in.

If this is something that happens frequently, we should try to get some driver logs to diagnose why it’s happening and why they aren’t getting reconnected.

Some further thoughts on your issue:

Using the ‘Play message on speaker’ from a SmartThings routine doesn’t actually use the Google TTS function - rather the TTS is done by SmartThings and then the audio file sent to the speaker to be played.

To replicate within SmartThings routine what you are problably doing from SharpTools, is to use the ‘Speech Synthesis’ action within the device. So in the ‘Then’ part of your routine, select the speaker device and then ‘Speech Synthesis’ from the list of actions, enable it, then type in the text you want. This text WILL be sent to Google TTS.

That will probably fail just as your SharpTools routine did, since there appears to be something wrong in your cast-web-api installation. From the log errors you posted, it appears that it is not finding the Google TTS module in your application path. Make sure you have a child directory structure something like this (yours may be under a different parent directory like /usr/lib, depending on how you installed cast-web-api):

~/.npm-global/lib/node_modules/cast-web-api-cli/node_modules/cast-web-api/node_modules/google-tts-api

Note how there are nested levels of node modules that must exist under your cast-web-api cli app. Make sure the dist subdirectory under google-tts-api contains a file called getAudioURL.js, among others. And be sure that when you start up cast-web-api, that it has access to these sub directories as part of its working directory.

Not sure what OS you are running cast-web-api under, but if it is Linux-based, be sure you followed the command line instructions under Mac OS for installing.

If you’re running in a Windows environment, maybe someone here can share their directory structure.

If you can’t get this to work, then see if SharpTools allows you to specify the equivalent of SmartThing’s ‘Play message on speaker’, which will bypass Google TTS and use SmartThings TTS.

@TAustin , thanks. yes, only 2 devices happened frequently , disconnected, the rest got disconnected but connect within a minute back on its on. the 2 devices that went disconnected is my google nest hub and upon restart of the server, it went back online, but got disconnected, connecting, connected repeatedly until it stop and show disconnected.
can i check what is the max. devices to connect?

my log below show several errors