AnaviTechnology / anavi-docs

Documents for all ANAVI open source hardware products
http://anavi.technology/
64 stars 34 forks source link

Cannot configure the rc device for /dev/lirc0 #30

Open xXAzazelXx opened 3 years ago

xXAzazelXx commented 3 years ago

Hi @leon-anavi

Hoping you might be able to assist with troubleshooting irsend issue "Cannot configure the rc device for /dev/lirc0"

After reboot, once again I am getting signals with mode2 -d /dev/lirc1 and now irrecord saves the remote config:

  name  sony
  bits            4
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       2427   585
  one          1219   579
  zero          619   579
  post_data_bits  8
  post_data      0x90
  gap          45031
  toggle_bit_mask 0x0
  frequency    38000

      begin codes
          KEY_VOLUMEUP             0x4
          KEY_VOLUMEDOWN           0xC
          KEY_POWER                0xA
      end codes

pi@raspberrypi:~ $ irsend list sony ""

0000000000000004 KEY_VOLUMEUP
000000000000000c KEY_VOLUMEDOWN
000000000000000a KEY_POWER

Command:

irsend send_once sony KEY_POWER

LOGS:

Aug 21 03:20:23 raspberrypi lircd-0.10.1[468]: Warning: Running as root
Aug 21 03:20:23 raspberrypi lircd-0.10.1[468]: Info: Using remote: sony.
Aug 21 03:20:23 raspberrypi lircd-0.10.1[468]: Notice: lircd(default) ready, using /var/run/lirc/lircd
Aug 21 03:21:51 raspberrypi lircd-0.10.1[468]: Notice: accepted new client on /var/run/lirc/lircd
Aug 21 03:21:51 raspberrypi lircd-0.10.1[468]: Info: Cannot configure the rc device for /dev/lirc0
Aug 21 03:24:25 raspberrypi lircd-0.10.1[468]: Info: removed client
Aug 21 03:24:30 raspberrypi lircd-0.10.1[468]: Notice: accepted new client on /var/run/lirc/lircd
Aug 21 03:24:30 raspberrypi lircd-0.10.1[468]: Info: Cannot configure the rc device for /dev/lirc0
Aug 21 03:24:30 raspberrypi irsend: lirc_command_run: data:END, status:0
Aug 21 03:24:30 raspberrypi lircd-0.10.1[468]: Info: removed client
leon-anavi commented 3 years ago

Hi @xXAzazelXx,

Do you have lircd.conf and lirc_options.conf in the proper paths on the filesystem as per https://github.com/AnaviTechnology/anavi-docs/blob/master/anavi-infrared-phat/anavi-infrared-phat.md#setting-up-lirc ?

After switching to /dev/lirc0 in /etc/lirc/lirc_options.conf have you restarted LIRC systemd service with sudo systemctl restart lircd or rebooted the system so that the new settings can be loaded?

Best regards, Leon

xXAzazelXx commented 3 years ago

Hi @leon-anavi

Thank you,

pi@raspberrypi:/etc/lirc $ ls
irexec.lircrc  lircd-backup.conf  lircd.conf  lircd.conf.d  lircmd.conf  lirc_options.conf
pi@raspberrypi:/etc/lirc $
pi@raspberrypi:~ $ uptime
 09:38:53 up **2 min**,  1 user,  load average: 1.57, 1.11, 0.46
pi@raspberrypi:~ $ tail -f /var/log/messages | grep "lirc"
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Notice: Options: dynamic_codes: (null)
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Notice: Current driver: default
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Notice: Driver API version: 3
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Notice: Driver  version: 0.10.0
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Notice: Driver  info: See file:///usr/share/doc/lirc/plugindocs/default.html
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Info: lircd:  Opening log, level: Info
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Notice: Using systemd fd
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Warning: Running as root
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Info: Using remote: sony.
Aug 22 09:37:18 raspberrypi lircd-0.10.1[473]: Notice: lircd(default) ready, using /var/run/lirc/lircd
Aug 22 09:39:26 raspberrypi lircd-0.10.1[473]: Notice: accepted new client on /var/run/lirc/lircd
Aug 22 09:39:26 raspberrypi lircd-0.10.1[473]: Info: Cannot configure the rc device for /dev/lirc0
Aug 22 09:39:26 raspberrypi irsend: lirc_command_run: data:END, status:0
Aug 22 09:39:26 raspberrypi lircd-0.10.1[473]: Info: removed client

Thank you,

leon-anavi commented 3 years ago

Hi @xXAzazelXx,

Is /dev/lirc0 present in general?

Have a look at this idea about additional configuration for /etc/modules: https://github.com/AnaviTechnology/anavi-docs/issues/21#issuecomment-552838471

Best regards, Leon

xXAzazelXx commented 3 years ago

Hi @leon-anavi

Yeah, I have, I think the issue overall is that I'm not installing the patched packages. I've restarted fresh again and when I get :

Correcting dependencies... Done
Note, selecting 'liblirc0' instead of './liblirc0_0.10.1-6.2~deb10u1_armhf.deb'

I think Pi is downloading the non-patched version.

On top of that, the file version I get is 10.1-6.2 instead of 10.1-5.2 that is in the tutorial.

I don't suppose you have these deb files anywhere from your pi that I can download and try, please?

leon-anavi commented 3 years ago

Hi @xXAzazelXx,

Thank you for reporting the LIRC change of version to 10.1-6.2. I have just done the steps again and updated the user's manual: https://github.com/AnaviTechnology/anavi-docs/blob/master/anavi-infrared-phat/anavi-infrared-phat.md#setting-up-lirc

With 10.1-6.2 the setup is easier. A couple of the old steps can skipped. Could you please try reinstalling LIRC according to the updated version?

Best regards, Leon

xXAzazelXx commented 3 years ago

Hi Leon,

Exactly the same I'm afraid.

pi@raspberrypi:~/lirc-src $ sudo apt install -y ./liblirc0_0.10.1-6.2~deb10u1_armhf.deb ./liblircclient0_0.10.1-6.2~deb10u1_armhf.deb ./lirc_0.10.1-6.2~deb10u1_armhf.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'liblirc0' instead of './liblirc0_0.10.1-6.2~deb10u1_armhf.deb'
Note, selecting 'liblircclient0' instead of './liblircclient0_0.10.1-6.2~deb10u1_armhf.deb'
Note, selecting 'lirc' instead of './lirc_0.10.1-6.2~deb10u1_armhf.deb'
The following package was automatically installed and is no longer required:
  rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  gir1.2-glib-2.0 libgirepository-1.0-1 liblirc-client0 python3-gi
Suggested packages:
  lirc-compat-remotes lirc-drv-irman lirc-doc lirc-x setserial ir-keytable
Recommended packages:
  gir1.2-vte
The following NEW packages will be installed:
  gir1.2-glib-2.0 libgirepository-1.0-1 liblirc-client0 liblirc0 liblircclient0 lirc python3-gi
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 505 kB/1,115 kB of archives.
After this operation, 4,330 kB of additional disk space will be used.
Get:1 /home/pi/lirc-src/liblirc0_0.10.1-6.2~deb10u1_armhf.deb liblirc0 armhf 0.10.1-6.2~deb10u1 [121 kB]
Get:2 /home/pi/lirc-src/lirc_0.10.1-6.2~deb10u1_armhf.deb lirc armhf 0.10.1-6.2~deb10u1 [489 kB]
Get:3 http://mirror.internode.on.net/pub/raspbian/raspbian buster/main armhf libgirepository-1.0-1 armhf 1.58.3-2 [78.8 kB]
Get:4 http://mirror.internode.on.net/pub/raspbian/raspbian buster/main armhf gir1.2-glib-2.0 armhf 1.58.3-2 [143 kB]
Get:5 http://mirror.internode.on.net/pub/raspbian/raspbian buster/main armhf liblirc-client0 armhf 0.10.1-6.2~deb10u1 [68.5 kB]
Get:6 http://mirror.internode.on.net/pub/raspbian/raspbian buster/main armhf liblircclient0 armhf 0.10.1-6.2~deb10u1 [54.5 kB]
Get:7 http://mirror.internode.on.net/pub/raspbian/raspbian buster/main armhf python3-gi armhf 3.30.4-1 [161 kB]
Fetched 505 kB in 5s (92.3 kB/s)
Selecting previously unselected package libgirepository-1.0-1:armhf.
(Reading database ... 52080 files and directories currently installed.)
Preparing to unpack .../0-libgirepository-1.0-1_1.58.3-2_armhf.deb ...
Unpacking libgirepository-1.0-1:armhf (1.58.3-2) ...
Selecting previously unselected package gir1.2-glib-2.0:armhf.
Preparing to unpack .../1-gir1.2-glib-2.0_1.58.3-2_armhf.deb ...
Unpacking gir1.2-glib-2.0:armhf (1.58.3-2) ...
Selecting previously unselected package liblirc-client0:armhf.
Preparing to unpack .../2-liblirc-client0_0.10.1-6.2~deb10u1_armhf.deb ...
Unpacking liblirc-client0:armhf (0.10.1-6.2~deb10u1) ...
Selecting previously unselected package liblirc0:armhf.
Preparing to unpack .../3-liblirc0_0.10.1-6.2~deb10u1_armhf.deb ...
Unpacking liblirc0:armhf (0.10.1-6.2~deb10u1) ...
Selecting previously unselected package liblircclient0.
Preparing to unpack .../4-liblircclient0_0.10.1-6.2~deb10u1_armhf.deb ...
Unpacking liblircclient0 (0.10.1-6.2~deb10u1) ...
Selecting previously unselected package lirc.
Preparing to unpack .../5-lirc_0.10.1-6.2~deb10u1_armhf.deb ...
Unpacking lirc (0.10.1-6.2~deb10u1) ...
Selecting previously unselected package python3-gi.
Preparing to unpack .../6-python3-gi_3.30.4-1_armhf.deb ...
Unpacking python3-gi (3.30.4-1) ...
Setting up liblirc0:armhf (0.10.1-6.2~deb10u1) ...
Setting up liblirc-client0:armhf (0.10.1-6.2~deb10u1) ...
Setting up libgirepository-1.0-1:armhf (1.58.3-2) ...
Setting up liblircclient0 (0.10.1-6.2~deb10u1) ...
Setting up lirc (0.10.1-6.2~deb10u1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/lircd.service → /lib/systemd/system/lircd.service.
Created symlink /etc/systemd/system/sockets.target.wants/lircd.socket → /lib/systemd/system/lircd.socket.
Setting up gir1.2-glib-2.0:armhf (1.58.3-2) ...
Setting up python3-gi (3.30.4-1) ...
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpi1) .
pi@raspberrypi:~ $ irsend LIST sony ""

0000000000000002 KEY_POWER
0000000000000004 KEY_VOLUMEUP
0000000000000004 KEY_VOLUMEDOWN

pi@raspberrypi:~ $ irsend SEND_ONCE sony KEY_POWER
Aug 23 23:15:19 raspberrypi lircd-0.10.1[472]: Notice: accepted new client on /var/run/lirc/lircd
Aug 23 23:15:19 raspberrypi lircd-0.10.1[472]: Info: Cannot configure the rc device for /dev/lirc0
Aug 23 23:15:19 raspberrypi irsend: lirc_command_run: data:END, status:0
Aug 23 23:15:19 raspberrypi lircd-0.10.1[472]: Info: removed client
leon-anavi commented 3 years ago

Hi @xXAzazelXx,

I also get the info message about "Cannot configure the rc" in lircd logs but it is harmless and sending the infrared signals in my test setup with Raspberry Pi 4 Model B works fine:

pi@raspberrypi:~$ irsend LIST hifi ""

0000000000000a81 KEY_POWER
pi@raspberrypi:~$ irsend SEND_ONCE hifi KEY_POWER
driver          = default
device          = /dev/lirc0
Aug 24 11:48:46 raspberrypi lircd[538]: lircd-0.10.1[538]: Notice: accepted new client on /var/run/lirc/lircd
Aug 24 11:48:46 raspberrypi lircd-0.10.1[538]: Notice: accepted new client on /var/run/lirc/lircd
Aug 24 11:48:46 raspberrypi lircd[538]: lircd-0.10.1[538]: Info: Cannot configure the rc device for /dev/lirc0
Aug 24 11:48:46 raspberrypi lircd-0.10.1[538]: Info: Cannot configure the rc device for /dev/lirc0
Aug 24 11:48:46 raspberrypi lircd[538]: lircd-0.10.1[538]: Info: removed client
Aug 24 11:48:46 raspberrypi lircd-0.10.1[538]: Info: removed client

Despite this info message, the other device in my test setup accept the infrared codes fine.

If the other device isn't accepting the sent infrared codes this might be caused by incorrect scanned remote control. Please also keep in mind, as mentioned in the user's manual, in rare cases some devices might require codes to be sent in short bursts, for example:

irsend send_once hifi KEY_POWER KEY_POWER KEY_POWER

Best regards, Leon

xXAzazelXx commented 3 years ago

Hi @leon-anavi

Thank you very much but no change. I've tried 4 different remotes ( two were just Sony Bravia TV) and had no luck.

I think the anavi board itself might be OK and its just the LIRC but I don't know what else to do. Maybe I will leave it for 6 months or so until there is a new version of LIRC :/

leon-anavi commented 3 years ago

Hi @xXAzazelXx,

What are the other remote controls that you tried? Are you sure the scanned infrared codes are correct? Have you tried scanning codes with LIRC in raw mode?

Another idea: with a camera you can have a look if the infrared LEDs quickly blink when executing irsend (but not a modern iPhone or another camera that filters out infrared). It's a little bit tricky test but it is an option to see if the LEDs emit.

Best regards, Leon

xXAzazelXx commented 3 years ago

Hi @leon-anavi

I've tried two, sony remotes, one Mitsubishi remote ( didn't work, just keep getting zeros) and a generic 5 button remote for HDMI hub. No, I haven't tried the raw mode yet.

Thank you for telling me about the camera trick! I think the issue is that I am not sending the signal. I can see the lights on my sony remotes flashing but if I look at the remote during irsend the two blue LEDs on anavi board are not blinking.

/etc/lirc/lirc_options.conf
device          = /dev/lirc0
output          = /var/run/lirc/lircd

/boot/config.txt
dtoverlay=gpio-ir,gpio_pin=18
dtoverlay=gpio-ir-tx,gpio_pin=17

Restarted Pi