LoadUri is not working
Hi, i try to load an URI and get this message: (The file setUriMetadata.template exisits in the directory "C:\Peter\Install\node_modules\node-raumkernel\lib", but not in the directory "C:\Peter\Install\node_modules\node-raumserver\node_modules\node-raumkernel\lib")
{ requestUrl : "/raumserver/controller/loadUri?id=WohnzimmerL&value=http%3A%2F%2Fschwarze-welle.de:7500&_=1510051244642", action : "loadUri", error : true, msg : "Action was rejected", data : { errorMessage : "Error: ENOENT: no such file or directory, open 'C:\Peter\Install\node_modules\node-raumserver\node_modules\node-raumkernel\lib\setUriMetadata.template'", errorData : null } }
Here is the callstack:
verbose: [Raumserver] Request received: GET /raumserver/controller/loadUri?id=WohnzimmerL&value=http%3A%2F%2Fschwarze-welle.de:7500&=1510051244651
debug: [Raumserver] Request to raumserver recognized: /raumserver/controller/loadUri?id=WohnzimmerL&value=http%3A%2F%2Fschwarze-welle.de:7500&=1510051244651
debug: [Raumserver] Handle action 'loadUri' with query: {"_":"1510051244651","id":"WohnzimmerL","value":"http://schwarze-welle.de:7500"}
debug: [DeviceManager] Trying to get virtual media renderer for id or (child)name : WohnzimmerL
debug: [DeviceManager] Trying to get media renderer for id name : WohnzimmerL
debug: [ZoneManager] Get room information object for: uuid:b8ef0730-b7a9-4d02-abca-4c42bac78b0b
debug: [DeviceManager] Media renderer for id : WohnzimmerL found
debug: [Request.loadUri] Calling action 'loadUri' for renderer WohnzimmerL,Bad,Esszimmer,Connector2 ,Schlafzimmer
error: [Request.loadUri] Exception thrown: Error: ENOENT: no such file or directory, open 'C:\Peter\Install\node_modules\node-raumserver\node_modules\node-raumkernel\lib\setUriMetadata.template'
at Object.fs.openSync (fs.js:638:18)
at Object.fs.readFileSync (fs.js:540:33)
at UPNPMediaRendererRaumfeldVirtual.loadUri (C:\Peter\Install\node_modules\node-raumkernel\lib\lib.device.upnp.mediaRenderer.raumfeldVirtual.js:540:23)
at Request_LoadUri.runAction (C:\Peter\Install\node_modules\node-raumserver\lib\requestHandlers\lib.request.loadUri.js:22:31)
at C:\Peter\Install\node_modules\node-raumserver\lib\lib.base.requestMediaRenderer.js:191:22
at Promise (
Problem solved: i copied the node-raumkernel directory completly to C:\Peter\Install\node_modules\node-raumserver\node_modules\
After that, LoadUri is working
Is it possible to play a specific track on Spotfy via loadUri? If yes, what is the procedure for that?
I'm sorry, i do not have spotify so i cant help Maybe you may set the internal container id, but i am not sure how spotify interacts with rf
hello,
it is the same problem on unix:
{
requestUrl : "/raumserver/controller/loadUri?id=kueche&value=http://192.168.249.1:9120/oe3.mp3&_=1513843129651",
action : "loadUri",
error : true,
msg : "Action was rejected",
data : {
errorMessage : "Error: ENOENT: no such file or directory, open 'node_modules/node-raumkernel/lib/setUriMetadata.template'",
errorData : null
}
}
best regards holli
hello,
i did a new npm install in a fresh directory and all is fine - maybe this is an issue only if you clone the repo...
best regards holli
Hi ChriD,
I have the same error with raumserver on Raspberry 3 with loadUri
{"requestUrl":"/raumserver/controller/loadUri?id=Dusche&value=http://1.2.3.4","action":"loadUri","error":true,"msg":"Action was rejected","data":{"errorMessage":"Error: ENOENT: no such file or directory, open 'node_modules/node-raumkernel/lib/setUriMetadata.template'","errorData":null}}
Log:
2018-06-08T17:02:20.932Z - error: [Raumserver] Request was rejected: errorMessage=Error: ENOENT: no such file or directory, open 'node_modules/node-raumkernel/lib/setUriMetadata.template', errorData=null
2018-06-08T17:02:21.632Z - error: [Request.loadUri] Exception thrown: Error: ENOENT: no such file or directory, open 'node_modules/node-raumkernel/lib/setUriMetadata.template'
at Object.fs.openSync (fs.js:584:18)
at Object.fs.readFileSync (fs.js:491:33)
at UPNPMediaRendererRaumfeldVirtual.loadUri (/opt/raumserver/node_modules/node-raumkernel/lib/lib.device.upnp.mediaRenderer.raumfeldVirtual.js:582:23)
at Request_LoadUri.runAction (/opt/raumserver/node_modules/node-raumserver/lib/requestHandlers/lib.request.loadUri.js:22:31)
at /opt/raumserver/node_modules/node-raumserver/lib/lib.base.requestMediaRenderer.js:191:22
at Request_LoadUri.runActionForMediaRenderer (/opt/raumserver/node_modules/node-raumserver/lib/lib.base.requestMediaRenderer.js:177:16)
at Request_LoadUri.run (/opt/raumserver/node_modules/node-raumserver/lib/lib.base.requestMediaRenderer.js:120:47)
at Raumserver.handleRequestObject (/opt/raumserver/node_modules/node-raumserver/lib/lib.raumserver.js:152:28)
at Raumserver.requestReceived (/opt/raumserver/node_modules/node-raumserver/lib/lib.raumserver.js:115:22)
at Server.
Do you have an idea? All other controls are working
I got it working.
What I did: I have created a "node_modules/node-raumkernel/lib/" folder within the node-raumserver folder an copied the "setUriMetadata.template" from the node-raumkernel/lib folder in it.
Maybe there is sth wrong in the kernel with the path?
Thank you for your info I think this is an issue how the lib / node-raumserver is installed. I'll take a look if i can get a better solution for the template files.
I had the same problem as @githubtobi and got it working with his fix. Is there a problem in the code which relies on a specific working directory where node-raumserver has to be started in?
After using LoadUri for loading the stream of a TuneIn Radio Channel, the Raumfeld App shows "Unknown Title" while the stream is working anyway. Does that come from the applied fix, mentioned above or is that rather expected behavior?
No, that does not come from the fix. You may use "LoadContainer" for TuneIn streams, there the meta information should be loaded?
Which value should be passed to LoadContainer? Can I get this value from a property in the output of "getRendererState"?
Yea, should be the value within the mediaItem Tag. For example rStationsButtons container Id's look like this: 0/Renderers/uuid:41aa6673-745a-481b-b075-28876332af2e/StationButtons/21488
You may use following helper to get the container Ids . Not sure if you can get the tune in containers there. https://github.com/ChriD/node-raumkernel/blob/master/sample_contentBrowser.js
Be sure to escape the value. I am not sure if the containerIds shown in the media items are escaped.
I am not sure how to use sample_contentBrowser.js, but anyway I managed to get it working by switching to the desired radio station with the Raumfeld app. Execute getRendererState, scroll down to the mediaItem property. Copy the refID in it and url-encode it. Pass it to LoadSingle (instead of "loadContainer").
That could maybe be something for the wiki? Do you want to allow me to edit the project wiki, than I could merge the content from "my wiki" to the project wiki and add the content above to it.
Sure.. invitaion is on the way