Custom remote control (Bluesound RC-1)

Hi there,

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

  begin codes
      KEY_POWER                0x61F01AE5 0xD55FFF00

KEY_BRIGHTNESS_CYCLE 0x61F052AD 0xD55FFF00

      KEY_UP                   0x61F0827D 0xD55FFF00
      KEY_DOWN                 0x61F042BD 0xD55FFF00
      KEY_LEFT                 0x61F08A75 0xD55FFF00
      KEY_RIGHT                0x61F00AF5 0xD55FFF00
      KEY_ENTER                0x61F0E21D 0xD55FFF00

KEY_MUTE 0x61F0AA55 0xD55FFF00

KEY_VOLUMEUP 0x61F0CA35 0xD55FFF00

KEY_VOLUMEDOWN 0x61F02AD5 0xD55FFF00

KEY_1 0x61F0DA25 0xD55FFF00

KEY_2 0x61F03AC5 0xD55FFF00

KEY_3 0x61F0BA45 0xD55FFF00

KEY_4 0x61F07A85 0xD55FFF00

KEY_5 0x61F0FA05 0xD55FFF00

KEY_6 0x61F006F9 0xD55FFF00

KEY_7 0x61F01EE1 0xD55FFF00

KEY_8 0x61F09E61 0xD55FFF00

KEY_9 0x61F05EA1 0xD55FFF00

KEY_0 0x61F0DE21 0xD55FFF00

  end codes

end remote

lircrc:

begin
prog = irexec
button = KEY_ENTER
config = /usr/local/bin/volumio toggle
end

begin
prog = irexec
button = KEY_RIGHT
config = /usr/local/bin/volumio next
end

begin
prog = irexec
button = KEY_LEFT
config = /usr/local/bin/volumio previous
end

begin
prog = irexec
button = KEY_UP
config = /usr/local/bin/volumio seek plus
end

begin
prog = irexec
button = KEY_DOWN
config = /usr/local/bin/volumio seek minus
end

begin
prog = irexec
button = KEY_POWER
config = shutdown -h now;sleep 1
end

Can you tell me where I am going wrong?

Greets,
Antti

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:

cp ~/lircd.conf /data/plugins/accessory/ir_controller/configurations/Bluesound/lircd.conf

Make sure you only have two files (“lircd.conf” and “lircrc”) in “/data/plugins/accessory/ir_controller/configurations/Bluesound”.

P.S.: Linux uses slashes ("/") not backslashes ("\") in path statements.

Thank you! It works now!

The error seemed to be caused by other unnecessary files in Bluesound folder. I also had to remove the 0xD55FFF00 part of the recorded codes.

Here is a working lircd.conf for Bluesound RC-1 remote in case someone needs it:

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

      begin codes
          KEY_POWER                0x61F01AE5
          KEY_BRIGHTNESS_CYCLE     0x61F052AD
          KEY_UP                   0x61F0827D
          KEY_DOWN                 0x61F042BD
          KEY_LEFT                 0x61F08A75
          KEY_RIGHT                0x61F00AF5
          KEY_ENTER                0x61F0E21D
          KEY_MUTE                 0x61F0AA55
          KEY_VOLUMEUP             0x61F0CA35
          KEY_VOLUMEDOWN           0x61F02AD5
          KEY_1                    0x61F0DA25
          KEY_2                    0x61F03AC5
          KEY_3                    0x61F0BA45
          KEY_4                    0x61F07A85
          KEY_5                    0x61F0FA05
          KEY_6                    0x61F006F9
          KEY_7                    0x61F01EE1
          KEY_8                    0x61F09E61
          KEY_9                    0x61F05EA1
          KEY_0                    0x61F0DE21
      end codes

end remote

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.

The lirc version for recording was 0.10.1-6.2~deb10u1+rpt1.

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… :wink:

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.

Thanks for the info. :slight_smile:

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 :+1: So the new profile is now available with version 1.3.4 of the IR Controller plugin.