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

Port 3000 is in use by some other app. Use a different port.

So I was able to progress to the point where the smartapp API connection test is okay and it starts to discover devices. I’ve been able to add 3 of my google homes, my nvidia shield, but it’s not seeing 1 google home (kitchen) and my chromecast audio no matter what i try. When I try and add more devices. It says “error saving unnamed page. Please contact smartapp developer.”

I am having some issues as well. I got the nodejs script running and control from a web browser works fine, the smartapps are installed and published, I can pass the api connection test, but once I select a few discover devices and click next I get a white page, if I click save I get: Error - bad state. Unable to complete page configuration.

I have everthing setup The one thing i can get going is the presets
I am a local box streaming content but when i edit the presets and add them to the speakers none of them work. This is the url to the stream http://192.168.10.122:5000/stream.m3u
On the streamin server i dont even see it trying to load the stream

I am in the same boat. Cannot get the presets to work. Infact when I copy some value into the app, it overwrites it with blank value. Is there any way to configure these presets from https://account.smartthings.com/?redirect=https%3A%2F%2Fgraph.api.smartthings.com%2Fide%2Fdevices?

Did you get this sorted out? If no MSG me. Even I am using Termux and got the node JS working . I can stream contents to chrome cast from browser but no luck with presets so far

Since presets aren’t working for me, wanted to check if I can cast using webcore. However I encounter issue saying URI is invalid even though browser can open the URI perfectly fine. Any pointers?

Invalid URI for web request: http://10.0.0.14:3000/setMediaPlayback?address=10.0.0.10&mediaType=audio/mp3&mediaUrl=http://37.251.146.169:8300/stream;.mp3&mediaImageUrl=https://lh3.googleusercontent.com/WxW9gmuOJGPLdI33C4RpfBC5zXJbwcm_-chXRTQVcrhGHP0od4_-F_mqAgjytDf2-22889WG7uDXSw=w404-h402-rw-no&mediaStreamType=newstream&mediaTitle=hellohi&mediaSubtitle=hello
+130ms ║║Error executing virtual command [].httpRequest: (2ms) org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘false’ with class ‘java.lang.Boolean’ to class ‘long’

I’m still struggling to get this working. I bypassed the port 3000 and set it to 8080. Discovery doesn’t find any devices and the test API connection now fails http response code: 500. Node.js looks like this:

C:\Users\joshu\Desktop\cast-web-api-master>node C:\Users\joshu\Desktop\cast-web-api-master\castwebapi.js --hostname=10.0.0.135 --port=8080
Server running at http://10.0.0.135:8080/
Request to: /getDeviceStatus?address=10.0.0.20:8009
Request to: /getDeviceStatus?address=10.0.0.28:8009
Exception caught: TypeError: Cannot read property ‘send’ of undefined
Request to: /getDevices
Request to: /getDevices
Request to: /getDevices
Request to: /getDeviceStatus?address=10.0.0.11:42830
Request to: /getDevices
Request to: /getDevices

Any help would be greatly appreciated

@vervallsweg

thanks for this, I have installed it on my Pi in no time and the github repo integration makes things even easier, I am using this DTH with Big Talker and it can replace my VLC thing running on my Pi, I have a new google home mini around but don’t want to plug a speaker to my Pi and it is just perfect, the only thing sadly echo/dot/show cannot do this, another reason for the GH mini :wink:

3 Likes

Very good job its working for me, i had to change the port to 8000 because 8080 was already taken en then it worked for me.
Didn’t tried the presets.
Keep up the good work!!

1 Like

@vervallsweg Outside of the DTH, can I trigger a preset station to play to a specific google cast device or group via URL query?

I found this on cast-web-api protocol usage notes:

setMediaPlayback (address, mediaType, mediaUrl, mediaStreamType, mediaTitle, mediaSubtitle, mediaImageUrl)
Returns MEDIA_STATUS,

So for example: ​
Cast device: 192.168.1.150:8009 (“Living room”)
Preset URL:
"preset1":{"mediaTitle":"Toker.FM","mediaSubtitle":"מוסיקה יהודית 24 שעות ביממה","mediaType":"audio/mp3","mediaUrl":"http://178.33.191.197:6062/;stream/1","mediaStreamType":"LIVE","mediaImageUrl":"https://lh3.googleusercontent.com/376_3cAV4fQWxOT2i0xVKBCpRb3Ju-BFQPnd5rnGHSHIy7ddFkX_oQBq2DD1B9mfwWk=w300"

Would translate to:

http://192.168.1.150:8009/setMediaPlayback?address=“http://178.33.191.197:6062/;stream/1”&mediaType=“audio/mp3”&mediaUrl={mediaUrl}&mediaStreamType=“LIVE”&mediaTitle=“Toker.FM”&mediaSubtitle=“מוסיקה יהודית 24 שעות ביממה”&mediaImageUrl=“https://lh3.googleusercontent.com/376_3cAV4fQWxOT2i0xVKBCpRb3Ju-BFQPnd5rnGHSHIy7ddFkX_oQBq2DD1B9mfwWk=w300

Does this seem correct to you? Is there any way to send one URL that first sets the volume & then sends the preset playback?

Does anyone have an easy to follow set of instructions for someone who’s not a computer programmer. You know, I know more than the average Joe about computers but you people have made me feel like a caveman. I have spent literally days trying to get all this working but unless someone has a more simple way I think I’m going to give up. Is anyone else frustrated that no one seems capable of providing any instructions for the complicated parts of this process but every single button stroke for the SmartThings IDE?!? If we didn’t know how to use that, do you think we’d be on this forum? I mean really.

1 Like

Doesn’t work in raspbian.

I don’t need to do anything extra while following the procedure in raspian

How can you say that? That procedure doesn’t include this:

npm install castv2 castv2-client mdns debug http url minimist

You didn’t have to run that step? The only things you had to do were clone the repo and npm install? When you ran that, you didn’t receive an error when running installing mdns?

npm ERR! mdns@2.3.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mdns@2.3.4 install script.
npm ERR! This is most likely a problem with the mdns package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls mdns
npm ERR! There is likely additional logging output above.

Yes I don’t need that step, what is the node.js version you are running? node -v
I am running v6.11.5
Did you do
"cd cast-web-api" before running “npm install”? If it is successful a node_modules directory will be created with the above mentioned libraries

1 Like

IT’S A CHRISTMAS MIRACLE!!!

Thank you!! The version I was running was 4.8.2. Updated to the latest version and it is working now. Halajellulah!!!:grin:

2 Likes

I am still unable to get past this issue of the blank screen then Error - bad state. Is there anyone able to help? I see the request to /getDevices but nothing ever happens after I select my cast devices. I would really love to see this work.

Running on Pi 3:
git show=
commit cebaffa74a572140562dbd24f2570232cf76e226
Merge: 6aee209 9408f50
Author: Tobias H vervallsweg@users.noreply.github.com
Date: Sun Sep 24 16:31:48 2017 +0200
Merge pull request #45 from vervallsweg/v0.2.2
Version bump #43 #44
node -v =
v8.9.3

I ran into a similar problem. If you run with node version 6.11.5 I think that might solve some of your problem. If you’re on an RPI 3, you can get the update by following these steps.

1. wget https://nodejs.org/dist/v6.11.5/node-v6.11.5-linux-armv7l.tar.gz

2. tar -xzf node-v6.11.5-linux-armv7l.tar.gz

3. cd node-v6.11.5-linux-armv7l/

4. sudo cp -R * /usr/local/

That was the only way I was able to get everything working. Now I’m just having trouble getting it to autostart.

Did you get this working? With that version of node (argon) I wasn’t able to get it to work either. Had to update to boron (v6.11.5). There is info on all of the distros of node here:
http://nodejs.org/en/download/