I am trying to configure a Bluesound RC-1 remote to control my Volumio 2.681 on Raspberry Pi 4.
First I created a “Bluesound” folder under
\data\plugins\accessory\ir_controller\configurations
and copied lircd.conf and lircrc files from another remote control folder for modicfication.
This works fine and Bluesound is can be choosed as remote control from pull down menu under plugins.
Next thing to do was to record the RC-1 output codes as I could not find them anywhere. For that I used this tutorial. I was also using another Pi for that, not the one I am running Volumio on.
So I got output and next I should modify my lircd.conf and lircrc files in my Bluesound folder. That’s where I am stuck. Especially the contents of the lircd.conf file before the actual remote codes is something I have no idea about.
So the result at the moment is “Error in saving settings” when choosing the Bluesound remote.
This is what my lircd.conf and lircrc files look like at the moment.
lircd.conf:
begin remote
name lircd.conf
bits 32
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
header 9013 4436
one 599 1629
zero 599 499
ptrail 598
repeat 9013 2178
gap 107978
toggle_bit_mask 0x0
frequency 38000
Assuming your self recorded “lircd.conf” is currently located in “/home/volumio” you could just copy it to “/data/plugins/accessory/ir_controller/configurations/Bluesound” like this:
I have one more question. Is there a way to add url’s for web radio stations to “lircrc” file? I would like to add a function that would start playing web radio by pressing the number buttons of the Bluesound remote.
Did not test if it still works but this could be useful.
If you should copy the code of the script from there be careful as the code tags did not translate when the forum platform was changed some time ago, but are printed as “[code]” and “[\code]”. They are not part of the script file. Also check for the line breaks.
BTW and just out of interest: What was the lirc version you recorded the lircd.conf with?
No success yet. I get following when trying to install socket.io-client.
npm WARN saveError ENOENT: no such file or directory, open '/home/volumio/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/volumio/package.json'
npm WARN ws@7.4.3 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.3 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN volumio No description
npm WARN volumio No repository field.
npm WARN volumio No README data
npm WARN volumio No license field.
I have added my prefered radio stations as playlists and can start them with the remote by calling the playlist name. That was the cleanest way to do it imo.
I have lines like this in my lircrc :
begin
prog = irexec
button = KEY_1
config = curl -v “localhost:3000/api/v1/commands/?cmd=playplaylist&name=P1”
end
begin
prog = irexec
button = KEY_4
config = curl -v “localhost:3000/api/v1/commands/?cmd=playplaylist&name=P4”
end
I’m pretty shure there is a way to call radio favourites in a similar way but I choose playlists for some reason that I have now forgotten.
I think that maybe you would have to add the playlists manually with an ftp client or something. I think that it was how I did it. Each playlist is in its own file with a format like this:
[{“artist”:“Sveriges Radio P1”,“service”:“webradio”,“title”:“SR P1”,“uri”:“https://sverigesradio.se/topsy/direkt/132-hi-aac.m3u”}]
And I have a feeling that @gvolt was involved in finding out how to do this…
It would be nice to have this ability to add radio stations to remote buttons directly from the plugin config gui if possible. It’s one of the best features of volumio imo to be able to start the morning radio with the remote.
Prior to running “npm install …” change into the directory where you placed your .js script, e.g.:
cd /usr/local/bin
Further more the latest socket.io-client version 3.1.1 does not install on the node version Volumio 2.861 has.
What should work is
npm install socket.io-client@^2.4.0
You will see some warnings but they should not stop the show.
After that the script should work. Maybe you need to make it executable:
chmod +x /usr/local/bin/yourscript.js
I just tested this slightly changed script:
#!/bin/node
var io = require('socket.io-client');
var socket = io.connect('http://localhost:3000');
var fs = require('fs');
var content = fs.readFileSync('/data/favourites/my-web-radio');
var webradios = JSON.parse(content);
var radio = webradios.find(o => o.name === process.argv[2]);
if (radio == null) {
socket.disconnect();
} else {
socket.emit('replaceAndPlay', {'service':radio.service,'title':radio.name,'uri':radio.uri});
socket.on('pushState', function() { socket.disconnect(); } );
}
setTimeout(function() { socket.disconnect(); }, 500);
The script needs the name of the radio station as it is saved to “/data/favourites/my-web-radio” as parameter, so calling the script from lircrc would be e.g.
begin
prog = irexec
button = KEY_1
config = /usr/local/bin/yourscript.js "Name of the radio station"
end
Opened a PR on GitHub to add the Bluesound RC1 to the collection of remote controls.
For the PR the lircrc file has been complemented with commands to control volume. I could imagine that you don’t need these commands and left them out intentionally. If the PR gets merged the new profile will be called “Bluesound RC1” so will not interfere with the profile (named “Bluesound” I think) you have already created on your system.
Thanks for providing the “lircd.conf”!
Edit:@balbuze already merged the PR So the new profile is now available with version 1.3.4 of the IR Controller plugin.