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

id like to link it to git hub could you provide the address, ive tryed navagating but cant get to your git hub repostorys, just the info pages and the raw

UPDATE
I had the Google Assistant Relay device still installed. Once I removed that from the ST app the new devices installed perfectly.

I had Google Assistant Relay installed. I tried uninstalling Node JS and all the associated folders, reinstalled and I am getting the same error.

For the device handlers and smartapp? They should all be here: https://github.com/vervallsweg/smartthing

So it is working now? Interesting, didnā€™t know that assistant relay also needs to parse packages on lan. Thought that was more of a one way affair :joy:

Its working great! I have it playing sound clips from simpsons when my kids activate things. As soon as I removed the Google Assistant Relay app it worked.

1 Like

So I am a bit confused on the play track and resume /Speak text and resume. Is this supposed to continue whatever was playing on the GH prior to the message? I have a door chime setup through webcore and it stops the music playing from Google Play Music, sounds the chime from an mp3 file then nothing. Is this expected? Is there a way to continue playing the music?

It will only resume presets!

Yes and yes only if itā€™s a preset.

Im struggling creating presets, could you give some working examples eg BBC news, rockfm.

Hey. Thanks for creating this programā€¦I got it all set up to the point that I just have to put in the presets.i have tried numerous links and each time I only get the default chrome sound. Any tips? Any sample links you can share?
Thanks

Also, im still strugling with a NAS drive i can creat a url (ftp) which works in my browser, but when i try to cast in smartthing it statrs the process (spining cirle) but then just swithcs to a casting icon on the TV
presetObject: {"preset1":{"mediaTitle":"Greatest showman","mediaSubtitle":"Celebrates the birth of show business, and tells of a visionary who rose from nothing to create a spectacle that became a worldwide sensation","mediaType":"video/mp4","mediaUrl":"ftp://192.168.0.22/Public/Videos/kids/Greatest_Showman_2017-PG.mp4","mediaStreamType":"BUFFERED","mediaImageUrl":"https://upload.wikimedia.org/wikipedia/en/1/10/The_Greatest_Showman_poster.png"},"preset2":{"mediaTitle":"

HTTP! NOTHING ELSE!

Http didnā€™t work thats why Iā€™m trying.other things

Then itā€™s a different problem. Post the preset object with http:// urls here.

This one with http urls didnā€™t work?
Post here with the http urls and Iā€™ll try to fix it.

http://192.168.0.22/Public/Videos/kids/Greatest_Showman_2017-PG.mp4

{ā€œpreset1ā€:{ā€œmediaTitleā€:ā€œGreatest showmanā€,ā€œmediaSubtitleā€:ā€œCelebrates the birth of show business, and tells of a visionary who rose from nothing to create a spectacle that became a worldwide sensationā€,ā€œmediaTypeā€:ā€œvideo/mp4ā€,ā€œmediaUrlā€:ā€œhttp://192.168.0.22/Public/Videos/kids/Greatest_Showman_2017-PG.mp4",ā€œmediaStreamTypeā€:ā€œBUFFEREDā€,ā€œmediaImageUrlā€:ā€œhttps://upload.wikimedia.org/wikipedia/en/1/10/The_Greatest_Showman_poster.pngā€},ā€œpreset2ā€:{ā€œmediaTitleā€:"Preset 2ā€,ā€œmediaSubtitleā€:"",ā€œmediaTypeā€:"",ā€œmediaUrlā€:"",ā€œmediaStreamTypeā€:"",ā€œmediaImageUrlā€:""},ā€œpreset3ā€:{ā€œmediaTitleā€:ā€œPreset 3ā€,ā€œmediaSubtitleā€:"",ā€œmediaTypeā€:"",ā€œmediaUrlā€:"",ā€œmediaStreamTypeā€:"",ā€œmediaImageUrlā€:""},ā€œpreset4ā€:{ā€œmediaTitleā€:ā€œPreset 4ā€,ā€œmediaSubtitleā€:"",ā€œmediaTypeā€:"",ā€œmediaUrlā€:"",ā€œmediaStreamTypeā€:"",ā€œmediaImageUrlā€:""},ā€œpreset5ā€:{ā€œmediaTitleā€:ā€œPreset 5ā€,ā€œmediaSubtitleā€:"",ā€œmediaTypeā€:"",ā€œmediaUrlā€:"",ā€œmediaStreamTypeā€:"",ā€œmediaImageUrlā€:""},ā€œpreset6ā€:{ā€œmediaTitleā€:ā€œPreset 6ā€,ā€œmediaSubtitleā€:"",ā€œmediaTypeā€:"",ā€œmediaUrlā€:"",ā€œmediaStreamTypeā€:"",ā€œmediaImageUrlā€:""}}

@vervallsweg, thanks for providing this update. I have a few questions/issues when installing the new version.

Previously, I edited casWebApi.js to put in my specific IP address and specified port 8075. I did this on the new version, but when I run ā€˜cast-web-apiā€™ it says itā€™s running off port 3000 (which I know is the default).

Also, I installed Forever, but when I run ā€˜forever start castWebApi.jsā€™ it starts up but I donā€™t think itā€™s working because it stops and doesnā€™t pull up on ā€˜forever listā€™.

Last question, can you be a bit more specific in your GitHub directions on how to make it run at start/reboot? I previously added a file to my ā€˜init.dā€™ folder to auto run casWebApi.js, but this doesnā€™t seem to work now using the command ā€˜cast-web-apiā€™.

Any help is very much appreciated!

Also, when i just try to run ā€˜node castWebApi.jsā€™ I get the following Error: Cannot find module ā€˜castv2ā€™. Any idea whatā€™s causing this?

Again, Iā€™m a somewhat newbie but have been using your prior version for a while. Before, I would just run ā€˜node castWebApi.jsā€™ to get the service up and running and I had it start at boot/reboot. Now, to get it working and communicating properly in SmartThings, I have to manually run ā€˜cast-web-apiā€™; however, it seems to stop after a while.

Again, any help is very much appreciated.

You can set hostname and or port with the corresponding params, see here.

Yes thatā€™s probably caused by your missing dependencyā€¦

ā€¦ here. How have you installed cast-web-api through GitHub then npm install, or npm install cast-web-api -g?
Maybe try installing it by following the tutorial? Thereā€™s even a video available now. Because there shouldnā€™t be any missing dependencies, npm takes care of that, thatā€™s itā€™s job.
If the instructions donā€™t clear things up, let me know how you installed it and weā€™ll go from there.

Weā€™ll get there as soon as you got the api itself running :wink:

Thanks for the additional color!

  • I understand about setting the hostname and port with the link you provided. But I previously edited casWebApi.js so when it would start at boot it started using the IP and port specified in the casWebApi.js file.

  • I deleted everything on my RPi, and then did the following. Created a new ā€œcast-web-apiā€ folder. Within that folder I installed ā€œsudo npm install cast-web-api -gā€. It seems to work, but I am not sure where itā€™s unpacking and saving any filesā€¦I then run ā€œcast-web-apiā€ and it starts up using port 3000.
    (For reference, to install the old version I copied everything from GitHub into a folder on my RPi, modified the castWebApi.js, and then installed everything from that folder location. Then installed forever and set up my file in init.d so it would start at boot. It worked flawlessly, but Iā€™d like to take advantage of this new version.)

  • I then reinstalled ā€œsudo npm install forever -gā€. But when I enter ā€œforever start ā€˜which cast-web-apiā€™ā€ it says it doesnā€™t exist.

Well, I decided to retry once more but this time old schoolā€¦or the only way I know howā€¦and it works!

Hereā€™s what I did to install it on my RPi and get it to always run at boot:

  • created a new folder ā€œcast-web-apiā€
  • Navigate to the folder: $ cd ~/cast-web-api
  • $ git clone https://github.com/vervallsweg/cast-web-api.git
  • I then replaced the IP and Port in castWebApi.js with what I wanted
  • npm install
  • npm install forever -g
  • node castWebApi.js , and itā€™s up and running!

Now to get it to run at boot

  • $ cd /etc/init.d
  • sudo nano CastService , and then I copied the following contents and saved the file

#!/bin/sh
#/etc/init.d/CastService
export PATH=$PATH:/home/pi/cast-web-api
export NODE_PATH=$NODE_PATH:/home/pi/cast-web-api/node_modules
### BEGIN INIT INFO
# Provides: CastService
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Google Cast Service
### END INIT INFO
case ā€œ$1ā€ in
start)
exec forever --sourceDir=/home/pi/cast-web-api -p /home/pi/cast-web-api castWebApi.js #scriptarguments
;;
stop)
exec forever stop --sourceDir=/home/pi/cast-web-api castWebApi.js
;;
*)
echo ā€œUsage: /etc/init.d/CastService {start|stop}ā€
exit 1
;;
esac
exit 0

Then I executed the following commands

  • $ sudo chmod 755 /etc/init.d/CastService
  • $ sudo sh /etc/init.d/CastService start/stop
  • $ sudo update-rc.d CastService defaults

I updated this app and devices this afternoon because it had suddenly stopped working - now I am finding that it is absorbing messages from the Pi that the server component is running on, that is not meant for this API.

Anyone have any thoughts on what I need to change to allow the request to go to the next App, etc?